Reputation: 14563
I've picked up a project that is using the React Native Code Push plugin (version 1.2.1-beta). The plugin configuration requires you replace the reference to the javascript bundle with the line:
jsCodeLocation = [CodePush getBundleUrl];
Where is that bundle coming from? How do I switch it to use the localhost url hosted by the react native packager for development? Switching the line back to the usual
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
seems to cause all sorts of errors.
Upvotes: 2
Views: 448
Reputation: 233
I'm one of the developers that built the plugin.
When the plugin downloads an update from the CodePush server, the downloaded JS bundle gets saved to a location on ur device's hard disk. What [CodePush getBundleUrl]
does is it checks if an update exists on the hard disk, if so, return the URL to that bundle, otherwise, it returns the URL to the bundle that was shipped with your binary via the app store.
Setting jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]
will cause your app to always load the latest bundle from the React Native Packager and therefore ignore any locally saved CodePush updates downloaded during testing. I'm not sure what errors you are seeing, please modify your question or comment with the exact errors, or file an issue on our GitHub repo, I'll be more than happy to help.
Upvotes: 2