I'm having some issues with direct update on iOS. Following scenario describes my problem.
- Add the code snippet below to main.js
- Enabled worklightSettings in application-descriptor.xml
- Run on Worklight Development Server
- Open project in Xcode via eclipse
- Run
- Make a change and re-deploy
- Verify Direct Update is received
- Uninstall app
- Obtain new IP (in my case by restarting my macbook the next day)
- Open project in Xcode via eclipse
- Run
- Open myapp settings via Settings.app and enable Custom Server URL. The URL is pointing to the old IP.
- Enable Custom Server URL and enter the correct IP
- Open app
- Direct Update is not received
Code snippet:
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
}
function onConnectSuccess() {
WL.Logger.debug("Connect success.");
}
function onConnectFailure() {
WL.Logger.debug("Connect failed.");
}
EDIT
Try following scenario:
- create a new app from scratch and deploy it on your iPad
- verify the custom server URL and test direct update: all is working fine (OK)
- update the ip on your development machine
- remove the app from the device and reinstall it
- verify the custom server URL: the old IP is present (NOK)
- start the app with the use custom server url unchecked => 'connect success'
- start the app with the use custom server url checked (don't change ip) => 'connect success'
- try to access the app in your browser with this ip => doesn't work
- change the ip and remove the last front slash from the custom server url
- start the app with the new correct IP (which works in the browser) => 'connect success'
- change the ip back to the incorrect IP, add the slash and retry => NO 'connect success'
The exact same custom server URL which worked before fails now. When I try a random IP address I also don't get the 'connect success'.
EDIT
result of ifconfig:
ifconfig http://i59.tinypic.com/200y2j8.png