Hi, I have this:
import React from 'react';
import {
Notifications,
} from 'expo';
import {
Text,
View,
} from 'react-native';
// This refers to the function defined earlier in this guide
import registerForPushNotificationsAsync from './registerForPushNotificationsAsync';
export default class AppContainer extends React.Component {
state = {
notification: {},
};
componentDidMount() {
registerForPushNotificationsAsync();
this._notificationSubscription = Notifications.addListener(this._handleNotification);
}
_handleNotification = (notification) => {
this.setState({notification: notification});
};
render() {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text>Origin: {this.state.notification.origin}</Text>
<Text>Data: {JSON.stringify(this.state.notification.data)}</Text>
<Text>Props: {JSON.stringify(this.props.exp.notification)}</Text>
</View>
);
}
}
from Push Notifications I don’t know how to import it to my project, I import it in “index.js” but it seem that doesn’t work, how can I import it?