Closed mrjumpy closed 8 years ago
Make sure you have done all the steps...
phonegap create MyAppName --template react-hot-loader
cd MyAppName
npm install
phonegap platform add ios
npm start
Then open another terminal in the same directory... and...
npm run ios
or
phonegap run ios
Because the template has to bundle all the JS with Babel and WebPack, then it has to modify the config.xml
and run the WebPack dev server. missing out on any of the steps above will give you the blank page you are experiencing.
I've tried, still same. I think it should have some bug message here.
What version of PhoneGap are you using?
phonegap --version
What version of node/npm?
npm --version
node --version
phonegap => 6.0.5 node => v5.8.0 npm => 3.7.3
OK. I have attempted to replicate using those exact versions and it's still working for me.
Make sure npm start
is still running in another terminal when you phonegap run ios
Perhaps you could test it in the browser?
npm start
then point a browser at http://localhost:8080
my browser is ok actually. only run on ios emulator will show blank. lol I think maybe something wrong on my enviroment.
and, this works for me. even in emulator. https://github.com/unimonkiez/react-cordova-boilerplate
I'll migrate my code to this project, if I find some error cause the problem, I'll inform you
One last thing you can do...
After running npm start
and confirming it works in a browser, check config.xml and see if the content src
entries are as follows:
<platform name="android">
<content src="http://10.0.2.2:8080/index.html" />
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<content src="http://localhost:8080/index.html" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<allow-navigation href="http://*/*" />
</platform>
We are looking to see if Android is <content src="http://10.0.2.2:8080/index.html" />
and iOS is <content src="http://localhost:8080/index.html" />
👍
hey, you are right.
Because I use react-router
, so, the real path on is localhost:8080
. no /index.html here.
XD
I think this should write it down on readme.
big thanks! I don't have to migrate my code.
Hi, I got err when npm start
, it shows : node config && HOST=0.0.0.0 webpack-dev-server
, how can I solve it?
btw, when I run npm install
, some warns show:
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN appstore@1.0.0 No description
npm WARN appstore@1.0.0 No repository field.
npm WARN appstore@1.0.0 license should be a valid SPDX license expression
I just clone this repo and run on ios emulator. But only show blank on screen. anything I miss?
only different part I think: I use phonegap cli instead of Install the Cordova CLI