本文整理匯總了Java中cn.jpush.android.api.JPushInterface.resumePush方法的典型用法代碼示例。如果您正苦於以下問題:Java JPushInterface.resumePush方法的具體用法?Java JPushInterface.resumePush怎麽用?Java JPushInterface.resumePush使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cn.jpush.android.api.JPushInterface
的用法示例。
在下文中一共展示了JPushInterface.resumePush方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onClick
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.init:
init();
break;
case R.id.setting:
Intent intent = new Intent(MainActivity.this, PushSetActivity.class);
startActivity(intent);
break;
case R.id.stopPush:
JPushInterface.stopPush(getApplicationContext());
break;
case R.id.resumePush:
JPushInterface.resumePush(getApplicationContext());
break;
case R.id.getRegistrationId:
String rid = JPushInterface.getRegistrationID(getApplicationContext());
if (!rid.isEmpty()) {
mRegId.setText("RegId:" + rid);
} else {
Toast.makeText(this, "Get registration fail, JPush init failed!", Toast.LENGTH_SHORT).show();
}
break;
}
}
示例2: onClick
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.init) {
init();
} else if (i == R.id.setting) {
Intent intent = new Intent(MainActivity.this, PushSetActivity.class);
startActivity(intent);
} else if (i == R.id.stopPush) {
JPushInterface.stopPush(getApplicationContext());
} else if (i == R.id.resumePush) {
JPushInterface.resumePush(getApplicationContext());
} else if (i == R.id.getRegistrationId) {
String rid = JPushInterface.getRegistrationID(getApplicationContext());
if (!TextUtils.isEmpty(rid)) {
mRegId.setText("RegId:" + rid);
} else {
Toast.makeText(this, "Get registration fail, JPush init failed!", Toast.LENGTH_SHORT).show();
}
}
}
示例3: switchJPushMode
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
* 更改推送的狀態
*/
private void switchJPushMode() {
// 獲得之前的狀態
boolean isStoped = JPushInterface.isPushStopped(getApplicationContext());
// 取反並設置
setImageButtonState(mSettingJpush, isStoped);
// 更改推送狀態
if (isStoped) {
JPushInterface.resumePush(getApplicationContext());
} else {
JPushInterface.stopPush(getApplicationContext());
}
}
示例4: onClick
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.resumePush:
JPushInterface.resumePush(v.getContext());
break;
case R.id.stopPush:
JPushInterface.stopPush(v.getContext());
break;
case R.id.isStopPush:
boolean isStop = JPushInterface.isPushStopped(v.getContext());
Toast.makeText(this, isStop ? "停止了推送" : "開始了推送", Toast.LENGTH_SHORT).show();
break;
}
}
示例5: resume
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
* 開始推送
*/
public static void resume(Context context) {
if (context == null)
return;
if (RomUtil.rom() == Target.EMUI) {
PushManager.enableReceiveNormalMsg(context, true);
PushManager.enableReceiveNotifyMsg(context, true);
if (EMHuaweiPushReceiver.getPushInterface() != null) {
EMHuaweiPushReceiver.getPushInterface().onResume(context);
}
return;
}
if (RomUtil.rom() == Target.MIUI) {
MiPushClient.resumePush(context, null);
if (MiuiReceiver.getPushInterface() != null) {
MiuiReceiver.getPushInterface().onResume(context);
}
return;
}
if (RomUtil.rom() == Target.FLYME) {
com.meizu.cloud.pushsdk.PushManager.register(context, Const.getMiui_app_id(), Const.getFlyme_app_key());
if (FlymeReceiver.getPushInterface() != null) {
FlymeReceiver.getPushInterface().onResume(context);
}
return;
}
if (RomUtil.rom() == Target.JPUSH) {
if (JPushInterface.isPushStopped(context)) {
JPushInterface.resumePush(context);
if (JPushReceiver.getPushInterface() != null) {
JPushReceiver.getPushInterface().onResume(context);
}
}
return;
}
}
示例6: resume
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
* 開始推送
*/
public static void resume(Context context) {
if (context == null)
return;
if (RomUtil.rom() == PhoneTarget.EMUI) {
com.huawei.android.pushagent.api.PushManager.enableReceiveNormalMsg(context, true);
com.huawei.android.pushagent.api.PushManager.enableReceiveNotifyMsg(context, true);
if (HWReceiver.getPushListener() != null) {
HWReceiver.getPushListener().onResume(context);
}
return;
}
if (RomUtil.rom() == PhoneTarget.MIUI) {
MiPushClient.resumePush(context, null);
if (MiMessageReceiver.getPushListener() != null) {
MiMessageReceiver.getPushListener().onResume(context);
}
return;
}
if (RomUtil.rom() == PhoneTarget.JPUSH) {
if (JPushInterface.isPushStopped(context)) {
JPushInterface.resumePush(context);
if (JPushReceiver.getPushListener() != null) {
JPushReceiver.getPushListener().onResume(context);
}
}
}
}
示例7: resumePush
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
public static void resumePush(JSONArray data, CallbackContext callbackContext) {
JPushInterface.resumePush(cordovaCxt);
}
示例8: saveToSP
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
private void saveToSP(User user) {
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_WQTOKEN, user.getT_user_login().getQqwx_token() != null ? user.getT_user_login().getQqwx_token() : "");
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_TEL, user.getT_user_login().getTel() != null ? user.getT_user_login().getTel() : "");
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_PASSWORD, user.getT_user_login().getPassword() != null ? user.getT_user_login().getPassword() : "");
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_USERID, user.getT_user_login().getId());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_STATUS, user.getT_user_login().getStatus());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_QNTOKEN, user.getT_user_login().getQiniu());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_APK_URL, user.getApk_url());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_VERSION, user.getVersion());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_CONTENT, user.getContent());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_RESUMM, user.getT_user_login().getResume());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_HOBBY, user.getT_user_login().getHobby());
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_NICK, user.getT_user_info().getNickname() != null ? user.getT_user_info().getNickname() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_NAME, user.getT_user_info().getName() != null ? user.getT_user_info().getName() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_IMG, user.getT_user_info().getName_image() != null ? user.getT_user_info().getName_image() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_SCHOOL, user.getT_user_info().getSchool() != null ? user.getT_user_info().getSchool() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_CREDIT, user.getT_user_info().getCredit());
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_INTEGRAL, user.getT_user_info().getIntegral());
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.USER_SEX, user.getT_user_info().getUser_sex());
// 暫時關閉果聊功能
// final ChatManager chatManager = ChatManager.getInstance();
if (!TextUtils.isEmpty(String.valueOf(user.getT_user_login().getId()))) {
if (JPushInterface.isPushStopped(getActivity().getApplicationContext())) {
JPushInterface.resumePush(getActivity().getApplicationContext());
}
//登陸leancloud服務器 給極光設置別名
// chatManager.setupManagerWithUserId(this, String.valueOf(user.getT_user_login().getId()));
JPushInterface.setAlias(getActivity().getApplicationContext(), "jianguo" + user.getT_user_login().getId(), new TagAliasCallback() {
@Override
public void gotResult(int i, String s, Set<String> set) {
LogUtils.e("jpush", s + ",code=" + i);
}
});
}
// ChatManager.getInstance().openClient(new AVIMClientCallback() {
// @Override
// public void done(AVIMClient avimClient, AVIMException e) {
// if (null == e) {
// TalkMessageEvent talkMessageEvent=new TalkMessageEvent();
// talkMessageEvent.isLogin=true;
// EventBus.getDefault().post(talkMessageEvent);
// } else {
// showShortToast(e.toString());
// }
// }
// });
}
示例9: saveToSP
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
private void saveToSP(User user) {
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_WQTOKEN, user.getT_user_login().getQqwx_token() != null ? user.getT_user_login().getQqwx_token() : "");
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_TEL, user.getT_user_login().getTel() != null ? user.getT_user_login().getTel() : "");
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_PASSWORD, user.getT_user_login().getPassword() != null ? user.getT_user_login().getPassword() : "");
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_USERID, user.getT_user_login().getId());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_STATUS, user.getT_user_login().getStatus());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_QNTOKEN, user.getT_user_login().getQiniu());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_APK_URL, user.getApk_url());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_VERSION, user.getVersion());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_CONTENT, user.getContent());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.LOGIN_HOBBY, user.getT_user_login().getHobby());
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_NICK, user.getT_user_info().getNickname() != null ? user.getT_user_info().getNickname() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_NAME, user.getT_user_info().getName() != null ? user.getT_user_info().getName() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_IMG, user.getT_user_info().getName_image() != null ? user.getT_user_info().getName_image() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_SCHOOL, user.getT_user_info().getSchool() != null ? user.getT_user_info().getSchool() : "");
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_CREDIT, user.getT_user_info().getCredit());
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.SP_INTEGRAL, user.getT_user_info().getIntegral());
SPUtils.setParam(getActivity(), Constants.LOGIN_INFO, Constants.SP_RESUMM, user.getT_user_login().getResume());
SPUtils.setParam(getActivity(), Constants.USER_INFO, Constants.USER_SEX, user.getT_user_info().getUser_sex());
// 暫時關閉果聊功能
// final ChatManager chatManager = ChatManager.getInstance();
if (!TextUtils.isEmpty(String.valueOf(user.getT_user_login().getId()))) {
if (JPushInterface.isPushStopped(getActivity().getApplicationContext())) {
JPushInterface.resumePush(getActivity().getApplicationContext());
}
//登陸leancloud服務器 給極光設置別名
// chatManager.setupManagerWithUserId(getActivity(), String.valueOf(user.getT_user_login().getId()));
JPushInterface.setAlias(getActivity().getApplicationContext(), "jianguo" + user.getT_user_login().getId(), new TagAliasCallback() {
@Override
public void gotResult(int i, String s, Set<String> set) {
LogUtils.e("jpush", s + ",code=" + i);
}
});
}
// ChatManager.getInstance().openClient(new AVIMClientCallback() {
// @Override
// public void done(AVIMClient avimClient, AVIMException e) {
// if (null == e) {
// TalkMessageEvent talkMessageEvent=new TalkMessageEvent();
// talkMessageEvent.isLogin=true;
// EventBus.getDefault().post(talkMessageEvent);
// } else {
//// Toast.makeText(getActivity(),e.getMessage(),Toast.LENGTH_SHORT).show();
//// getActivity().showShortToast(e.toString());
// }
// }
// });
}
示例10: saveToSP
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
private void saveToSP(User user) {
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_WQTOKEN, user.getT_user_login().getQqwx_token() != null ? user.getT_user_login().getQqwx_token() : "");
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_TEL, user.getT_user_login().getTel() != null ? user.getT_user_login().getTel() : "");
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_PASSWORD, user.getT_user_login().getPassword() != null ? user.getT_user_login().getPassword() : "");
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_USERID, user.getT_user_login().getId());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_STATUS, user.getT_user_login().getStatus());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_QNTOKEN, user.getT_user_login().getQiniu());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.SP_RESUMM, user.getT_user_login().getResume());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.LOGIN_APK_URL, user.getApk_url());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.LOGIN_VERSION, user.getVersion());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.LOGIN_CONTENT, user.getContent());
SPUtils.setParam(context, Constants.LOGIN_INFO, Constants.LOGIN_HOBBY, user.getT_user_login().getHobby());
SPUtils.setParam(context, Constants.USER_INFO, Constants.SP_NICK, user.getT_user_info().getNickname() != null ? user.getT_user_info().getNickname() : "");
SPUtils.setParam(context, Constants.USER_INFO, Constants.SP_NAME, user.getT_user_info().getName() != null ? user.getT_user_info().getName() : "");
SPUtils.setParam(context, Constants.USER_INFO, Constants.SP_IMG, user.getT_user_info().getName_image() != null ? user.getT_user_info().getName_image() : "");
SPUtils.setParam(context, Constants.USER_INFO, Constants.SP_SCHOOL, user.getT_user_info().getSchool() != null ? user.getT_user_info().getSchool() : "");
SPUtils.setParam(context, Constants.USER_INFO, Constants.SP_CREDIT, user.getT_user_info().getCredit());
SPUtils.setParam(context, Constants.USER_INFO, Constants.SP_INTEGRAL, user.getT_user_info().getIntegral());
SPUtils.setParam(context, Constants.USER_INFO, Constants.USER_SEX, user.getT_user_info().getUser_sex());
LogUtils.e("jpush","userid"+user.getT_user_login().getId());
//暫時關閉果聊功能
// final ChatManager chatManager = ChatManager.getInstance();
if (!TextUtils.isEmpty(String.valueOf(user.getT_user_login().getId()))) {
//登陸leancloud服務器 給極光設置別名
// LCChatKit.getInstance().open(String.valueOf(user.getT_user_login().getId()), new AVIMClientCallback() {
// @Override
// public void done(AVIMClient avimClient, AVIMException e) {
// if (null == e) {
// finish();
// Intent intent = new Intent(SplashActivity.this, MainActivity.class);
// startActivity(intent);
// } else {
// Toast.makeText(SplashActivity.this, e.toString(), Toast.LENGTH_SHORT).show();
// }
// }
// });
// chatManager.setupManagerWithUserId(this, String.valueOf(user.getT_user_login().getId()));
LogUtils.e("jpush","調用jpush");
if (JPushInterface.isPushStopped(getApplicationContext())){
JPushInterface.resumePush(getApplicationContext());
}
// ","隔開的多個 轉換成 Set,設置tags
// String tag = "test";
// String[] sArray = tag.split(",");
// Set<String> tagSet = new LinkedHashSet<String>();
// tagSet.add(tag);
// for (String sTagItme : sArray) {
// tagSet.add(sTagItme);
// }
// JPushInterface.setAliasAndTags(getApplicationContext(),"jianguo"+user.getT_user_login().getId(),tagSet, new TagAliasCallback() {
// @Override
// public void gotResult(int i, String s, Set<String> set) {
// LogUtils.e("jpush",s+",code="+i);
// }
// });
JPushInterface.setAlias(getApplicationContext(),"jianguo"+user.getT_user_login().getId(), new TagAliasCallback() {
@Override
public void gotResult(int i, String s, Set<String> set) {
LogUtils.e("jpush",s+",code="+i);
}
});
}
}
示例11: msgResume
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
@Click( R.id.msg_resume )
void msgResume()
{
JPushInterface.resumePush( getApplicationContext() );
}
示例12: resume
import cn.jpush.android.api.JPushInterface; //導入方法依賴的package包/類
/**
*
*/
public void resume() {
JPushInterface.resumePush(mContext);
}