Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

installation on react-native 0.54.0 #45

Open
Assem-Hafez opened this issue Mar 24, 2018 · 7 comments
Open

installation on react-native 0.54.0 #45

Assem-Hafez opened this issue Mar 24, 2018 · 7 comments

Comments

@Assem-Hafez
Copy link

I am trying to install the library in my project but i found that the react-native MainActivity is different from what i see in the example. Here is the code:
MainActivity

public class MainActivity extends ReactActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this);  // here
        super.onCreate(savedInstanceState);
    }

    @Override
    protected String getMainComponentName() {
        return "App_name";
    }
}

MainApplication


public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage()
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

can you please guide me on how to pass the activity in the MainApplication to this line

cordovaPluginPackage = new CordovaPluginPackage(this)

and how to access the value assigned to cordovaPluginPackage in the MainAcitivity

is that applicable or i have to downgrade the react-native version?

@kyungjoongo
Copy link

Same issue , not work in react-native 0.55+

@mateuszmatyszkowicz
Copy link

mateuszmatyszkowicz commented Nov 14, 2018

Same too..., @Assem-Hafez , @kyungjoongo did you manage to inject cordova plugin into react native app??

@mateuszmatyszkowicz
Copy link

@mribbons I seen that you had been worked on your fork, maybe you could help us?

@mribbons
Copy link
Contributor

From memory I didn't have much luck with this plugin. Transpiling of the cordova plugin's js files wouldn't work.

I suggest you locate RN ports of the cordova packages you need, or write them yourself.

@mribbons
Copy link
Contributor

#42

@mateuszmatyszkowicz
Copy link

@mribbons so I probably also abandon this idea. I have got one more question to you, did you know any other libraries to react native which have good barcode scan performance? I didn't manage to scan AZTEC code using react-native-camera and then I found https://github.com/dex4er/phonegap-plugin-barcodescanner so I wanted to used it with react-native-cordova-plugin but as appear we can''t do it.

@mribbons
Copy link
Contributor

mribbons commented Nov 15, 2018

@mateuszmatyszkowicz zxing is one I have heard a lot of but never tried (I have only worked with built in (hardware) scanners for android).

Google "zxing react native", there's a few options to look at.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants