application:didReceiveRemoteNotification: 和 application:didReceiveRemoteNotification:fetchCompletionHandler: 的区别

  • 苹果文档

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 remote 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.

当通知来了
  • - application:didReceiveRemoteNotification:fetchCompletionHandler:
    • 应用程序在前台或后台运行时都会调起该方法
    • 当该方法使用后,- application:didReceiveRemoteNotification: 会失效
  • - application:didReceiveRemoteNotification:
    • 应用程序在前台运行时会调起该方法
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容