|
@@ -1,32 +1,36 @@
|
|
package com.huiliaojmessage;
|
|
package com.huiliaojmessage;
|
|
|
|
|
|
import android.app.Application;
|
|
import android.app.Application;
|
|
|
|
+import android.util.Log;
|
|
|
|
|
|
import com.facebook.react.ReactApplication;
|
|
import com.facebook.react.ReactApplication;
|
|
-import com.lynxit.contactswrapper.ContactsWrapperPackage;
|
|
|
|
-import com.xb.contactpicker.ReactNativeContacts;
|
|
|
|
-import com.reactnative.ivpusic.imagepicker.PickerPackage;
|
|
|
|
-import com.rnfs.RNFSPackage;
|
|
|
|
-import org.reactnative.camera.RNCameraPackage;
|
|
|
|
-import com.rnim.rn.audio.ReactNativeAudioPackage;
|
|
|
|
-import io.jchat.android.JMessageReactPackage;
|
|
|
|
-import cn.jiguang.imui.messagelist.ReactIMUIPackage;
|
|
|
|
import com.facebook.react.ReactNativeHost;
|
|
import com.facebook.react.ReactNativeHost;
|
|
import com.facebook.react.ReactPackage;
|
|
import com.facebook.react.ReactPackage;
|
|
import com.facebook.react.shell.MainReactPackage;
|
|
import com.facebook.react.shell.MainReactPackage;
|
|
import com.facebook.soloader.SoLoader;
|
|
import com.facebook.soloader.SoLoader;
|
|
|
|
+import com.lynxit.contactswrapper.ContactsWrapperPackage;
|
|
|
|
+import com.reactnative.ivpusic.imagepicker.PickerPackage;
|
|
|
|
+import com.rnfs.RNFSPackage;
|
|
|
|
+import com.rnim.rn.audio.ReactNativeAudioPackage;
|
|
|
|
+import com.xb.contactpicker.ReactNativeContacts;
|
|
|
|
+
|
|
|
|
+import org.reactnative.camera.RNCameraPackage;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
-public class MainApplication extends Application implements ReactApplication {
|
|
|
|
|
|
+import cn.jiguang.imui.messagelist.ReactIMUIPackage;
|
|
|
|
+import cn.jpush.im.android.api.JMessageClient;
|
|
|
|
+import io.jchat.android.JMessageReactPackage;
|
|
|
|
|
|
|
|
+public class MainApplication extends Application implements ReactApplication {
|
|
|
|
+ private boolean shutdownToast = false;
|
|
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
|
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
|
@Override
|
|
@Override
|
|
public boolean getUseDeveloperSupport() {
|
|
public boolean getUseDeveloperSupport() {
|
|
return BuildConfig.DEBUG;
|
|
return BuildConfig.DEBUG;
|
|
}
|
|
}
|
|
- private boolean shutdownToast = false;
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected List<ReactPackage> getPackages() {
|
|
protected List<ReactPackage> getPackages() {
|
|
return Arrays.<ReactPackage>asList(
|
|
return Arrays.<ReactPackage>asList(
|
|
@@ -58,5 +62,9 @@ public class MainApplication extends Application implements ReactApplication {
|
|
public void onCreate() {
|
|
public void onCreate() {
|
|
super.onCreate();
|
|
super.onCreate();
|
|
SoLoader.init(this, /* native exopackage */ false);
|
|
SoLoader.init(this, /* native exopackage */ false);
|
|
|
|
+ Log.i("MainApplication", "Init JMessageClient");
|
|
|
|
+ JMessageClient.setDebugMode(true);
|
|
|
|
+ // JMessage SDK 2.5.0 后必须在 MainApplication 中初始化
|
|
|
|
+ JMessageClient.init(this, true);
|
|
}
|
|
}
|
|
}
|
|
}
|