0

With expo projects, we can start bundles and change ** CONNECTION** to tunnel from the developer tools for loading bundles globally. How can we load bundles globally for react-native projects? I tried with the public IP address but bundles require to connect with the same network.

AliRehman7141
  • 873
  • 3
  • 12
  • 33

1 Answers1

0

Based on the implementation of CodePush. You should be able to download the bundle from its remote location via native code and return its location via by overriding the MainApplication.java's getJSBundle() method.

// Override the getJSBundleFile method to let
// your runtime determine where to get the JS
// bundle location from on each app start
@Override
protected String getJSBundleFile() {
  // your implementation here
}

Same method using Objective-C for an iOS implementation by overriding AppDelegate.m's sourceURLForBridge method:

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
  // your implementation here
}

While for react-native the bundle must be available locally, your native code can download and swap the old bundle with the new one and than return the new bundle's location.

Fabio Nettis
  • 1,150
  • 6
  • 18