How to use the urbanairship-react-native.UrbanAirship.getChannelId 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 blockmason / lndr-mobile / packages / ui / views / account / home / index.tsx View on Github external
async initializePushNotifications() {
    const { navigation } = this.props
    UrbanAirship.getChannelId().then(channelId => {
      if (channelId) {
        this.props.registerChannelID(channelId, Platform.OS)
      }
    })

    const { notificationsEnabled } = this.props.state

    UrbanAirship.setUserNotificationsEnabled(notificationsEnabled)
    UrbanAirship.addListener("pushReceived", async(notification) => {
      const actions = JSON.parse(notification.extras['com.urbanairship.actions'])
      const { type } = actions

      if(type === 'NewPendingCredit') {
        loadingPending.wrap(this.props.getPending())
      } else if(type === 'NewFriendRequest') {
        loadingFriends.wrap(this.props.getFriends())
github urbanairship / react-native-module / example / App.js View on Github external
componentDidMount() {
    UrbanAirship.getChannelId().then((channelId) => {
      this.setState({channelId:channelId})
    });
  }
github urbanairship / react-native-module / example / screens / HomeScreen.js View on Github external
componentDidMount() {
    UrbanAirship.getChannelId().then((channelId) => {
      this.setState({channelId:channelId})
    });
  }