本文整理汇总了Java中cn.jpush.android.api.JPushInterface.init方法的典型用法代码示例。如果您正苦于以下问题:Java JPushInterface.init方法的具体用法?Java JPushInterface.init怎么用?Java JPushInterface.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.jpush.android.api.JPushInterface
的用法示例。
在下文中一共展示了JPushInterface.init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPlugin
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
public static void initPlugin(Context ctx) {
Log.i(TAG, "JPush initialize.");
cordovaCxt = ctx;
JPushInterface.init(cordovaCxt);
//如果同时缓存了打开事件 openNotificationAlert 和 消息事件 notificationAlert,只向 UI 发打开事件。
//这样做是为了和 iOS 统一。
if (openNotificationAlert != null) {
notificationAlert = null;
transmitNotificationOpen(openNotificationTitle, openNotificationAlert,
openNotificationExtras);
}
if (notificationAlert != null) {
transmitNotificationReceive(notificationTitle, notificationAlert,
notificationExtras);
}
}
示例2: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fresco.initialize(this);
JPushInterface.init(this);
System.out.println("JPushInterface.getRegistrationID");
JPushInterface.init(getApplicationContext());
String rid = JPushInterface.getRegistrationID(getApplicationContext());
System.out.println("JPushInterface.getRegistrationID" + rid);
setContentView(R.layout.activity_main);
ActionBar actionBar = getSupportActionBar();
actionBar.hide();
initView();
mNetReceiver = new NetWorkChangeReceiver();
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(mNetReceiver, filter);
NetWorkState.mNetState = NetWorkState.isConn(MainActivity.this);
// registerMessageReceiver(); // used for receive msg
}
示例3: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
instance = this;
//初始化handler
mHandler = new Handler();
AppUtility.initialize(this);
Fresco.initialize(this, ImagePipelineConfigFactory.getImagePipelineConfig(this));
// 初始化短信验证码SDK接口
SMSSDK.initSDK(this, Constant.MOBSMS_APPKEY, Constant.MOBSMS_APPSECRET);
IconicFontEngine.addDefaultEngine(
new IconCommonEngine(Typeface.createFromAsset(getAssets(), "fonts/icomoon.ttf")));
JPushInterface.init(this); // 初始化 JPush
initConfigs(false);
sEmojiNormal = getResources().getDimensionPixelSize(R.dimen.emoji_normal);
sEmojiMonkey = getResources().getDimensionPixelSize(R.dimen.emoji_monkey);
//意见反馈匿名反馈初始化方式
FeedbackAPI.initAnnoy(this, "23389994");
//初始化Glide库
GlideFaceDetector.initialize(this);
//云信IM初始化
XKCache.setContext(this);
// SDK初始化(启动后台服务,若已经存在用户登录信息, SDK 将完成自动登录)
NIMClient.init(this, loginInfo(), options());
}
示例4: init
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
public void init() {
super.init();
LogInfo.log("zhuqiao", "call init");
initInMainProcess();
JPushInterface.setDebugMode(false);
JPushInterface.init(this);
this.mLeBoxApp = LeBoxApp.getInstanced();
this.mLeBoxApp.init((Application) this);
if (NetworkUtils.isUnicom3G(true)) {
((IWoFlowManager) JarLoader.invokeStaticMethod(JarLoader.loadClass(this, JarConstant.LETV_WO_NAME, JarConstant.LETV_WO_PACKAGENAME, "WoFlowManager"), "getInstance", null, null)).initSDK(this, Boolean.valueOf(false));
LogInfo.log("zhuqiao", "init wo");
this.mUnicomFreeInfoCache = new UnicomFreeInfoCache();
}
initLetvMediaPlayerManager();
setVType();
LetvPushService.schedule(this);
startCde();
LetvHttpApiConfig.initialize(Global.PCODE, Global.VERSION);
LeboxApiManager.getInstance().setLetvMediaPlayer(new LetvMediaPlayer(this) {
final /* synthetic */ LetvApplication this$0;
{
if (HotFix.PREVENT_VERIFY) {
System.out.println(VerifyLoad.class);
}
this.this$0 = this$0;
}
public void doPlay(Context context, LeboxVideoBean video) {
LogInfo.log("zhuqiao", "vid:" + video.vid + ";videoUrl:" + video.videoURL);
LeMessageManager.getInstance().dispatchMessage(new LeMessage(1, new AlbumPlayActivityConfig(context).createLebox(video)));
}
});
}
示例5: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
Log.d(TAG, "[ExampleApplication] onCreate");
super.onCreate();
JPushInterface.setDebugMode(true); // 设置开启日志,发布时请关闭日志
JPushInterface.init(this); // 初始化 JPush
}
示例6: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
app = this;
// 存放所有activity的集合
mActivityList = new ArrayList<>();
// 初始化app异常处理器 - 打包的时候开启
// CrashHandler handler = CrashHandler.getInstance();
// handler.init(getApplicationContext());
// 初始化OkHttpUtils
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.connectTimeout(10000L, TimeUnit.MILLISECONDS)
.readTimeout(10000L, TimeUnit.MILLISECONDS)
//其他配置
.build();
OkHttpUtils.initClient(okHttpClient);
// 初始化Fresco
ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
.setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
.build();
Fresco.initialize(this, config);
// 初始化ShareSDK
ShareSDK.initSDK(this);
// 初始化JPush
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
// 更新用户登录状态
UserBean.updateUserInfoFromNetwork(new UserBean.OnUpdatedUserInfoListener());
}
示例7: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
//Mob平台授权
ShareSDK.initSDK(this);
JPushInterface.setDebugMode(true);
// 设置开启日志,发布时请关闭日志
JPushInterface.init(this);
// 初始化 JPush
app = this;
registerActivityLifecycleCallbacks();
}
示例8: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
Log.d(TAG, "[ExampleApplication] onCreate");
super.onCreate();
JPushInterface.setDebugMode(true); // 设置开启日志,发布时请关闭日志
JPushInterface.init(this); // 初始化 JPush
}
示例9: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
context = getApplicationContext();
super.onCreate();
// 初始化极光推送sdk
// JPushInterface.setDebugMode(true);
JPushInterface.init(this);
JPushInterface.setAlias(context, "WOTPlus1.0", new TagAliasCallback() {
@Override
public void gotResult(int i, String s, Set<String> set) {
Log.d("Jpush set alias", String.valueOf(i));
}
});
}
示例10: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("super.onCreate","savedInstanceState");
setContentView(R.layout.activity_main_2);
Log.d("setContentView","R.layout.activity_main_2");
mContext=this;
confirm = (Button) findViewById(R.id.initation);
login = (Button) findViewById(R.id.Rdial);
beatH = (Button) findViewById(R.id.heartb);
state = (Button) findViewById(R.id.state);
username = (EditText) findViewById(R.id.editText1);
password = (EditText) findViewById(R.id.editText2);
root = (EditText) findViewById(R.id.editText3);
about = (TextView) findViewById(R.id.guanyu);
beatH.setOnClickListener(this);
confirm.setOnClickListener(this);
login.setOnClickListener(this);
about.setOnClickListener(this);
state.setOnClickListener(this);
sharedPre = getSharedPreferences("config",MODE_PRIVATE);
editor = sharedPre.edit();
String u = sharedPre.getString("username", "[email protected]");
username.setText(u.toCharArray(), 0, u.length());
String p = sharedPre.getString("password", "123456");
password.setText(p.toCharArray(), 0, p.length());
String r = sharedPre.getString("router", "admin");
root.setText(r.toCharArray(), 0, r.length());
JPushInterface.setDebugMode(false);
JPushInterface.init(this);
}
示例11: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
JPushInterface.setDebugMode(false);
JPushInterface.init(this);
FIR.init(this);
}
示例12: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
Log.d(TAG, "onCreate");
super.onCreate();
JPushInterface.setDebugMode(true); //设置开启日志,发布时请关闭日志
JPushInterface.init(this); // 初始化 JPush
}
示例13: onCreate
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
mApplicationContext = this;
mRefWatcher = LeakCanary.install(this);
JPushInterface.setDebugMode(true); // 设置开启日志,发布时请关闭日志
JPushInterface.init(this); // 初始化 JPush
}
示例14: jPush
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
* 此方法完成了初始化JPush SDK等功能 但仍需在MainActivity的onResume和onPause添加相应方法
* JPushInterface.onResume(context); JPushInterface.onPause(context);
*
* @param context
*/
public void jPush() {
// 设置JPush调试模式
JPushInterface.setDebugMode(true);
// 初始化JPushSDK
JPushInterface.init(context);
}
示例15: init
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
private void init(){
JPushInterface.init(getApplicationContext());
OkHttpClient okHttpClient = new OkHttpClient.Builder()
// .addInterceptor(new LoggerInterceptor("TAG"))
.connectTimeout(10000L, TimeUnit.MILLISECONDS)
.readTimeout(10000L, TimeUnit.MILLISECONDS)
//其他配置
.build();
OkHttpUtils.initClient(okHttpClient);
}