APNS handle obtained by Expo in React Native is incorrect - react-native

EXPO SDK Version: 42.0.01
Developing for: iOS
Our goal: successfully send a test notification from Test Send tool in Azure Notification Hub to a registered physical iPhone which is running a local instance of an EXPO app.
Progress: we're able to successfully register a physical iPhone with Azure Notification Hub without using a 3rd party library. We can see that registration in the Hub.
Issues: when using the Azure's Test Send tool we're getting an error "The Push Notification System handle for the registration is invalid" and the test notification does not get delivered.
Debugging:
we're using EXPO's Notifications.getDevicePushTokenAsync() API to obtain the push token.
Azure support team analysed the logs and concluded that the problem is the PNS handle i.e. Apple's ID of the phone registered for notifications.
the phone's PNS handle remains the same at all times.
by using "expo credentials:manager" I've added a new Push Notification Key using KeyID, TeamID and .p8 certificate - the PNS handle didn't change after doing that and notifications were failing too.
I haven't found any tools to validate the APNS handle. I'm currently awaiting a .p12 certificate from our corporate team to test notifications by using https://pushtry.com/.
How do we validate the APNS handle and if found that it's invalid - how do we cycle it / request another?

The PNS Handle from APNs does not change that often as it is tied to the device and app installation. See this answer for more details Does the APNS device token ever change, once created?

Related

How to get local-notification without Apns for ios in react-native?

I searched some notification library for react-native.
https://github.com/zo0r/react-native-push-notification
This works well for Android but it requires Apns for ios
I would like to find some libraries that doen not require Apns and simple.
There is no avoiding using APNS for remote push notifications.
In order to receive data in certain scenarios, such as having your app running in the background, phone being offline and later receiving a notification once it is back online, your device must have a unique app-specific device token generated by Apple. You can then use a service such as FCM or AWS SNS to deliver the notification to clients.
Also, for Android, you will need to use GCM to generate the device token.
You can, for testing purposes, you can use react-native-push-notifications' PushNotification.localNotificationSchedule to create a dummy local notification.
Here is a good tutorial for setting up remote push notifications with APNS and FCM: https://www.appcoda.com/firebase-push-notifications/.

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.

MobileFirst8.0 - push token refresh

Suppose I have an Android device Which is successfully registered for PushNotifications using MobileFrist SDK (version 8.0).
Say-After 6 months -GCM initiates token refresh!. Will SDK be able to auto sync the push token or do we need to handle this manually?
What is the case with IOS/APNS?
Could you explain the process of token refresh and synchronization ??
The registerDevice API (and the sendDeviceToken API incase of iOS) of MFP Push (available in both the Android and iOS SDKs) registers the device if one is not yet or updates the device if the device token is refreshed / changed. A call to this API from the Android / iOS client application when the app is started will obtain the token for the device from APNS/GCM servers and ensures the registration on the server to be refreshed with right token whenever it changes.
For more info:
http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/handling-push-notifications/android/
http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/handling-push-notifications/ios/

Gcm with appodeal

I am using gcm with appodeal in my app and when I am sending the push notification the for the first push was successful but phone is not receiving the notification and after that error is there while sending push that device is not register. What to do in this situation please help me.
Is it iOS or Android ? I had the exact same issue just yesterday with iOS and all I had to was to create a development provisioning profile and set it up properly in xCode. I hope that helps you.
I think for you to verify that your app can send and receive messages, client apps must register with GCM.
To register with GCM:
1.The client app obtains a registration token using the Instance ID API. The call to this API must have the authorized entity set to your app server's sender ID, and the scope set to the appropriate value for GCM (depending on your platform). Refer to the API reference for full detail on this API.
2.The client app passes the registration token to the app server.
3. The app server saves the registration token and acknowledges to the client app that the process completed successfully.
This thread may also provide further insight as to why you are receiving the device not registered error.

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.