{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/quickstart-ios/issues/273","repository_url":"https://api.github.com/repos/firebase/quickstart-ios","labels_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/273/comments","events_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/273/events","html_url":"https://github.com/firebase/quickstart-ios/issues/273","id":230480379,"node_id":"MDU6SXNzdWUyMzA0ODAzNzk=","number":273,"title":"APNS stops working on FCM Token Refresh","user":{"login":"victorlsn","id":19478869,"node_id":"MDQ6VXNlcjE5NDc4ODY5","avatar_url":"https://avatars3.githubusercontent.com/u/19478869?v=4","gravatar_id":"","url":"https://api.github.com/users/victorlsn","html_url":"https://github.com/victorlsn","followers_url":"https://api.github.com/users/victorlsn/followers","following_url":"https://api.github.com/users/victorlsn/following{/other_user}","gists_url":"https://api.github.com/users/victorlsn/gists{/gist_id}","starred_url":"https://api.github.com/users/victorlsn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorlsn/subscriptions","organizations_url":"https://api.github.com/users/victorlsn/orgs","repos_url":"https://api.github.com/users/victorlsn/repos","events_url":"https://api.github.com/users/victorlsn/events{/privacy}","received_events_url":"https://api.github.com/users/victorlsn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2017-05-22T18:29:51Z","updated_at":"2019-04-16T08:41:28Z","closed_at":"2017-10-25T21:52:52Z","author_association":"NONE","body":"I'm having a big problem:\r\n\r\nWhen I install the app and run the app for the first time, both the APNS and FCM notifications work ok. I can send Push Notifications via FCM and they're received via FCM and APNS with no problem.\r\nWhen the FCM token is updated though, I stop receiving Notifications through the method didReceiveRemoteNotification at all, and am only able to receive messages through the (received remoteMessage: MessagingRemoteMessage) - that said, the Notification dictionary of my push isn't read as a APNS.\r\nI haven't disabled FCM's swizzling, here's the code I use for setting up Push Notifications:\r\n\r\n```\r\nfunc setupUserNotifications(application: UIApplication) {\r\n        if #available(iOS 10.0, *) {\r\n            let authOptions : UNAuthorizationOptions = [.alert, .badge, .sound]\r\n            UNUserNotificationCenter.current().requestAuthorization(\r\n                options: authOptions, completionHandler: {_,_ in })\r\n            \r\n            // For iOS 10 display notification (sent via APNS)\r\n            UNUserNotificationCenter.current().delegate = self\r\n            // For iOS 10 data message (sent via FCM)\r\n            Messaging.messaging().delegate = self\r\n            \r\n        } else {\r\n            // Fallback on earlier versions\r\n            let settings: UIUserNotificationSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)\r\n            \r\n            application.registerUserNotificationSettings(settings)\r\n        }\r\n        \r\n        application.registerForRemoteNotifications()\r\n        \r\n        FirebaseApp.configure()\r\n        \r\n        if let token = Messaging.messaging().fcmToken() {\r\n            connectToFcm(token)\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/firebase/quickstart-ios/issues/comments/483567751","html_url":"https://github.com/firebase/quickstart-ios/issues/273#issuecomment-483567751","issue_url":"https://api.github.com/repos/firebase/quickstart-ios/issues/273","id":483567751,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4MzU2Nzc1MQ==","user":{"login":"raiffeisennet","id":4060299,"node_id":"MDQ6VXNlcjQwNjAyOTk=","avatar_url":"https://avatars3.githubusercontent.com/u/4060299?v=4","gravatar_id":"","url":"https://api.github.com/users/raiffeisennet","html_url":"https://github.com/raiffeisennet","followers_url":"https://api.github.com/users/raiffeisennet/followers","following_url":"https://api.github.com/users/raiffeisennet/following{/other_user}","gists_url":"https://api.github.com/users/raiffeisennet/gists{/gist_id}","starred_url":"https://api.github.com/users/raiffeisennet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raiffeisennet/subscriptions","organizations_url":"https://api.github.com/users/raiffeisennet/orgs","repos_url":"https://api.github.com/users/raiffeisennet/repos","events_url":"https://api.github.com/users/raiffeisennet/events{/privacy}","received_events_url":"https://api.github.com/users/raiffeisennet/received_events","type":"User","site_admin":false},"created_at":"2019-04-16T08:41:28Z","updated_at":"2019-04-16T08:41:28Z","author_association":"NONE","body":"Same issue here. The strangest thing is, that sending a notification through APNs itself remakes the FCM notifications working properly for the FCM token registered with the APNs token."}}
{"actor":{"display_login":"raiffeisennet"}}