How to use the jpush-react-native.addGetRegistrationIdListener 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 jpush / jpush-react-native / example / react-native-android / push_activity.js View on Github external
});
			console.log("extras: " + map.extras);
		});
		JPushModule.addReceiveNotificationListener((map) => {
			console.log("alertContent: " + map.alertContent);
			console.log("extras: " + map.extras);
			// var extra = JSON.parse(map.extras);
			// console.log(extra.key + ": " + extra.value);
		});
		JPushModule.addReceiveOpenNotificationListener((map) => {
			console.log("Opening notification!");
			console.log("map.extra: " + map.extras);
			this.jumpSecondActivity();
			// JPushModule.jumpToPushActivity("SecondActivity");
		});
		JPushModule.addGetRegistrationIdListener((registrationId) => {
			console.log("Device register succeed, registrationId " + registrationId);
		});
		// var notification = {
		// 	buildId: 1,
		// 	id: 5,
		// 	title: 'jpush',
		// 	content: 'This is a test!!!!',
		// 	extra: {
		// 		key1: 'value1',
		// 		key2: 'value2'
		// 	},
		// 	fireTime: 2000,
		// }
		// JPushModule.sendLocalNotification(notification);
	}
github jiasongs / cnodeRN / index.android.js View on Github external
});
JPushModule.addReceiveCustomMsgListener((map) => {
  console.log("extras: " + map.extras);
});
JPushModule.addReceiveNotificationListener((map) => {
  console.log("alertContent: " + map.alertContent);
  console.log("extras: " + map.extras);
  // var extra = JSON.parse(map.extras);
  // console.log(extra.key + ": " + extra.value);
});
JPushModule.addReceiveOpenNotificationListener((map) => {
  console.log("Opening notification!");
  console.log("map.extra: " + map.extras);
  // JPushModule.jumpToPushActivity("SecondActivity");
});
JPushModule.addGetRegistrationIdListener((registrationId) => {
  console.log("Device register succeed, registrationId " + registrationId);
});

const store = configureStore();
export default class cnodeRN extends Component {
  render() {
    return (
      
        
      
    );
  }
}

AppRegistry.registerComponent("cnodeRN", () => cnodeRN);
github mrarronz / react-native-blog-examples / Chapter13-PushNotification / PushNotification / App.js View on Github external
JPushModule.notifyJSDidLoad(resultCode => {
        if (resultCode === 0) {
          console.log("设置监听成功");
        }
        JPushModule.addGetRegistrationIdListener((registrationId) => {
          console.log("设备注册成功,registrationId: " + registrationId);
        });
      });
    }