Push Notifications using Firebase with APN Auth Key

While testing my app on TestFlight, I noticed that I am not receiving push notifications.

I have confirmed that I can receive notifications triggered from both cloud functions and firebase console when loading assemblies from Xcode.

I have referenced other similar questions, but none of them reflect the exact problem I am dealing with. When setting up for remote notifications in Firebase, I am using APNs Auth Key , I have also included .p12

development and production files . However, the files .p12

are greyed out and listed as inactive because APNs Auth Key was installed.

On my Apple Developer account under Certificates, IDs and Profiles, I made sure my APNs Auth Key exists in the left Keys section . I also installed the SSL Developer and Manufacturing Certificates in my Application ID and confirmed that they are listed as "included". I have also confirmed that I have an iOS distribution distribution profile that is "active".

This is a tricky issue to debug because Xcode builds work, but TestFlight builds don't. I know this is a production and development environment related issue, but I'm not sure how to fix this issue.

This method is called on Xcode strings and all associated methods UserNotifications

and Messaging

delegate are called. I am running iOS 10.3 and FirebaseAppDelegateProxyEnabled

installed in NO

in mine info.plist

.

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
     Messaging.messaging().setAPNSToken(deviceToken, type: MessagingAPNSTokenType.sandbox)
     Messaging.messaging().setAPNSToken(deviceToken, type: MessagingAPNSTokenType.prod)
}

      

+3


source to share





All Articles