react-native-macos/Examples/UIExplorer/js
Ian MacLeod 4f89fa9cf3 registration error event
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 https://github.com/facebook/react-native/pull/9650

Differential Revision: D3822142

Pulled By: javache

fbshipit-source-id: a15ed8941b74dc3eed2c44c658deccbcaf39ce3d
2016-09-06 11:13:40 -07:00
..
AnimatedGratuitousApp Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
NavigationExperimental Allow the disabling of navigation gestures. 2016-08-21 13:13:46 -07:00
Navigator Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
Thumbnails Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
AccessibilityAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
AccessibilityIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ActionSheetIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ActivityIndicatorExample.js ActivityIndicator Example ES6 classes migration and TimerMixin removal 2016-08-02 17:13:30 -07:00
AdSupportIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
AlertExample.js Android: Implement cancelable option for Alerts 2016-08-09 06:13:48 -07:00
AlertIOSExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
AnimatedExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
AppStateExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
AssetScaledImageExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
AsyncStorageExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
BorderExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
BoxShadowExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
CameraRollExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
CameraRollView.js Throw flow error when trying to access a style that is not defined on a stylesheet 2016-07-18 23:28:25 -07:00
ClipboardExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
DatePickerAndroidExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
DatePickerIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ExampleTypes.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
GeolocationExample.js On Android `geolocationError` return PositionError object. 2016-09-05 12:58:43 -07:00
ImageCapInsetsExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ImageEditingExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ImageExample.js Support bundle argument for image loading 2016-08-31 17:43:49 -07:00
KeyboardAvoidingViewExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
LayoutAnimationExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
LayoutEventsExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
LayoutExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
LinkingExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ListViewExample.js Fix minor typo in ListViewExample.js 2016-07-18 10:30:53 -07:00
ListViewGridLayoutExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ListViewPagingExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
MapViewExample.js Use image references consistently in UIExplorer 2016-08-17 04:43:52 -07:00
ModalExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
NativeAnimationsExample.js native decay animation 2016-08-19 07:13:45 -07:00
NavigatorIOSColorsExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
NavigatorIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
NetInfoExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
OrientationChangeExample.js Listen to device orientation changes 2016-09-06 03:59:01 -07:00
PanResponderExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
PermissionsExampleAndroid.android.js Add JS library for requesting Android M Permissions 2016-08-15 05:58:33 -07:00
PickerExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
PickerIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
PointerEventsExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ProgressBarAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ProgressViewIOSExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
PushNotificationIOSExample.js registration error event 2016-09-06 11:13:40 -07:00
RCTRootViewIOSExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
RTLExample.js Create a RTLExample for OSS 2016-08-18 20:58:39 -07:00
RefreshControlExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
RootViewSizeFlexibilityExampleApp.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ScrollViewExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ScrollViewSimpleExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
SegmentedControlIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
SetPropertiesExampleApp.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ShareExample.js Add Share module 2016-07-25 03:43:29 -07:00
SliderExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
SnapshotExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
StatusBarExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
SwipeableListViewExample.js fbsource deploy 2016-08-23 10:28:53 -07:00
SwitchExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TabBarIOSExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TextExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TextExample.ios.js Initial implementation of adjustsFontSizeToFit. 2016-08-10 11:28:37 -07:00
TextInputExample.android.js Add TextInput controlled selection prop on Android 2016-09-05 07:13:46 -07:00
TextInputExample.ios.js Add TextInput controlled selection prop on iOS 2016-08-25 17:28:37 -07:00
TimePickerAndroidExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TimerExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ToastAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
ToolbarAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TouchableExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TransformExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
TransparentHitTestExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
UIExplorerActions.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
UIExplorerApp.android.js UIExplorer fixes 2016-09-06 06:43:37 -07:00
UIExplorerApp.ios.js Render UIExplorer examples functionally to handle landscape orientation correctly 2016-09-02 14:43:44 -07:00
UIExplorerBlock.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
UIExplorerButton.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
UIExplorerExampleContainer.js Render UIExplorer examples functionally to handle landscape orientation correctly 2016-09-02 14:43:44 -07:00
UIExplorerExampleList.js Render UIExplorer examples functionally to handle landscape orientation correctly 2016-09-02 14:43:44 -07:00
UIExplorerList.android.js Listen to device orientation changes 2016-09-06 03:59:01 -07:00
UIExplorerList.ios.js Listen to device orientation changes 2016-09-06 03:59:01 -07:00
UIExplorerNavigationReducer.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
UIExplorerPage.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
UIExplorerStateTitleMap.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
UIExplorerTitle.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
URIActionMap.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
VibrationExample.js Ios: complete iOS vibration pattern supports (js) 2016-08-25 18:28:38 -07:00
VibrationIOSExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
ViewExample.js Reinstate view example for screenshot tests 2016-08-16 04:58:30 -07:00
ViewPagerAndroidExample.android.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
WebSocketExample.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
WebViewExample.js Convert from React.createClass to ES6 classes 2016-07-26 01:13:31 -07:00
XHRExample.android.js Add responseType as a concept to RCTNetworking, send binary data as base64 2016-07-13 04:58:37 -07:00
XHRExample.ios.js Support RCTNetworking#clearCookies on iOS 2016-08-26 05:43:39 -07:00
XHRExampleCookies.js Add responseType as a concept to RCTNetworking, send binary data as base64 2016-07-13 04:58:37 -07:00
XHRExampleFetch.js Update XHRExampleFetch and dump the response headers 2016-09-06 04:28:38 -07:00
XHRExampleHeaders.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
XHRExampleOnTimeOut.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
bunny.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
createExamplePage.js Render UIExplorer examples functionally to handle landscape orientation correctly 2016-09-02 14:43:44 -07:00
flux@3x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
hawk.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
helloworld.html Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
relay@3x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-left.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-left@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-right.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider-right@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
slider@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_comment_highlighted@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_comment_normal@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_thumb_big.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_thumb_normal@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
uie_thumb_selected@2x.png Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00
websocket_test_server.js Cleanup UIExplorer folder 2016-07-12 05:59:13 -07:00