{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/quickstart-ios/issues/290","repository_url":"https://api.github.com/repos/firebase/quickstart-ios","labels_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/290/comments","events_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/290/events","html_url":"https://github.com/firebase/quickstart-ios/issues/290","id":232959845,"number":290,"title":"Push Notifications not working after update to Firebase 4.0","user":{"login":"djErock","id":7953289,"avatar_url":"https://avatars0.githubusercontent.com/u/7953289?v=3","gravatar_id":"","url":"https://api.github.com/users/djErock","html_url":"https://github.com/djErock","followers_url":"https://api.github.com/users/djErock/followers","following_url":"https://api.github.com/users/djErock/following{/other_user}","gists_url":"https://api.github.com/users/djErock/gists{/gist_id}","starred_url":"https://api.github.com/users/djErock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djErock/subscriptions","organizations_url":"https://api.github.com/users/djErock/orgs","repos_url":"https://api.github.com/users/djErock/repos","events_url":"https://api.github.com/users/djErock/events{/privacy}","received_events_url":"https://api.github.com/users/djErock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":32,"created_at":"2017-06-01T17:54:40Z","updated_at":"2017-06-02T17:27:12Z","closed_at":null,"body":"I updated my pods yesterday to the new Firebase 4.0. I went through the suggested changes and grabbed code from this Github example. I installed the APNS key .p8 file from Apple. Re-Downloaded the google.plist file to my project. turned swizzling off. Replaced this examples code with my own. I will be honest I am at a loss, I take the FCM Token from the console and send a message from the firebase console and I get nothing.\r\n\r\nI refresh and it says the message was sent but I check the xCode console and the device and nothing is there. What am I missing? Is there any way to figure out where the message is getting jammed up?\r\n\r\n```\r\n\r\n//\r\n//  Created by Erik Grosskurth on 4/24/17.\r\n//\r\n\r\nimport UIKit\r\nimport UserNotifications\r\nimport Firebase\r\nimport Quickblox\r\nimport QuickbloxWebRTC\r\n\r\nlet kQBApplicationID:UInt = 1234\r\nlet kQBAuthKey = \"sfgsrvsrvsr\"\r\nlet kQBAuthSecret = \"wsevwrvwervwrv\"\r\nlet kQBAccountKey = \"wrvwrvwrvwrvwrvw\"\r\n\r\n@UIApplicationMain\r\nclass AppDelegate: UIResponder, UIApplicationDelegate {\r\n    \r\n    var window: UIWindow?\r\n    let gcmMessageIDKey = \"gcm.message_id\"\r\n    \r\n    func application(_ application: UIApplication,\r\n                     didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {\r\n        \r\n        // [ START Quickblox config ]\r\n        QBSettings.setApplicationID(kQBApplicationID)\r\n        QBSettings.setAuthKey(kQBAuthKey)\r\n        QBSettings.setAuthSecret(kQBAuthSecret)\r\n        QBSettings.setAccountKey(kQBAccountKey)\r\n        QBSettings.setApiEndpoint(\"https://apicaduceustelemed.quickblox.com\", chatEndpoint: \"chatcaduceustelemed.quickblox.com\", forServiceZone: .production)\r\n        QBSettings.setServiceZone(.production)\r\n        QBSettings.setKeepAliveInterval(30)\r\n        QBSettings.setAutoReconnectEnabled(true)\r\n        QBRTCConfig.setStatsReportTimeInterval(1)\r\n        QBRTCConfig.setDialingTimeInterval(5)\r\n        QBRTCConfig.setAnswerTimeInterval(60)\r\n        // [ END Quickblox config ]\r\n        \r\n        FirebaseApp.configure()\r\n        \r\n        // [START set_messaging_delegate]\r\n        Messaging.messaging().delegate = self\r\n        // [END set_messaging_delegate]\r\n        // Register for remote notifications. This shows a permission dialog on first run, to\r\n        // show the dialog at a more appropriate time move this registration accordingly.\r\n        // [START register_for_notifications]\r\n        if #available(iOS 10.0, *) {\r\n            // For iOS 10 display notification (sent via APNS)\r\n            UNUserNotificationCenter.current().delegate = self\r\n            \r\n            let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]\r\n            UNUserNotificationCenter.current().requestAuthorization(\r\n                options: authOptions,\r\n                completionHandler: {_, _ in })\r\n        } else {\r\n            let settings: UIUserNotificationSettings =\r\n                UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)\r\n            application.registerUserNotificationSettings(settings)\r\n        }\r\n        \r\n        application.registerForRemoteNotifications()\r\n        \r\n        // [END register_for_notifications]\r\n        return true\r\n    }\r\n    \r\n    // [START receive_message]\r\n    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {\r\n        // If you are receiving a notification message while your app is in the background,\r\n        // this callback will not be fired till the user taps on the notification launching the application.\r\n        // TODO: Handle data of notification\r\n        // With swizzling disabled you must let Messaging know about the message, for Analytics\r\n        Messaging.messaging().appDidReceiveMessage(userInfo)\r\n        // Print message ID.\r\n        if let messageID = userInfo[gcmMessageIDKey] {\r\n            print(\"Message ID: \\(messageID)\")\r\n        }\r\n        \r\n        // Print full message.\r\n        print(userInfo)\r\n    }\r\n    \r\n    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],\r\n                     fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {\r\n        // If you are receiving a notification message while your app is in the background,\r\n        // this callback will not be fired till the user taps on the notification launching the application.\r\n        // TODO: Handle data of notification\r\n        // With swizzling disabled you must let Messaging know about the message, for Analytics\r\n        Messaging.messaging().appDidReceiveMessage(userInfo)\r\n        // Print message ID.\r\n        if let messageID = userInfo[gcmMessageIDKey] {\r\n            print(\"Message ID: \\(messageID)\")\r\n        }\r\n        \r\n        // Print full message.\r\n        print(userInfo)\r\n        \r\n        completionHandler(UIBackgroundFetchResult.newData)\r\n    }\r\n    // [END receive_message]\r\n    func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {\r\n        print(\"Unable to register for remote notifications: \\(error.localizedDescription)\")\r\n    }\r\n    \r\n    // This function is added here only for debugging purposes, and can be removed if swizzling is enabled.\r\n    // If swizzling is disabled then this function must be implemented so that the APNs token can be paired to\r\n    // the FCM registration token.\r\n    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\r\n        print(\"APNs token retrieved: \\(deviceToken)\")\r\n        \r\n        // With swizzling disabled you must set the APNs token here.\r\n        Messaging.messaging().apnsToken = deviceToken\r\n    }\r\n}\r\n\r\n// [START ios_10_message_handling]\r\n@available(iOS 10, *)\r\nextension AppDelegate : UNUserNotificationCenterDelegate {\r\n    \r\n    // Receive displayed notifications for iOS 10 devices.\r\n    func userNotificationCenter(_ center: UNUserNotificationCenter,\r\n                                willPresent notification: UNNotification,\r\n                                withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {\r\n        let userInfo = notification.request.content.userInfo\r\n        \r\n        // With swizzling disabled you must let Messaging know about the message, for Analytics\r\n        Messaging.messaging().appDidReceiveMessage(userInfo)\r\n        // Print message ID.\r\n        if let messageID = userInfo[gcmMessageIDKey] {\r\n            print(\"Message ID: \\(messageID)\")\r\n        }\r\n        \r\n        // Print full message.\r\n        print(userInfo)\r\n        \r\n        // Change this to your preferred presentation option\r\n        completionHandler([])\r\n    }\r\n    \r\n    func userNotificationCenter(_ center: UNUserNotificationCenter,\r\n                                didReceive response: UNNotificationResponse,\r\n                                withCompletionHandler completionHandler: @escaping () -> Void) {\r\n        let userInfo = response.notification.request.content.userInfo\r\n        // Print message ID.\r\n        if let messageID = userInfo[gcmMessageIDKey] {\r\n            print(\"Message ID: \\(messageID)\")\r\n        }\r\n        \r\n        // Print full message.\r\n        print(userInfo)\r\n        \r\n        completionHandler()\r\n    }\r\n}\r\n// [END ios_10_message_handling]\r\n\r\nextension AppDelegate : MessagingDelegate {\r\n    // [START refresh_token]\r\n    func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {\r\n        print(\"Firebase registration token: \\(fcmToken)\")\r\n    }\r\n    // [END refresh_token]\r\n    // [START ios_10_data_message]\r\n    // Receive data messages on iOS 10+ directly from FCM (bypassing APNs) when the app is in the foreground.\r\n    // To enable direct data messages, you can set Messaging.messaging().shouldEstablishDirectChannel to true.\r\n    func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {\r\n        print(\"Received data message: \\(remoteMessage.appData)\")\r\n    }\r\n    // [END ios_10_data_message]\r\n}\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/firebase/quickstart-ios/issues/comments/305858143","html_url":"https://github.com/firebase/quickstart-ios/issues/290#issuecomment-305858143","issue_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/290","id":305858143,"user":{"login":"djErock","id":7953289,"avatar_url":"https://avatars0.githubusercontent.com/u/7953289?v=3","gravatar_id":"","url":"https://api.github.com/users/djErock","html_url":"https://github.com/djErock","followers_url":"https://api.github.com/users/djErock/followers","following_url":"https://api.github.com/users/djErock/following{/other_user}","gists_url":"https://api.github.com/users/djErock/gists{/gist_id}","starred_url":"https://api.github.com/users/djErock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djErock/subscriptions","organizations_url":"https://api.github.com/users/djErock/orgs","repos_url":"https://api.github.com/users/djErock/repos","events_url":"https://api.github.com/users/djErock/events{/privacy}","received_events_url":"https://api.github.com/users/djErock/received_events","type":"User","site_admin":false},"created_at":"2017-06-02T17:27:12Z","updated_at":"2017-06-02T17:27:12Z","body":"I am in the process of doing that now. I have to make a .pem file that works first. I have a sinking feeling this has to do with having certs previous first and now changing over to the auth key. Give me some time as I have gotten homebrew and curl set up to send http/2 set up but it said my pem file i made was: curl: (58) could not load PEM client certificate, OpenSSL error error:02001002:system library:fopen:No such file or directory, (no key found, wrong pass phrase, or wrong file format?)"}}
{"actor":{"display_login":"djErock"}}