public void JPushSetAlias(string aliasName) { try { JPushInterface.SetAlias(Application.Context, aliasName, new TagAliasCallback()); } catch (Exception) { } }
/// <summary> /// init JPush /// </summary> private void InitJPush() { JPushInterface.SetDebugMode(true); JPushInterface.Init(Application.Context); JPushInterface.SetAlias(Application.Context, 0, "cloudwto_alias_test"); BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(this); builder.StatusBarDrawable = Resource.Drawable.jpush_notification_icon; JPushInterface.SetPushNotificationBuilder(new Java.Lang.Integer(1), builder); }
public void setAliasWithName(string name) { if (!string.IsNullOrWhiteSpace(name)) { name = name.Replace("-", ""); JPushInterface.SetAlias(Application.Context, 0, name); } else { JPushInterface.SetAlias(Application.Context, 0, ""); } }
/// <summary> /// hanlder回调函数 /// </summary> /// <param name="msg">Message.</param> private void DealMessage(Message msg) { switch (msg.What) { case MSG_SET_ALIAS: Log.Debug(Tag, "设置aliasname"); JPushInterface.SetAlias(context, (string)msg.Obj, this); break; case MSG_SET_TAGS: Log.Debug(Tag, "设置tag标签"); JPushInterface.SetTags(context, (ICollection <string>)msg.Obj, this); break; } }
public void setAliasWithName(string name) { JPushInterface.SetAlias(Application.Context, 0, name); }
public void UserId(string data) { name = name.Replace("-", ""); JPushInterface.SetAlias(Application.Context, 0, name); }
/// <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 SetAlias(JiGuangSequence sequence, string alias) { JPushInterface.SetAlias(Android.App.Application.Context, (int)sequence, alias); }