diff --git a/Examples/UIExplorer/PushNotificationIOSExample.js b/Examples/UIExplorer/PushNotificationIOSExample.js index 9dd4de4e1..8553f1f79 100644 --- a/Examples/UIExplorer/PushNotificationIOSExample.js +++ b/Examples/UIExplorer/PushNotificationIOSExample.js @@ -43,11 +43,17 @@ var Button = React.createClass({ class NotificationExample extends React.Component { componentWillMount() { + // Add listener for push notifications PushNotificationIOS.addEventListener('notification', this._onNotification); + // Add listener for local notifications + PushNotificationIOS.addEventListener('localNotification', this._onLocalNotification); } componentWillUnmount() { + // Remove listener for push notifications PushNotificationIOS.removeEventListener('notification', this._onNotification); + // Remove listener for local notifications + PushNotificationIOS.removeEventListener('localNotification', this._onLocalNotification); } render() { @@ -57,6 +63,11 @@ class NotificationExample extends React.Component { onPress={this._sendNotification} label="Send fake notification" /> + +