How to use the urbanairship-react-native.UrbanAirship.isUserNotificationsEnabled function in urbanairship-react-native

To help you get started, we’ve selected a few urbanairship-react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github urbanairship / react-native-module / example / App.js View on Github external
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);
    });
github urbanairship / react-native-module / example / screens / SettingsScreen.js View on Github external
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);
    });