GCM Notifications Not Received When App Is in Background Mode on iOS
This issue arises when iOS receives notifications in the background but does not handle them in the user interface. To resolve this, ensure that your app:
-
Enables Background Push Notifications: Check that your app has requested and received permission to receive push notifications in the background.
-
Sets the Badge App Icon: Verify that the "Badge App Icon" option is selected in the Settings > Notifications section for your app.
-
Enables Background Fetch: Configure your app's background fetch settings to allow it to fetch push notifications in the background.
-
Handles Background Notifications: Implement the didReceiveRemoteNotification: and didReceiveRemoteNotification:fetchCompletionHandler: methods in your app's AppDelegate class to handle incoming notifications.
-
Uses the Content-Available Key: Specify the "content-available" key in your push notification payload to ensure that the device wakes up to receive the notification even when in the background.
The above is the detailed content of How to Solve GCM Notifications Not Received in Background Mode on iOS. For more information, please follow other related articles on the PHP Chinese website!