本文整理汇总了Java中com.igexin.sdk.PushManager类的典型用法代码示例。如果您正苦于以下问题:Java PushManager类的具体用法?Java PushManager怎么用?Java PushManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PushManager类属于com.igexin.sdk包,在下文中一共展示了PushManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindAlias
import com.igexin.sdk.PushManager; //导入依赖的package包/类
private void bindAlias() {
final EditText editText = new EditText(GetuiSdkDemoActivity.this);
new AlertDialog.Builder(GetuiSdkDemoActivity.this).setTitle(R.string.bind_alias).setView(editText)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (editText.getEditableText() != null) {
String alias = editText.getEditableText().toString();
if (alias.length() > 0) {
PushManager.getInstance().bindAlias(GetuiSdkDemoActivity.this, alias);
Log.d(TAG, "bind alias = " + editText.getEditableText().toString());
}
}
}
}).setNegativeButton(android.R.string.cancel, null).show();
}
示例2: initParam
import com.igexin.sdk.PushManager; //导入依赖的package包/类
/**
* 初始化参数,及相应的布局设置
*/
private void initParam() {
instance = this;
menuLeftFragment = (MenuLeftFragment) getFragmentManager().
findFragmentById(R.id.main_left_menu_fragment);
mainMapFragment = new MainMapFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.add(R.id.main_fragment_frame_layout, mainMapFragment).commit();
EMChatUtil.autoReConnectEMChat();
if (LoginStatus.getIsUserMode()) {
loginEMChat(LoginStatus.getUser().getUserid(), LoginStatus.getUser().getPassword());
}
/**
* 初始化个推SDK
*/
PushManager.getInstance().initialize(this.getApplication());
}
示例3: initParam
import com.igexin.sdk.PushManager; //导入依赖的package包/类
/**
* 初始化参数,及相应的布局设置
*/
private void initParam() {
instance = this;
mainMapFragment = new MainMapFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.add(R.id.content_main_fragment_layout, mainMapFragment).commit();
EMChatUtil.autoReConnectEMChat();
if (LoginStatus.getIsUserMode()) {
loginEMChat(LoginStatus.getUser().getUserid(), LoginStatus.getUser().getPassword());
}
/**
* 初始化个推SDK
*/
PushManager.getInstance().initialize(this.getApplication());
}
示例4: onCreate
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// 调用Factory进行初始化
Factory.setup();
// 推送进行初始化
PushManager.getInstance().initialize(this);
}
示例5: setTags
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@Override
public void setTags(Context context, String... tags) {
Tag[] temps = new Tag[tags.length];
for (int i = 0; i < tags.length; i++) {
Tag tag = new Tag();
tag.setName(tags[i]);
temps[i] = tag;
}
PushManager.getInstance().setTag(context, temps, null);
}
示例6: onRequestPermissionsResult
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_PERMISSION) {
if ((grantResults.length == 2 && grantResults[0] == PackageManager.PERMISSION_GRANTED
&& grantResults[1] == PackageManager.PERMISSION_GRANTED)) {
PushManager.getInstance().initialize(this.getApplicationContext(), userPushService);
} else {
Log.e(TAG, "We highly recommend that you need to grant the special permissions before initializing the SDK, otherwise some "
+ "functions will not work");
PushManager.getInstance().initialize(this.getApplicationContext(), userPushService);
}
} else {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
示例7: onClick
import com.igexin.sdk.PushManager; //导入依赖的package包/类
public void onClick(View v) {
if (v == clearBtn) {
tLogView.setText("");
// DemoApplication.payloadData.delete(0, DemoApplication.payloadData.length());
} else if (v == serviceBtn) {
if (isServiceRunning) {
Log.d(TAG, "stopping sdk...");
PushManager.getInstance().stopService(this.getApplicationContext());
tView.setText(getResources().getString(R.string.no_clientid));
serviceBtn.setText(getResources().getString(R.string.stop));
isServiceRunning = false;
} else {
Log.d(TAG, "reinitializing sdk...");
PushManager.getInstance().initialize(this.getApplicationContext(), userPushService);
serviceBtn.setText(getResources().getString(R.string.start));
isServiceRunning = true;
}
} else if (v == bindAliasBtn) {
bindAlias();
// PushManager.getInstance().turnOnPush(this.getApplicationContext());
} else if (v == unbindAliasBtn) {
unBindAlias();
// PushManager.getInstance().turnOffPush(this.getApplicationContext());
} else if (v == transmissionBtn) {
showTransmission();
} else if (v == notifactionBtn) {
showNotification();
} else if (v == btnAddTag) {
addTag();
} else if (v == btnGetCid) {
getCid();
} else if (v == btnSilentime) {
setSilentime();
} else if (v == btnVersion) {
getVersion();
}
}
示例8: unBindAlias
import com.igexin.sdk.PushManager; //导入依赖的package包/类
private void unBindAlias() {
final EditText editText = new EditText(GetuiSdkDemoActivity.this);
new AlertDialog.Builder(GetuiSdkDemoActivity.this).setTitle(R.string.unbind_alias).setView(editText)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String alias = editText.getEditableText().toString();
if (alias.length() > 0) {
PushManager.getInstance().unBindAlias(GetuiSdkDemoActivity.this, alias, false);
Log.d(TAG, "unbind alias = " + editText.getEditableText().toString());
}
}
}).setNegativeButton(android.R.string.cancel, null).show();
}
示例9: init
import com.igexin.sdk.PushManager; //导入依赖的package包/类
public void init(Context context) {
PushManager.getInstance().initialize(context);
//设置静默
PushManager.getInstance().setSilentTime(context, SILENT_TIME, TIME_DURATION);
//注册RX bus,用于接收透传过来的push 消息
RxBusManager.register(this, EventConstant.KEY_NEW_PUSH_MESSAGE, PushBean.class)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::onNewMessage, Logger::e);
}
示例10: logIn
import com.igexin.sdk.PushManager; //导入依赖的package包/类
/**
* 登录到服务器
*
* @param info
* @return
*/
public Observable<User> logIn(WChatUserInfo info) {
//1.创建Request
HttpGsonRequest<User> mRefreshRequest = RequestBuilder.create(User.class)
.requestMethod(Request.Method.POST)
.url(ApiConstant.API_WX_LOGIN)
.put("role", "coach")
// 因为名字限制了长度,这里传到服务器的提前截断
.put("nickname", info.getNickname().length() > 18 ? info.getNickname().substring(0, 18) : info.getNickname())
.put("headimgurl", TextUtils.isEmpty(info.getHeadimgurl()) ? "avatar" : info.getHeadimgurl())
.put("unionId", info.getUnionid())
.put("openId", info.getOpenid())
.put("city", info.getCity())
.put("province", info.getProvince())
.put("sex", info.getSex() == 0 ? 1 : info.getSex())
.build();
//2.进行数据的处理
return gRequestPool.request(mRefreshRequest)
.filter((resp) -> null != resp && null != resp.data)
.map(HttpResponse::getData)
.doOnNext(this::saveUserInfo)
.doOnNext(user -> {
LoginManager.getInstance().setLoginUser(user);
//登录成功之后,初始化数据库
DBService.init(ZjbApplication.gContext);
//更新占位符基本参数
UrlParserManager.getInstance().updateBaseParams();
})
.doOnNext(user -> {
//绑定个推别名
String alias = EncryptUtil.md5(user.getUid());
PushManager.getInstance().bindAlias(ZjbApplication.gContext, alias);
})
.observeOn(AndroidSchedulers.mainThread());
}
示例11: onCreate
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_logo);
initView();
PushManager.getInstance().initialize(this.getApplicationContext());
}
示例12: onCreate
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loading);
// startActivity(new Intent(LoadingActivity.this, CameraSettingsTabActivity.class));
final MyViewerHelper myViewerHelper = MyViewerHelper.getInstance(getApplicationContext());
myViewerHelper.setLoginListener(new LoginListener() {
@Override
public void onLoginResult(boolean success) {
if(success){
boolean haveShowGuide = PrefUtils.getBoolean(LoadingActivity.this, PrefUtils.HAVE_SHOW_GUIDE);
Intent intent = new Intent();
if(haveShowGuide){
if(mUserInfo.isLogin){
intent.setClass(getApplicationContext(), CameraListActivity.class);
}else{
intent.setClass(getApplicationContext(), LoginActivity.class);
}
}else{
intent.setClass(getApplicationContext(), GuideActivity.class);
intent.putExtra(GuideActivity.START_AVS_ACTIVITY, true);
}
myViewerHelper.setLoginListener(null);
startActivity(intent);
LoadingActivity.this.finish();
}
}
});
mUserInfo = UserInfo.getUserInfo(this.getApplicationContext());
//init getui.
PushManager.getInstance().initialize(this.getApplicationContext());
}
示例13: initPush
import com.igexin.sdk.PushManager; //导入依赖的package包/类
public void initPush() {
if (mContext == null) {
mContext = App.getInstance();
}
PushManager.getInstance().initialize(mContext);
Tag[] tags = new Tag[1];
Tag tag = new Tag();
tag.setName("parent");
tags[0] = tag;
PushManager.getInstance().setTag(mContext, tags);
}
示例14: init
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@AfterViews
public void init()
{
PushManager.getInstance().initialize(this);
adapter = new AAdapter<Book>(BookItemView.class, this);
gv.setAdapter(adapter);
setData();
}
示例15: onCreate
import com.igexin.sdk.PushManager; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (!isChildrenProcess()) {
ButterKnife.setDebug(BuildConfig.DEBUG);
sInstance = this;
PushManager.getInstance().initialize(this);
}
}