quickstart-ios
quickstart-ios copied to clipboard
Push Notifications only works when the provisioning profile is iOS development type, AdHoc and Production not working
Similar issue as https://github.com/firebase/quickstart-ios/issues/207
When the provisioning profile type is Development, everything works as expected
When the provisioning profile type is Ad hoc or Production, no push notification is delivered
Versions for FirebaseMessagingBinary and all other Firebase SDKs: 6.32.0
What I have already tried:
- Approach One, followed https://github.com/firebase/quickstart-ios/issues/207#issuecomment-274820033:
1 - Make sure to Enable FirebaseAppDelegateProxyEnabled to YES in the info.plist 2- Revoke your certificate (APNS develop and distribution) and create a news ones 3 - NOTE: there is an error in the Firebase documentation. When you exporting the APN certificate for production from your > keychain to the .p12 file you have to select the actual certificate, not the private key. 4 - Make sure you upload to the Firebase console this .p12 file in the Cloud Messaging APN certificate settings. 5- Send remote notification with Firebase Console.
- Approach Two: followed https://stackoverflow.com/a/41696213
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
#if DEVELOPMENT
//Develop
Messaging.messaging().setAPNSToken(deviceToken as Data, type: .sandbox)
#else
//Production
Messaging.messaging().setAPNSToken(deviceToken as Data, type: .prod)
#endif
}
- Approach Three:
When you exporting the APN certificate for production from your keychain to the .p12 file you have to select the actual certificate, not the private key
Any ideas about how to solve this issue, please
Please help
What version of Firebase are you using? You should be able to set the APNs token without setting the type without issues.
@morganchen12 the firebase iOS SDK version is 6.32.0
Unfortunately I won't be able to help much without a reproducible example, but you can try using Messaging.messaging().apnsToken = deviceToken instead of explicitly specifying the token type.
@morganchen12 I have already tried this, but no luck
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { Messaging.messaging().setAPNSToken(deviceToken as Data, type: .unknown) }
any updates on this? I experience the exact same issue with firebase_messaging 9.1.3