Comments (10)
Hi,
Setting config-file to local server: https://4961a61c.ngrok.com/chcp.json
When you execute cordova-hcp server
CLI client creates .chcpenv
file in the root of your Cordova/Ionic project. In your case:
{
"content_url": "https://4961a61c.ngrok.com",
"config_url": "https://4961a61c.ngrok.com/chcp.json"
}
When project is build - after_prepare
hook from the plugin get's executed. He reads this file, takes config_url
and puts it in the platform specific config.xml
. Why he does that? Well, so you would not have to do that.
I noticed the ngrok.com is not accessible and suspected it was the cause of failure.
Yes, if you can't open https://4961a61c.ngrok.com/chcp.json
- then ngrok is not reachable or not running. If you change hostname to the ip address, then you need:
-
Check, that it is accessible via browser:
http://192.168.108.98:31284/chcp.json
. -
Either change in
.chcpenv
hostname4961a61c.ngrok.com
to192.168.108.98:31284
. Or inplugins/cordova-hot-code-push-local-dev-addon/scripts/afterPrepareHook.js
on line 138 changevar localServerURL = getLocalServerURLFromEnvironmentConfig(ctx);
to
var localServerURL = 'http://192.168.108.98:31284';
from cordova-hot-code-push-local-dev-addon.
Hi Nic. Thanks so much for your prompt reply. I'm glad you mentioned .chcpenv file. I had tried to modified it but every time I ran cordova-hcp server, the file would be set to its default ie https://4961a61c.ngrok.com . now I am going to modify afterPrepareHook.js instead and let you know how it goes.
from cordova-hot-code-push-local-dev-addon.
I modified afterPrepareHook.js file according to your instruction
var localServerURL = 'http://192.168.108.98:31284/chcp.json';
and now the cordova-hcp server can report "a user connected". however, on the app side, there's no update or reload action after I modified index.html.
Going to learn and investigate. Any further suggestion? Thanks again!
from cordova-hot-code-push-local-dev-addon.
Tried both on emulator and actual mobile phone, both failed. The cordova-hcp server reports:
a user connected
File changed: D:\playground\TestHCP\www\index.html
Config { name: 'test',
ios_identifier: '',
android_identifier: '',
update: 'now',
content_url: 'http://192.168.108.98:31284',
release: '2016.01.08-17.31.45' }
Build 2016.01.08-17.31.45 created in D:\playground\TestHCP\www
Should trigger reload for build: 2016.01.08-17.31.45
so I guess the problem is on the app side? any suggestions? Thanks!
from cordova-hot-code-push-local-dev-addon.
If you see in console a user connected
- then emulator/device did connect to the server via sockets and listening for the updates. So most likely, it can't download new content.
Open platforms/ios/YOUR_PROJECT_NAME.xcodeproj
in Xcode and launch the app to see the logs in Xcode console.
Also, on your emulator launch Safari and open http://192.168.108.98:31284/chcp.json
. If it's not opening, then use http://localhost:31284/chcp.json
instead. If localhost is opening - use it instead of the ip address.
Also, after opening chcp.json in Safari - check, that content_url
property is set correctly. For example:
{
"autogenerated": true,
"release": "2016.01.08-11.00.04",
"content_url": "http://localhost:31284",
"update": "now"
}
from cordova-hot-code-push-local-dev-addon.
Hi Nik, I finally figure out what was wrong. There's nothing wrong with the plugin per se. The plugin would phone home and get chcp.json successfully. But it wouldn't be able to subsequently ask for the manifest with success, cuz I realized I'd have to set up a dev version of cordova-hcp.json for cordova-hcp cli, so that it will generate proper chcp.json (to be exact, content-url pointing to local server) for development purposes. It's a bit inconvenient, I kinda hope the local-dev-plugin can kick in and modify the cordova-hcp.json for me. But anyway, good work! Thanks!!! I'm going to explore more on the hot code push plugin itself. See you there?
from cordova-hot-code-push-local-dev-addon.
Hi,
Glad to hear, that you find the problem :) It's strange, that you had to do that. Will look into this.
I'm going to explore more on the hot code push plugin itself. See you there?
Sure, if you find a bug or hit some problem - just post a question in there.
from cordova-hot-code-push-local-dev-addon.
I'm a novice so don't bother look into the so-called problem just yet. Maybe there isn't anything wrong after all, just me being silly lol. Now I've adjusted my workflow a little: put aside the local dev addon, and only use cordova-hcp build to generate manifest after I change something in the www folder, then I start up my own http server:
python -m SimpleHTTPServer 8081
This way I'll be able to focus on testing and developing around the hot code push plugin. Of course it also means I'll have to modify config.xml() and cordova-hcp.json(content_url) before deploying to production environment. (just keeping a record here for novices whoever may face similar problems to mine)
from cordova-hot-code-push-local-dev-addon.
Good, thanks for the info :)
from cordova-hot-code-push-local-dev-addon.
đ Hi! Thank you for your interest in this repo.
đĸ We are not using nordnet/cordova-hot-code-push-local-dev-addon anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.
đ This will now be closed & locked.
âšī¸ Please see #29 for more information.
from cordova-hot-code-push-local-dev-addon.
Related Issues (20)
- Could not use link mode of cordova plugin. HOT 3
- Can't build iOS project with Chinese name HOT 2
- Not working on iOS with Cordova v6.3.1 HOT 9
- Xcode 8 compatibility HOT 4
- When installed with cordova-plugin-camera we get error code 65 for command: xcodebuild. HOT 17
- Cant compile when other plugin is using Swift. HOT 2
- Use local server instead of public server HOT 3
- Can build/run with the plugin installed HOT 3
- Local server crash HOT 1
- Error: Cannot find module '../plugman/platforms/ios' HOT 6
- Merge Dex when using with com.paypal.cordova.mobilesdk HOT 1
- Plugin does not work when compiled with XCode 9 HOT 1
- Plugin does not work with [email protected] HOT 1
- PSA: Deprecation notice 2018-09-30
- HCPLDPlugin.m Unknown type name 'SocketIOClient' HOT 5
- Update cordova hooks for iOS for Cordova 5.4
- hard to visit https://ngrok.com HOT 2
- New native-interface setting is discarded when using this plugin HOT 3
- Disable ngrok? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-hot-code-push-local-dev-addon.