How to use urbanairship-react-native - 10 common examples

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);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);
    });

    UrbanAirship.addListener("registration", (event) => {
      console.log('registration:', JSON.stringify(event));
      this.state.channelId = event.channelId;
      this.setState(this.state);
    });

    UrbanAirship.addListener("notificationOptInStatus", (event) => {
github urbanairship / react-native-module / example / App.js View on Github external
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);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);
    });

    UrbanAirship.addListener("registration", (event) => {
      console.log('registration:', JSON.stringify(event));
      this.state.channelId = event.channelId;
      this.setState(this.state);
    });

    UrbanAirship.addListener("notificationOptInStatus", (event) => {
      console.log('notificationOptInStatus:', JSON.stringify(event));
    });
  }
github urbanairship / react-native-module / example / App.js View on Github external
console.log('pushReceived:', JSON.stringify(notification));
      alert("pushReceived: " + notification.alert);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);
    });

    UrbanAirship.addListener("registration", (event) => {
      console.log('registration:', JSON.stringify(event));
      this.state.channelId = event.channelId;
      this.setState(this.state);
    });

    UrbanAirship.addListener("notificationOptInStatus", (event) => {
      console.log('notificationOptInStatus:', JSON.stringify(event));
    });
  }
github urbanairship / react-native-module / example / screens / SettingsScreen.js View on Github external
console.log('pushReceived:', JSON.stringify(notification));
      alert("pushReceived: " + notification.alert);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);
    });

    UrbanAirship.addListener("registration", (event) => {
      console.log('registration:', JSON.stringify(event));
      this.state.channelId = event.channelId;
      this.setState(this.state);
    });

    UrbanAirship.addListener("notificationOptInStatus", (event) => {
      console.log('notificationOptInStatus:', JSON.stringify(event));
    });
  }
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);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);
    });

    UrbanAirship.addListener("registration", (event) => {
      console.log('registration:', JSON.stringify(event));
github blockmason / lndr-mobile / packages / lndr / engine / index.ts View on Github external
initalizePushNotifications() {
    UrbanAirship.setUserNotificationsEnabled(true)
    UrbanAirship.addListener("register", (event) => {
      console.log('Channel registration updated: ', event.channelId);
      console.log('Registration token: ', event.registrationToken);
    });
    UrbanAirship.addListener("pushReceived", (notification) => {
        console.log('Received push: ', JSON.stringify(notification));
    });
    UrbanAirship.setForegroundPresentationOptions({
      alert: true,
      sound: true,
      badge: true
    });
  }
github blockmason / lndr-mobile / packages / lndr / engine / index.ts View on Github external
initalizePushNotifications() {
    UrbanAirship.setUserNotificationsEnabled(true)
    UrbanAirship.addListener("register", (event) => {
      console.log('Channel registration updated: ', event.channelId);
      console.log('Registration token: ', event.registrationToken);
    });
    UrbanAirship.addListener("pushReceived", (notification) => {
        console.log('Received push: ', JSON.stringify(notification));
    });
    UrbanAirship.setForegroundPresentationOptions({
      alert: true,
      sound: true,
      badge: true
    });
  }
github blockmason / lndr-mobile / packages / lndr / engine / index.ts View on Github external
initalizePushNotifications() {
    UrbanAirship.setUserNotificationsEnabled(true)
    UrbanAirship.addListener("register", (event) => {
      console.log('Channel registration updated: ', event.channelId);
      console.log('Registration token: ', event.registrationToken);
    });
    UrbanAirship.addListener("pushReceived", (notification) => {
        console.log('Received push: ', JSON.stringify(notification));
    });
    UrbanAirship.setForegroundPresentationOptions({
      alert: true,
      sound: true,
      badge: true
    });
  }
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);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);
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);
    });

    UrbanAirship.addListener("deepLink", (event) => {
      console.log('deepLink:', JSON.stringify(event));
      alert("deepLink: " + event.deepLink);