Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
UrbanAirship.isUserNotificationsEnabled().then ((enabled) => {
this.setState({notificationsEnabled:enabled})
})
UrbanAirship.isLocationEnabled().then ((enabled) => {
this.setState({locationEnabled:enabled})
})
UrbanAirship.addListener("notificationResponse", (response) => {
console.log('notificationResponse:', JSON.stringify(response));
alert("notificationResponse: " + response.notification.alert);
});
UrbanAirship.addListener("pushReceived", (notification) => {
console.log('pushReceived:', JSON.stringify(notification));
alert("pushReceived: " + notification.alert);
});
componentDidMount() {
UrbanAirship.isUserNotificationsEnabled().then ((enabled) => {
this.setState({notificationsEnabled:enabled})
})
UrbanAirship.isLocationEnabled().then ((enabled) => {
this.setState({locationEnabled:enabled})
})
UrbanAirship.addListener("notificationResponse", (response) => {
console.log('notificationResponse:', JSON.stringify(response));
alert("notificationResponse: " + response.notification.alert);
});
UrbanAirship.addListener("pushReceived", (notification) => {
console.log('pushReceived:', JSON.stringify(notification));
alert("pushReceived: " + notification.alert);
});