I have upgraded code to react-native 0.59.9 from 0.53.3. I think I may have missed some essential steps and getting launch issues. Please check and help me to make app work fine.
React Native Navigation version: 4.0.6
React Native version: 0.59.9
Platform(s) (iOS, Android, or both?): Android.
Device info: Device and Simulator Both (All Android versions).
MainActivity.java
public class MainActivity extends NavigationActivity {static Backbonebits b;public void addDefaultSplashLayout() {LinearLayout splash = new LinearLayout(this);Drawable splash_screen_bitmap = ContextCompat.getDrawable(getApplicationContext(),R.drawable.splashscreen);splash.setBackground(splash_screen_bitmap); setContentView(splash);}@overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);MobileAds.initialize(this, new OnInitializationCompleteListener() {@overridepublic void onInitializationComplete(InitializationStatus initializationStatus) {}});b = new Backbonebits(this);}}
MainApplication.java
public class MainApplication extends NavigationApplication {private static CallbackManager mCallbackManager = CallbackManager.Factory.create();protected static CallbackManager getCallbackManager() { return mCallbackManager;} @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() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new FBSDKPackage(mCallbackManager), );} @Override public List<ReactPackage> createAdditionalReactPackages() { return getPackages(); }}
App.js
import React, { Component } from 'react';import {Platform} from 'react-native';import { Navigation } from 'react-native-navigation'import TermsOfUseController from "./app/routes/TermsOfUseController"import Utility from './app/config/Utility';const registerScreen = (name, component, styles) => {component.navigatorStyle = {...defaultNavigatorStyles,...styles};Navigation.registerComponent(name, () => component)}function registerAllScreens() {registerScreen('MyApp.LoginController', LoginController, {})}registerAllScreens();User.loggedInUser((user) => {User.addSignOutListner()var screenName = 'MyApp.LoginController';if (user) {if (user.id != 0 && user.id != undefined) {Utility.isFirstTimeLaunch = truescreenName = 'MyApp.HomeScreenController'; // User Already logged in}else {Utility.isFirstTimeLaunch = truescreenName = 'MyApp.LoginController'; // Not Logged in}}});Navigation.events().registerAppLaunchedListener(() => {Navigation.setRoot({ root: { stack: { children: [{ component: { name: screenName, passProps: { ...Navigation } } }], options: { topBar: { visible: false }, } } }});});});