-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PushNotificationsIOS] registration error event #9650
Conversation
By analyzing the blame information on this pull request, we identified @nicklockwood and @JAStanton to be potential reviewers. |
@nevir updated the pull request - view changes |
@nevir updated the pull request - view changes |
@nevir updated the pull request - view changes |
@nevir updated the pull request - view changes |
# pragma mark - Push Notifications | ||
|
||
// Required to register for notifications | ||
- (void)application:(UIApplication *)__unused application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format like application:(__unused UIApplication *)application didRegister...
Looks good, just a couple of small nits |
@javache updated (and rebased); thanks for the review! |
@nevir updated the pull request - view changes |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review internal test results. |
Summary: This is an updated version of #2336 and #7694. --- This adds a `registrationError` event that is emitted by `PushNotificationIOS` whenever an application receives a registration error from APNS (APNS service failure, running on simulator, etc). This event fires to the exclusion of the `register` event (and vice versa). **How to use** Add the following to your `AppDelegate.m`: ```obj-c - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { [RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error]; } ``` And register an event handler for the event: ```js PushNotificationIOS.addEventListener('registrationError', function({ message, code }) { // Complete your registration process in error. }); ``` **Test plan** Added support for this event (and `register`) to UIExplorer as a proof of concept. Navigating to the push notifications example on a simulator is an easy way to reproduce this e Closes facebook/react-native#9650 Differential Revision: D3822142 Pulled By: javache fbshipit-source-id: a15ed8941b74dc3eed2c44c658deccbcaf39ce3d
Summary: This is an updated version of facebook#2336 and facebook#7694. --- This adds a `registrationError` event that is emitted by `PushNotificationIOS` whenever an application receives a registration error from APNS (APNS service failure, running on simulator, etc). This event fires to the exclusion of the `register` event (and vice versa). **How to use** Add the following to your `AppDelegate.m`: ```obj-c - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { [RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error]; } ``` And register an event handler for the event: ```js PushNotificationIOS.addEventListener('registrationError', function({ message, code }) { // Complete your registration process in error. }); ``` **Test plan** Added support for this event (and `register`) to UIExplorer as a proof of concept. Navigating to the push notifications example on a simulator is an easy way to reproduce this e Closes facebook#9650 Differential Revision: D3822142 Pulled By: javache fbshipit-source-id: a15ed8941b74dc3eed2c44c658deccbcaf39ce3d
This is an updated version of #2336 and #7694.
This adds a
registrationError
event that is emitted byPushNotificationIOS
whenever an application receives a registration error from APNS (APNS service failure, running on simulator, etc). This event fires to the exclusion of theregister
event (and vice versa).How to use
Add the following to your
AppDelegate.m
:And register an event handler for the event:
Test plan
Added support for this event (and
register
) to UIExplorer as a proof of concept. Navigating to the push notifications example on a simulator is an easy way to reproduce this event.