/// <summary> /// 处理设置tag /// /// </summary> public virtual void handleAction(Context context, int sequence, TagAliasBean tagAliasBean) { init(context); if (tagAliasBean == null) { Logger.w(TAG, "tagAliasBean was null"); return; } put(sequence, tagAliasBean); if (tagAliasBean.isAliasAction) { switch (tagAliasBean.action) { case ACTION_GET: JPushInterface.GetAlias(context, sequence); break; case ACTION_DELETE: JPushInterface.DeleteAlias(context, sequence); break; case ACTION_SET: JPushInterface.SetAlias(context, sequence, tagAliasBean.alias); break; default: Logger.w(TAG, "unsupport alias action type"); return; } } else { switch (tagAliasBean.action) { case ACTION_ADD: JPushInterface.AddTags(context, sequence, tagAliasBean.tags); break; case ACTION_SET: JPushInterface.SetTags(context, sequence, tagAliasBean.tags); break; case ACTION_DELETE: JPushInterface.DeleteTags(context, sequence, tagAliasBean.tags); break; case ACTION_CHECK: //一次只能check一个tag string tag = (string)tagAliasBean.tags[0]; JPushInterface.CheckTagBindState(context, sequence, tag); break; case ACTION_GET: JPushInterface.GetAllTags(context, sequence); break; case ACTION_CLEAN: JPushInterface.CleanTags(context, sequence); break; default: Logger.w(TAG, "unsupport tag action type"); return; } } }
public void AddTags(JiGuangSequence sequence, List <string> tags) { JPushInterface.AddTags(Android.App.Application.Context, (int)sequence, tags); }