Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use with wix navigation v2 #300

Open
jdileep14 opened this issue Sep 18, 2018 · 7 comments
Open

how to use with wix navigation v2 #300

jdileep14 opened this issue Sep 18, 2018 · 7 comments

Comments

@jdileep14
Copy link

App crashing when we use with Wix navigation v2 with react-native-splash-screen.

mainapplication.js

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.toast.RCTToastPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.reactnativenavigation.NavigationApplication;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.reactnativenavigation.react.ReactGateway;
import java.util.Arrays;
import java.util.List;

import org.devio.rn.splashscreen.SplashScreenReactPackage;

public class MainApplication extends NavigationApplication {

@OverRide
protected ReactGateway createReactGateway() {
ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) {
@OverRide
protected String getJSMainModuleName() {
return "index";
}
};
return new ReactGateway(this, isDebug(), host);
}

@OverRide
public boolean isDebug() {
return BuildConfig.DEBUG;
}

 protected List<ReactPackage> getPackages() {
    // Add additional packages you require here
    // No need to add RnnPackage and MainReactPackage
    return Arrays.<ReactPackage>asList(
        new SplashScreenReactPackage()
        // eg. new VectorIconsPackage()
    );
}

 @Override
public List<ReactPackage> createAdditionalReactPackages() {
    return getPackages();
}



//   @Override
//     public boolean getUseDeveloperSupport() {
//         return BuildConfig.DEBUG;
//     }

}

mainactivity.java
import com.reactnativenavigation.NavigationActivity;

import android.os.Bundle; // here
import org.devio.rn.splashscreen.SplashScreen; // here
//import com.reactnativecomponent.splashscreen.RCTSplashScreen; //import RCTSplashScreen

public class MainActivity extends NavigationActivity {

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

please help to solve this issue thanks in advance

@damathryx
Copy link

i also need help

@damathryx
Copy link

got mine to work. have you added the layout xml?

@el-lsan
Copy link

el-lsan commented Mar 12, 2019

@damathryx @jdileep14
Did you find any solution ?

@marudy
Copy link

marudy commented Mar 13, 2019

Also looking for a solution to this and if you managed to integrate hide method with Android successfully

@sorin-f-wiredelta
Copy link

@damathryx Could you please post the solution since you got it to work?

@Crisis2010
Copy link

Here how it works
Tested on React Native 0.59.8, React-native-navigation 2.20.1

File MainActivity.java full code

import android.os.Bundle;
import org.devio.rn.splashscreen.SplashScreen;

import com.reactnativenavigation.NavigationActivity;

public class MainActivity extends NavigationActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this);  // here
        super.onCreate(savedInstanceState);
    }
}

@Crisis2010
Copy link

I think it could be closed and maybe add this in install tutorial

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

No branches or pull requests

6 participants