Coder Social home page Coder Social logo

Comments (2)

Hexi1997 avatar Hexi1997 commented on July 30, 2024 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.

Hexi1997 avatar Hexi1997 commented on July 30, 2024 1

我也是这个问题,你解决了么

from jmessage-react-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.