Push notification not receiving in background iOS

后端 未结 3 939
情深已故
情深已故 2020-12-07 05:31

I am doing push notification in my project through GCM. My Application is able to receive notification in foreground but not in background.

I receive a message insi

3条回答
  •  渐次进展
    2020-12-07 06:09

    use this payload

    {
        "aps": {
            "alert": "Hello World",
            "sound": "default"
            "content-available" :1
        }
    }
    

    With content-available enabled:

    1 App is in Foreground

    No system alert shown

    application:didReceiveRemoteNotification:fetchCompletionHandler: is called

    2 App is in Background

    System alert is shown

    application:didReceiveRemoteNotification:fetchCompletionHandler: is called

    3App is in Suspended

    App state changes to Background

    System alert is shown

    application:didReceiveRemoteNotification:fetchCompletionHandler: is called

    4 App is Not Running because killed by user

    System alert is shown

    No callback is called

提交回复
热议问题