How to use the jpush-react-native.setBadge 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 / hoc / CommonHOC.js View on Github external
_jpushCommonEvent() {
      if (Platform.OS == "ios") {
        JPushModule.setBadge(0, success => {});
      }
      JPushModule.addReceiveOpenNotificationListener(map => {
        // console.log("map-------------jpush", map);
        if (typeof map.extras["type"] != "undefined") {
          switch (map.extras.type) {
            case jpushCommonUrlDefined.url:
              {
                this.props.navigation.navigate("Content", {
                  data: map.extras,
                  kind: "jpush"
                });
              }
              break;
            case jpushCommonUrlDefined.schema:
              {
                const {schema, type, ...rest} = map.extras;
github jiasongs / cnodeRN / index.ios.js View on Github external
JPushModule.addnetworkDidLoginListener(() => {
  console.log('连接已登录')
  JPushModule.setBadge(0, (success) => { console.log('setBadge:' + success) });
  // JPushModule.addTags(['dasffas'], (result) => {
  //   Alert.alert('addTags success:' + JSON.stringify(result))
  // })
})
JPushModule.addOpenNotificationLaunchAppListener((result) => {
github syun0216 / goforeat / goforeat_app / app / components / HomePageHOC.js View on Github external
_jpushCommonEvent() {
    if(Platform.OS == 'ios') {
      JPushModule.setBadge(0, success => {})
    }
    JPushModule.addReceiveOpenNotificationListener(map => {
      if(typeof map.extras['type'] != "undefined") {
        map.extras.type == 1 && this.props.navigation.navigate("Content", {data: map.extras,kind: 'jpush'})
      } 
    })
  }