本文整理汇总了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);
}