any option to know if apple app get the push notification?

后端 未结 5 535
清酒与你
清酒与你 2020-12-06 18:31

I build xcode app that get push notification, the main problem is that the push notification is very critical for me. so I want to check if the push notification is delivere

5条回答
  •  悲&欢浪女
    2020-12-06 19:09

    With iOS7 you have a new method called application:didReceiveRemoteNotification:fetchCompletionHandler: which you probably could use for your task. From Apple's Docs:

    Implement this method if your app supports the remote-notification background mode. ... When a push notification arrives, the system displays the notification to the user and launches the app in the background (if needed) so that it can call this method. Use this method to download any data related to the push notification. When your method is done, call the block in the handler parameter.

    Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running, the system calls this method regardless of the state of your app.

提交回复
热议问题