swift:completionHandler(UIBackgroundFetchResult.newData)不工作

swift:completionHandler(UIBackgroundFetchResult.newData)不工作,swift,push-notification,google-cloud-messaging,swift4,Swift,Push Notification,Google Cloud Messaging,Swift4,我收到推送通知,但未收到显示通知: func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { print("Message ID2: \(userInfo

我收到推送通知,但未收到显示通知:

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    print("Message ID2: \(userInfo)")
    completionHandler(UIBackgroundFetchResult.newData)
}
打印消息ID2没问题:

消息ID2:[AnyHashable(“google.c.a.e”):1,AnyHashable(“TEXT”): 接下来,AnyHashable(“gcm.notification.POSITION”):票证, AnyHashable(“位置”):票证,AnyHashable(“标题”):测试, AnyHashable(“gcm.message_id”):0:1534328572978948%f6f48aeff6f48aef, AnyHashable(“aps”):{ 警报={ body=NEXT; 标题=测试; }; 声音=默认值;}]


同样在
setting>app
all permission accepted

中,只是一个提示,你的app成功了吗?@Mr.Rebot是的,我成功了