[Question] How is setupAPN() supposed to get the deviceToken?
See original GitHub issueI see that the library includes setupAPN(deviceToken)
. How is the deviceToken
supposed to find its way into the JS environment?
It’s not an issue because you can just add [Intercom setDeviceToken:deviceToken];
but wanted to know if there was an alternative way or if it’s there for API parity.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Registering Your App with APNs - Apple Developer
You register your app and receive your device token each time your app launches using Apple-provided APIs. The registration process is similar across...
Read more >Not getting device token of device for APNS? - Stack Overflow
Now my problem is when i install same app for other device, the following methods could not work. application:(UIApplication *)app ...
Read more >Apple Push Notification Device Tokens - NSHipster
In order for its to be used to send push notifications, it needs to be sent from the client to the server. The...
Read more >Correctly capture iOS 13 Device Token in Xamarin | by Kevin Le
To receive the Device Token, an app must register with APNs. ... the following line is returned by the toString() method in Xamarin...
Read more >Sending Notifications with APNs & FCM - Expo Documentation
Now that you have your native device token, we can start to implement our servers. ... and we're just going to cover the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ryankask I am using this flow too after the login, but before the login I have a UnidentifiedUser registered, and after login, seems that intercom is not setting the push token for the logged user.
This flows worked nicely for you?
I think @rogchap is right. If you use react-native-push-notification (based in PushNotificationIOS) to register for remote notifications, and later use the resulting token to call
setupAPN
, you will probably run into problems as the encoding from String to NSData doesn’t seem to match the encoding on PushNotificationIOS:As @rogchap suggested, if you call
[Intercom setDeviceToken:deviceToken]
directly fromdidRegisterForRemoteNotificationsWithDeviceToken
it seems to work because it avoids the encoding problem. However this solution is not ideal, as in our case we would prefer to set the token (callsetupAPN
after the user logs in), while keeping the registration for the token handed by PushNotificationIOS (before the login).