React-native-fcm: [iOS] Both FCM and Notifications on Firebase Panel Don't Work When the App is on TestFlight

Created on 6 Jan 2017  路  19Comments  路  Source: evollu/react-native-fcm

I uploaded correct p12 files for both development and production.

I can have notifications on both Release and Debug mode when I deploy app from my mac.

After I send app to testflight can not get any notification. Is there something I am missing?

"react": "~15.3.2", "react-native": "0.37.0", "react-native-fcm": "^2.5.4",

Most helpful comment

I finally got it working.

The problem was related to certificates as @ethan37 said.

I recreated certificate just before trying with OneSignal. I uploaded same p12 I used for OneSignal then it worked.

I am not sure what I was doing wrong before. Only differences I made this time were exporting certificate (not private key) from Keychain Access and creating push certificate from Certificates section (not Identifiers)

This issue can be closed since this was not related to repository at all. Sorry for the trouble.

All 19 comments

Are you sure the production certificate is correct?

Yes I followed every step on the Firebase docs.

Do you have FirebaseAppDelegateProxyEnabled set to NO in your info.plist?

FirebaseAppDelegateProxyEnabled doesn't exist in my info.plist.

I deploy app with Build Configuration of Release. It works fine. But when I upload app to test flight it doesn't work.

All the other parts of your app are working?

Yes, everything else works.

I subscribe to topic and programmatically send notification to that topic using FCM server api.

I did everything true and it works perfect until using TestFlight.

At first I tought I made a mistake uploading production certificates to firebase. But then I changed Build Configuration to Release. It still worked. Doesn't that prove that I set production certificate correct?

Only problem is I can not receive any notification when I test app with TestFlight.

I've been googling and I found out that the issue might be related to the kind of APNs token that is being used, it must be a production token and not a sandbox token... and this thing must be set manually. Can it be?

@cihancil check your provisioning file, is it for production?

I am not an expert on iOS. But as I understand setting FirebaseAppDelegateProxyEnabled key to NO disables swizzling feature of FB which handles APNS token types. Should I set it to NO and manually setAPNSToken?

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { #if PROD_BUILD FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: .prod) #else FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: .sandbox) #endif }

@ethan37 How can I check if my provisioning file is for prod? My background is not particularly iOS development.

@cihancil Unfortunately my background isn't iOS either so I can't really help you here, looks like we're gonna have to wait for somebody who knows exactly. Anyway what you've proposed looks interesting since the setAPNSToken function is where you set the token type

I could not get this working. I used OneSignal and it worked for TestFlight.

I tried setting FirebaseAppDelegateProxyEnabled to NO, tried new app with different Apple developer account. It still did not work.

@cihancil Can you try recreating your p12 files from scratch and reuploading them one last time please??

I'm sure the root of this issue is related to certificates, we need to find out where exactly

Also be sure to delete your certs from the Apple Developer Center when you recreate them.. (sorry for multiple comments but I'm on mobile and I can't edit)

@cihancil Oh sorry, if OneSignal is working then the problem aren't certificates I guess...

I finally got it working.

The problem was related to certificates as @ethan37 said.

I recreated certificate just before trying with OneSignal. I uploaded same p12 I used for OneSignal then it worked.

I am not sure what I was doing wrong before. Only differences I made this time were exporting certificate (not private key) from Keychain Access and creating push certificate from Certificates section (not Identifiers)

This issue can be closed since this was not related to repository at all. Sorry for the trouble.

@cihancil I'm glad you solved! Can you close the issue?

@cihancil I had the same issue and I solved it after reading your last comment. Just adding a comment here for future reference to other people because it was a very annoying issue. What worked for me was exporting the whole certificate (not private key) from Keychain Access. when uploading it to Firebase.

Was this page helpful?
0 / 5 - 0 ratings