When my application is in the background, push notifications are only processed if I touch the top notification banner

I implemented

application:didReceiveRemoteNotification: 

to store data in my application when receiving a push notification.

However, when my application is in the background and I receive a notification, the data is saved only if I touch the notification banner from above:

enter image description here

Instead, if I touch the application icon to reopen it, the contents of the notification will not be saved:

enter image description here

Since I only receive notifications when using the distribution profile, I'm not sure if application:didReceiveRemoteNotification: is only called when I click the notification banner at the top.

I thought it was always called when a notification was received, and not after a user action on the device.

UPDATE I don't know if this will help, but to tell you, I have not implemented any of these methods:

 – applicationDidEnterBackground: – applicationWillEnterForeground: - applicationDidBecomeActive: 
+8
ios push-notification
source share
1 answer

I think I found out why. From the documentation:

If the action button is pressed (on an iOS device), the system launches the application, and the application calls its delegates application: didFinishLaunchingWithOptions: method (if implemented); This passes in the notification payload (for remote notifications) or the local notification object (for local notifications).

If the application icon is displayed on an iOS device, the application calls the same method but does not provide any notification information.

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html

However, I am wondering if there is a way to load the payload, even if the application was re-opened by tapping the icon.

+1
source share

All Articles