Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTag() {
if (this.state.tag !== undefined) {
JPushModule.setTags([this.state.tag], () => {
// Alert.alert('成功', 'tags 成功',[{text: 'OK'}]);
console.log('success set tag');
}, () => {
// Alert.alert('失败','设置alias 失败',[{text:'fail'}]);
console.log('fail set tag');
});
};
},
setAlias() {
setTag() {
if (this.state.tag !== undefined) {
/*
* 请注意这个接口要传一个数组过去,这里只是个简单的示范
*/
JPushModule.setTags(this.state.tag.split(","), (map) => {
if (map.errorCode === 0) {
console.log("Tag operate succeed, tags: " + map.tags);
} else {
console.log("error code: " + map.errorCode);
}
});
}
}
setTag() {
if (this.state.tag !== undefined) {
/*
* 请注意这个接口要传一个数组过去,这里只是个简单的示范
*/
JPushModule.setTags(["VIP", "NOTVIP"], () => {
console.log("Set tag succeed");
}, () => {
console.log("Set tag failed");
});
}
}
setTags() {
JPushModule.setTags(['tag1', 'tag2'], (result)=> {
Alert.alert(JSON.stringify(result))
})
}