返回值都正常,就是推送的时候,还是全体推送, 没有达到用tag进行筛选
var PushManager = plus.android.importClass("com.igexin.sdk.PushManager");
var PushConsts = plus.android.importClass("com.igexin.sdk.PushConsts");
var context = plus.android.runtimeMainActivity();
//added by
PushManager.getInstance().initialize(context);
//end add
var Tag = plus.android.importClass("com.igexin.sdk.Tag");
var tag = new Tag();
tag.setName(tagName);
// var ts = new Array(1);
// ts[0] = tag;
//
// var now = new Date();
// var sn = now.format("yyyyMMddhhmmss");
// var i = PushManager.getInstance().setTag(context, ts, sn);
var tagParam = plus.android.newObject("com.igexin.sdk.Tag[1]");
tagParam[0] = tag;
var i = PushManager.getInstance().setTag(context, tagParam);
2 个回复
j***@hotmail.com - 挨踢男
var tagParam = new Array();
tagParam[0] = tag;
getui_johny - 个推技术支持
setTag:
context = plus.android.runtimeMainActivity().getContext();
var Tag = plus.android.importClass("com.igexin.sdk.Tag");
var tagParam = new Array();for (let i = 0; i < tags.length; i++) {
var tag = new Tag();
tag.setName(tags[i]);
tagParam[i] = tag;
console.log('tags[' + i + ']==', tags[i]);
}
console.log('tagParam==', JSON.stringify(tagParam));
Instance.setTag(context, tagParam, Date.now() + "");
如问题未能得到解决,可以从HB群或个推官网(https://www.getui.com/cn/)里面联系技术咨询