didReceiveRemoteNotification not called, iOS 10

后端 未结 8 1409
误落风尘
误落风尘 2020-11-22 08:27

In iOS 9.3, the didReceiveRemoteNotification method gets called on both of the following occasions.

1) When the push notification is received 2) When

8条回答
  •  一生所求
    2020-11-22 09:07

    swift 4, if you are using ios 11 or xcode version greater than 9.0 then you must have use UNUserNotification delegate method to call the didReceiveRemoteNotification

      func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
    
    //Your code to handle events
    
    }
    

提交回复
热议问题