1

当应用程序完全关闭时,我试图接收静默推送通知,但我没有收到推送,我错过了什么?

  1. 我在拆分中添加:必需的后台模式->应用程序下载内容以响应推送通知

  2. 我在AppDelagate

    func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
    
    completionHandler(UIBackgroundFetchResult.NewData);
    JLToast.makeText("background").show()}
    
  3. 我发送推送:

    aps { 内容可用:1 }

当应用程序在后台时,我会收到静默推送通知,但是当应用程序在后台(完全被击落)时,我没有收到推送。

什么不见​​了?

4

1 回答 1

1

As far as I know, silent push notification won't work in case the app is forced quit (by user). Consider 2 cases:

  • Force quit (by user, removing app from running apps list): app won't get notifications
  • Not force quit (Eg: when user restarts the phone, the app will be closed but it's not considered as being forced quit by user): the app will be launched in background mode and receive notifications
于 2015-02-24T15:53:06.547 回答