private void delTags() { List localList = MiPushClient.b(FoodApplication.a()); String str1 = SystemUtils.a(FoodApplication.a()); Iterator localIterator = localList.iterator(); while (localIterator.hasNext()) { String str2 = (String) localIterator.next(); if ((!TextUtils.isEmpty(str2)) && (!"ALL".equals(str2)) && (!str1.equals(str2))) { MiPushClient.c(FoodApplication.a(), str2, null); } } }
@Override public void login(String app_user_id) { CdSharedPreferencesUtils.put(mContext, CdSharedPreferencesUtils.KEY_APP_USER_ID, app_user_id); String token = CdSharedPreferencesUtils.getTokenSingle(mContext, "" + PushManager.PHONE_TYPE_MIUI); // 登入时, 还未获取到token值, if (TextUtils.isEmpty(token)) { // 请求一次token, 请求成功,会再次触发上传token MiPushClient.registerPush(mContext, APP_ID, APP_KEY); } }
@Override public void init() { // 小米4 token if (CdTools.isMainProcess(mContext)) { String appUserId = (String) CdSharedPreferencesUtils.get(mContext, CdSharedPreferencesUtils.KEY_APP_USER_ID, ""); String uploadToken = CdSharedPreferencesUtils.getTokenSingle(mContext, "" + PushManager.PHONE_TYPE_MIUI); if (TextUtils.isEmpty(uploadToken)) { // 没有上传过, 才注册上传token MiPushClient.registerPush(mContext, APP_ID, APP_KEY); } CdLogUtils.v("miuiPush", " init(). token " + uploadToken); Logger.setLogger(mContext, newLogger); } }
private void setDefaultTags() { MiPushClient.b(FoodApplication.a(), "ALL", null); MiPushClient.b(FoodApplication.a(), SystemUtils.a(FoodApplication.a()), null); }
@Override public void loginOut() { MiPushClient.unregisterPush(mContext); loginOutClean(); // MiPushClient.setUserAccount(mContext, "" ,null); }