/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow */ 'use strict'; var React = require('react'); var ReactNative = require('react-native'); var { AlertIOS, PushNotificationIOS, StyleSheet, Text, TouchableHighlight, View, } = ReactNative; class Button extends React.Component<$FlowFixMeProps> { render() { return ( {this.props.label} ); } } class NotificationExample extends React.Component<{}> { UNSAFE_componentWillMount() { PushNotificationIOS.addEventListener('register', this._onRegistered); PushNotificationIOS.addEventListener( 'registrationError', this._onRegistrationError, ); PushNotificationIOS.addEventListener( 'notification', this._onRemoteNotification, ); PushNotificationIOS.addEventListener( 'localNotification', this._onLocalNotification, ); PushNotificationIOS.requestPermissions(); } componentWillUnmount() { PushNotificationIOS.removeEventListener('register', this._onRegistered); PushNotificationIOS.removeEventListener( 'registrationError', this._onRegistrationError, ); PushNotificationIOS.removeEventListener( 'notification', this._onRemoteNotification, ); PushNotificationIOS.removeEventListener( 'localNotification', this._onLocalNotification, ); } render() { return (