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:
    • 應用程序在前臺運行時會調起該方法
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容