Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_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;
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) => {
_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'})
}
})
}