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.
Asked
Active
Viewed 557 times
1 Answers
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
-
Have you tried it on your side? – AliRehman7141 Jan 25 '22 at 15:58
-
I haven't got around to try it with a custom implementation, but this is how CodePush does it. If you don't mind me asking what exactly are you trying to accomplish? – Fabio Nettis Jan 25 '22 at 19:31