| 00b26551 | 07-Mar-2018 |
James Ide <[email protected]> |
Use the new push/getExpoPushToken endpoint with new www client
This is a rewrite of how device tokens are registered and sent to our server. There are several changes: - It uses the new `push/getExp
Use the new push/getExpoPushToken endpoint with new www client
This is a rewrite of how device tokens are registered and sent to our server. There are several changes: - It uses the new `push/getExpoPushToken` endpoint that both saves the APNs device token and returns an Expo push token. - *Breaking change:* Notifications.getExpoPushToken will throw if the app doesn't have permission to show notifications, instead of returning an Expo push token (that would later fail when trying to send to it). - It saves the token in NSUserDefaults only when it has successfully been registered, allowing us to skip re-registering with our server if the token hasn't changed across app starts. - More detailed error info, should we need it - Looked over the thread-safety of EXRemoteNotificationManager -- all ivar access happens on the same queue now (which is the main queue, for now, until we leave the deprecated UIApplication API for UserNotifications instead).
Fixes #764
fbshipit-source-id: cb15b20
show more ...
|