How to use the jpush-react-native.getRegistrationID function in jpush-react-native

To help you get started, we’ve selected a few jpush-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 syun0216 / goforeat / app / CustomLoginView.js View on Github external
nickName,
          profileImg
        }
        userStorage.setData(_user)
        this.props.userLogin(_user)
        let _timer = setTimeout(() => {
          let { toPage } = this.props
          if (toPage.routeName && toPage.routeName == 'UserInfo') {
            NavigationService.navigate('DrawerClose')
          } else {
            NavigationService.navigateWithWholeRouteParmas(toPage)
          }
          // console.log(1111111111111,this.props.toPage);
          clearTimeout(_timer)
        }, 300)
        JPushModule.getRegistrationID(
          registrationId => {
            saveDevices(registrationId, data.sid)
              .then(sdata => {
                this.props.toggleLogin(false)
              })
              .catch(err => {
                this.props.toggleLogin(false)
              })
          },
          () => {
            ToastUtil.showWithMessage(i18n.login_tips.fail.login)
          }
        )
        this.setState({ loading: false })
      })
      .catch(err => {
github jpush / jpush-react-native / react-native-iOS / push_activity.js View on Github external
onInitPress() {

      console.log('on click init push ');
      // PushHelper.setupPush('dssdf');
      JPushModule.getRegistrationID((registrationid) => {
        console.log(registrationid);
        this.setState({regid: registrationid});
      });
    },
    onSetuplocalNotificationPress() {
github jpush / jpush-react-native / example / react-native-iOS / push_activity.js View on Github external
onInitPress() {

      console.log('on click init push ');
      JPushModule.getRegistrationID((registrationid) => {
        console.log(registrationid);
        this.setState({regid: registrationid});
      });
    }
    onSetuplocalNotificationPress() {
github jpush / jpush-react-native / example / App.js View on Github external
                        onPress={() => JPush.getRegistrationID(result =>
                            console.log("registerID:" + JSON.stringify(result))
                        )}/>
github jpush / jpush-react-native / example / react-native-android / push_activity.js View on Github external
onGetRegistrationIdPress() {
		JPushModule.getRegistrationID((registrationId) => {
			this.setState({
				registrationId: registrationId
			});
		});
	}
github syun0216 / goforeat / goforeat_app / app / LoginView.js View on Github external
this.props.navigation.goBack()
        }else {
          if(params.page == 'Order') {
            this.props.navigation.navigate('Order',
              {
                  replaceRoute: true,
                  foodId: params.foodId,
                  placeId: params.placeId,
                  amount: params.amount,
                  total: params.total
              })
          }else {
            this.props.navigation.navigate(params.page,{replaceRoute: true,});
          }
        }
        JPushModule.getRegistrationID(registrationId => {
          api.saveDevices(registrationId,this.token);
        },() => {
          ToastUtil.showWithMessage("登錄失敗")
        })
      }
      else{
        ToastUtil.showWithMessage(data.data.ro.respMsg);
      }
    },() => {
      ToastUtil.showWithMessage("登錄失敗")
github jpush / jpush-react-native / react-native-android / push_activity.js View on Github external
onGetRegistrationIdPress() {
    JPushModule.getRegistrationID((registrationId) => {
      this.setState({registrationId: registrationId});
    });
  }