lundi 13 mars 2017

Load jsBundle from own Webserver in react-native

I am using react-native for App Development und in AppDelegate.swift the line:

let jsCodeLocation = NSURL(string: "http://localhost:8081/index.ios.bundle?platform=ios&dev=true") 

defines the location of the generated jsBundle file. My idea was now to use a webserver which serves this bundle dynamically. In our web development process we will have multiple concurrent testing versions generated from GitLab. A typical testing URI is for example:

T1456-master.developmentserver.com

The subdomains are generated automatically whenever a new ticket and or branch is being created by a developer. And with the generated URL the different versions can be easily tested.

Now i am considering to use a similar deployment and testing process for our react-native Apps, but the main problem is how to deliver the on-the-fly updates to the app.

One solution would be code-push from Microsoft but we want to use our own servers. In the end the app should connect to our server and downloads the jsBundle from there and not from Microsoft servers.

On the other hand a simple download of the jsBundle from our own server (on every app start) is also inappropriate because the file has usually more than 1.5MB.

Are there any other solutions using our own servers?

Aucun commentaire:

Enregistrer un commentaire