|
@@ -1,32 +1,36 @@
|
|
|
package com.huiliaojmessage;
|
|
|
|
|
|
import android.app.Application;
|
|
|
+import android.util.Log;
|
|
|
|
|
|
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.ReactPackage;
|
|
|
import com.facebook.react.shell.MainReactPackage;
|
|
|
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.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) {
|
|
|
@Override
|
|
|
public boolean getUseDeveloperSupport() {
|
|
|
return BuildConfig.DEBUG;
|
|
|
}
|
|
|
- private boolean shutdownToast = false;
|
|
|
+
|
|
|
@Override
|
|
|
protected List<ReactPackage> getPackages() {
|
|
|
return Arrays.<ReactPackage>asList(
|
|
@@ -58,5 +62,9 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
public void onCreate() {
|
|
|
super.onCreate();
|
|
|
SoLoader.init(this, /* native exopackage */ false);
|
|
|
+ Log.i("MainApplication", "Init JMessageClient");
|
|
|
+ JMessageClient.setDebugMode(true);
|
|
|
+ // JMessage SDK 2.5.0 后必须在 MainApplication 中初始化
|
|
|
+ JMessageClient.init(this, true);
|
|
|
}
|
|
|
}
|