<分区>
如何解决上述问题。谢谢。
let notificationTypes : UIUserNotificationType = [UIUserNotificationType.alert , UIUserNotificationType.badge, UIUserNotificationType.sound]
let notificationSettings = UIUserNotificationSettings(types: notificationTypes,categories : nil)
application.registerForRemoteNotifications()
application.registerUserNotificationSettings(notificationSettings)
return true
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
print("MessageID: \(userInfo["gcm_message_id"])") //the error is in this line
print(userInfo)