When your iOS application receives a push notification while in foreground, the
didReceiveRemoteNotification method in the application’s
AppDelegate gets called. You get the whole push notification payload and you can react to it. But there is a problem introduced in iOS 11, then fixed and then broken again (like many things done by Apple these days) that
didReceiveRemoteNotification does not get called when a push notification arrives and the application is in foreground. This can be really bad if your application depends on reliable push notifications while running.
The worst thing about this problem is that everything seems to be working while you are debugging the application from XCode. The method gets called, the payload is available. But when you open the application in your iPhone or iPad without the debugger attached,
didReceiveRemoteNotification just never gets called. There are many developers reporting this problem on the Apple forums and on StackOverflow.