Receive push when app is closed

后端 未结 2 788
鱼传尺愫
鱼传尺愫 2020-12-12 03:43

I am trying to save a data that comes with push notification payload. It works well when the app is running but not when the app is closed.

how can I save data from

2条回答
  •  半阙折子戏
    2020-12-12 04:31

    The following is taken from the apple documentation...

    Use this method to process incoming remote notifications for your app. Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running in the foreground, the system calls this method when your app is running in the foreground or background. 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 push notification arrives. However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.

    Note the highlighted text, the app will not be started if it is completely closed

提交回复
热议问题