11package com .codepushdemoapp ;
22
33import android .app .Application ;
4+ import android .util .Log ;
45
56import com .facebook .react .ReactApplication ;
67import com .microsoft .codepush .react .CodePush ;
8+ import com .microsoft .codepush .react .CodePushBuilder ;
79import com .facebook .react .ReactNativeHost ;
810import com .facebook .react .ReactPackage ;
911import com .facebook .react .shell .MainReactPackage ;
@@ -16,11 +18,11 @@ public class MainApplication extends Application implements ReactApplication {
1618
1719 private final ReactNativeHost mReactNativeHost = new ReactNativeHost (this ) {
1820
19- @ Override
20- protected String getJSBundleFile () {
21- return CodePush .getJSBundleFile ();
22- }
23-
21+ @ Override
22+ protected String getJSBundleFile () {
23+ return CodePush .getJSBundleFile ();
24+ }
25+
2426 @ Override
2527 public boolean getUseDeveloperSupport () {
2628 return BuildConfig .DEBUG ;
@@ -30,9 +32,17 @@ public boolean getUseDeveloperSupport() {
3032 protected List <ReactPackage > getPackages () {
3133 return Arrays .<ReactPackage >asList (
3234 new MainReactPackage (),
33- new CodePush (getResources ().getString (R .string .reactNativeCodePush_androidDeploymentKey ), getApplicationContext (), BuildConfig .DEBUG , "http://api.code-push.com/" )
35+ new CodePushBuilder (getResources ().getString (R .string .reactNativeCodePush_androidDeploymentKey ),getApplicationContext ())
36+ .setIsDebugMode (BuildConfig .DEBUG )
37+ .setServerUrl (getResources ().getString (R .string .reactNativeCodePush_androidServerURL ))
38+ .build ()
3439 );
3540 }
41+
42+ @ Override
43+ protected String getJSMainModuleName () {
44+ return "index" ;
45+ }
3646 };
3747
3848 @ Override
0 commit comments