Comments (2)
这个问题困扰了一天,最后终于解决了
原因分析:这个问题的出现是因为今年1月份的时候对JMessageReactPackage.java做了一次commit,详细修改可见 4da1a83 。这个commit会导致更新后的JMessageReactPackage无法传递参数,因为在new JMessageModule(reactContext, false)中写死为false,用户无法传参,将JMessageReactPackage.java改为之前的版本就是正确的。按照文档走安装最新版本的话,用户100%会遇到这个问题。
解决方案:将node_modules/jmessage-react-plugin/android/src/io/jchat/android/JMessageReactPackage.java修改还原为之前版本,代码如下
package io.jchat.android;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class JMessageReactPackage implements ReactPackage {
private boolean mShutdownToast;
public JMessageReactPackage(boolean shutdownToast) {
mShutdownToast = shutdownToast;
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> result = new ArrayList<>();
result.add(new JMessageModule(reactContext, mShutdownToast));
return result;
}
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
List<ViewManager> viewManagers = new ArrayList<>();
viewManagers.add(new BubbleMsgManager());
return viewManagers;
}
}
from jmessage-react-plugin.
我也是这个问题,你解决了么
from jmessage-react-plugin.
Related Issues (20)
- unfortunately app has stopped
- 无法将类 JMessageReactPackage中的构造器 JMessageReactPackage应用到给定类型; HOT 9
- 你们插件不维护了吗
- ios release 编译失败
- retractMessage無法撤回訊息
- How to get JIMAppKey
- 语音消息上传后扩展名丢失 HOT 1
- jmessage-react-plugin下载失败
- 小米手机特定一个群能收到消息,但通知栏不显示,其他群正常。
- Could not invoke JMessageModule.setup HOT 2
- 用户消息未读数始终是0
- 为什么一直无法注册成功?
- 如何打开调试模式,打印日志?
- 【安卓】接收自定义消息,通知栏没有弹窗,未读数量也没有增加
- 【IOS】发消息带的extras字段不生效
- RN-android开发,项目一直new JMessageReactPackage(false)一直报错起不来。哪位仁兄能看下哪里错了 HOT 1
- 怎么接收不到离线消息
- sendVideoMessage 这个方法有问题
- 配置好报错,
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmessage-react-plugin.