ctlabvn / react-native-starter-kit

[ABANDONED, TRY MAK repo pls]: Integrated best performance navigation, redux, push notification, icon|splash screen and many awesome stuff
30 stars 10 forks source link

linking new packages issue #4

Closed creative-git closed 6 years ago

creative-git commented 6 years ago

Thanks for this kit, we used on an old app and now we need to add some packages, but when i link new packages, using "react-native link" the files are added to the commented section in

` package com.example;

import android.support.annotation.Nullable; import com.reactnativenavigation.NavigationApplication;

import com.RNFetchBlob.RNFetchBlobPackage; import com.oblador.vectoricons.VectorIconsPackage; import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader;

import java.util.Arrays; import java.util.List;

public class MainApplication extends NavigationApplication { @Override public boolean isDebug() { return BuildConfig.DEBUG; }

@Nullable @Override public List createAdditionalReactPackages() { return Arrays.asList( new VectorIconsPackage(), new RNFetchBlobPackage(), new ReactNativeOneSignalPackage() ); }

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

// public class MainApplication extends Application implements ReactApplication {

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

// @Override // protected List getPackages() { // return Arrays.asList( // new MainReactPackage(), // new RNFetchBlobPackage(), // new VectorIconsPackage(), new RNSoundPackage(), new ImagePickerPackage(), new ReactNativeRestartPackage() // new ReactNativeOneSignalPackage(), // new NavigationReactPackage() // ); // } // };

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

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

so how to add new packages and link them ?

anhtuank7c commented 6 years ago

By using react-native-navigation, we have to rewrite MainApplication.java and MainActivity.java, That why react-native link doesn't work on Android. You have to integrate manually by put your Native Package right here: https://github.com/agiletechvn/react-native-starter-kit/blob/master/android/app/src/main/java/com/reactnativestarterkit/MainApplication.java#L27

creative-git commented 6 years ago

perfect