React native FCM push notifications not working in IOS Adhoc and TestFlight - firebase-cloud-messaging

Trying to implement push notification in a react native app using google cloud messaging. The notification works perfectly on android device in a simulator and in production. But for IOS, it works only locally only when its ran in a device. In adhoc or test flight, it does not work. I am using the APN key. Anyone faced the same issue? I can see a lot of posts in stack overflow regarding push notification not working for ios but none of the post were helpful for me.
Here's what I have done till now:
Generated an APN Authentication Key in developer.apple.com
Added that key to ios App in firebase.console.google.com
Run the app in a device using xcode - (Push notification works fine everytime.)
Archive the app in xcode and distribute to AdHoc and install the .ipa file in a device. (Push notification does not work)
Distribute to testflight and test the push notification - does not work
Why would it work in debug mode and not in adhoc or testflight.
I checked this:https://stackoverflow.com/a/48111671/8729976 . It says there is a single auth token for both production and development environment so I am guessing its definitely not the key.
Here are the sample responses:
When the push notification is delivered we get status 200 with this message: projects/myproject-name/messages/1602538922793273
When the push notification is not delivered, we still get status 200 with this message: projects/myproject-name/messages/0:1602541135340865%6b2d5f5c6b2d5f5c
Don't know what the second message means.

Related

Push notifications not working in Expo Go

I don't receive push notifications when testing the app in Expo Go with physical devices. However it seems to work fine in a standalone (builded) app.

Will an Android app only receive push notifications is the app was downloaded from the Google Play Store? (React Native Expo)

I'm using Expo push notifications. Push notifications work fine in Expo Go and for apps on published to the Google Play store. But when I create an APK file and download it directly onto my Android phone, NOT through the Google Play store, the push notifications I send are not received.
Will push notifications only work for apps published to the Google Play store? Or is there a way to receive push notifications for apps downloaded directly onto an Android phone without being published to the Google Play store?
Depending on your android version and rom you have to open the app setting's (for me long press app icon).
Select settings
Choose notifications
Enable notification for this app
I forgot to import { Platform } from 'react-native'.
Also, I needed to upload Android server api key credentials which can be found in Firebase Console in your project settings under Cloud Messaging. Here is how to upload the server api key credentials in the terminal:
expo push:android:upload --api-key <your-token-here>
Documentation can be found here under "Uploading Server Credentials": https://docs.expo.dev/push-notifications/using-fcm/

using expo push notification, iOS device cannot receive push

My iPhone cannot receive push notification from my expo app.
I checked Device Token must be made.
I already checked notification permission.
Other Expo Push Test apps also not work
My iPhone can receive push from Other apps
What should I do? is Expo's problem?

Firebase Cloud Messages never reach the device

I'm implementing FCM on Ionic 2 (AngularFire2 & Ionic Native FCM: cordova-plugin-fcm#2.1.2) currently testing iOS on an iOS 11 device.
FCM messages never arrive on the device. I get no errors from either the console sending messages or when sending messages via cURL.
I've gone through the troubleshooting steps from the Google dev advocate.
I've verified that a notification sent directly via Apple's APNS server gets delivered to the device when the app is in background, and the app when the app is in foreground. (I pulled the actual device token to test this.) i.e. APNS certificates are fine.
FCM initializes with no errors (watching the logs in Xcode) and FCM does retrieve a (seemingly) valid FCM token.
I've just ensured that all my npm modules are at the latest versions for firebase, angularFire2 and fcm.
I've verified that 'GoogleService-Info.plist' is in my resources folder
Bottom line: My APNS certificate is valid and seems to be correctly setup in the Firebase console. APNS direct messages work fine. FCM messages don't return an error, they just never get to the device. Seems to be getting lost in the FCM end.
Does anyone have any suggestions on how to further debug this?
thx.

Device Token null when deploying app as ad-hoc (Urban Airship)

I implemented the Urban Airship library into my application and I can successfully send push notifications to a specific device in development mode. After startup I get the device token and save it into a mysql database. However, when I use the app in ad-hoc mode, the device token is always (null).
APP_STORE_OR_AD_HOC_BUILD is set to YES
and the APP Key and APP-Secret for both production and development are correct.
Any ideas how to get the device token in ad-hoc/appstore mode?
Edit:
Identical question has been posted in the Urban Airship Forum.
For me also same thing happened. What we did to solve problem is just recreated new adHoc provisioning profile. Then we got alert asking to install push notification. Its one of the major issue in iOS push notification. We must configure push nofitiation SSL certificate before creating provisioning profile.