MeteorJS Mobile build : rooturl is always 10.0.2.2:3000 instead of the real server specified during build script

前端 未结 2 928
慢半拍i
慢半拍i 2021-01-14 23:31

since few days i have some problem with meteorjs and mobile build. The problem occurs with 3 differents apps.

I build the application with np scripting and this kind

相关标签:
2条回答
  • 2021-01-15 00:07

    Have you tried specifying the server? For example:

    --server=http://192.168.1.1:3000
    
    0 讨论(0)
  • 2021-01-15 00:13

    Ok, so i finally understood my errors : MeteorJs is a full platform, and one app can be used to build cordova app, web site, and server. When you build an app that has an android platform, you have to specify the --server parameter with the full uri of the server that will be used for DDP and cache application (--server=http://youServerIp:Port) Then when you run your server, you must not forget to specify the mobile-server params because it will be used to configure the Cordova app when a new version of the application will be served to the smartphone (--mobile-server http://yourServerIp:Port)

    Take care at one thing : * for the build there is the sign "=" like this --server=http://youServerIp:Port * whereas when you run your server there is no sign like this --mobile-server http://yourServer:Port

    In my case the build was good, which explain why at the first run of the app i had a connection to the server So it was the server that was misconfigured because i never pass the mobile-server params. So when the server send the new version, it didn't send the server uri so the cordova app just consider that it was a client only application. And so when the app refreshed, it only connectes to it-self.

    I have now modified my boilerpate to fix my start.sh scripts

    0 讨论(0)
提交回复
热议问题