Remote Notifications in iOS 10.1.1

Hi,

I am trying to process Remote Notifications (content-available = 1) on my iOS application. I have enabled both Push Notifications and Background Modes (Remote Notifications) in my XCode project. This is what I observe:


1) If my application had been launched since the previous reboot and has not been swiped up:

The application:didReceiveRemoteNotification:fetchCompletionHandler: gets called when the notification arrives - as expected.


2) If my application had not been launched explicitly since the previous reboot:

The application:didReceiveRemoteNotification:fetchCompletionHandler: function does not get called. However, Apple documentation seems to indicate that my application should be launched when a notification does come in.


To quote the documentation:

"...In addition, if you enabled the remote notifications background mode, the system launches your app (or wakes it from the suspended state) and puts it in the background state when a remote notification arrives..."


One important thign to note is that the system alert is displayed when the remote notification arrives in both cases. The problem in case 2 is only with the code not getting executed.


Has anyone ever experienced this problem? Is what I am seeing the expected behavior?

Hi, BalaG. May I ask you a favor to know about how did you make the first case happen?

  1. can I just running my app on my device or need I archive a release package to test?
  2. can I test this mechanism on simulator or it must been tested on real device?

I'ma very appreciate if I could get any of inspiration from you. I couldn't make it happen til now and it makes me very confused.

Remote Notifications in iOS 10.1.1
 
 
Q