Closed davidellolio closed 8 years ago
Possible dup of #140. Are you deploying to a device via cordova? If so, what device type?
Hi @gareth-ferneyhough I use Ionic framework and have this problem in ios and android Device.
D.
@davidellolio can you share, what plugins are installed in your project?
Also, what version of Ionic platform?
Hi @nikDemyankov,
I used this plugins: "cordova-plugin-badge" "cordova-plugin-camera" "cordova-plugin-console" "cordova-plugin-contacts" "cordova-plugin-device" "cordova-plugin-device-orientation" "cordova-plugin-dialogs" "cordova-plugin-file" "cordova-plugin-file-transfer" "cordova-plugin-geolocation" "cordova-plugin-inappbrowser" "cordova-plugin-network-information" "cordova-plugin-screen-orientation": "cordova-plugin-splashscreen" "cordova-plugin-whitelist" "ionic-plugin-keyboard" "phonegap-plugin-push" "uk.co.workingedge.phonegap.plugin.launchnavigator" "cordova-plugin-x-socialsharing" "cordova-plugin-actionsheet" "cordova-hot-code-push-plugin" "cordova-hot-code-push-local-dev-addon" "de.appplant.cordova.plugin.local-notification" "cordova-plugin-x-toast" "dependent_plugins": { "cordova-plugin-app-event" "cordova-plugin-compat" }
ionic-version : 1.7.16
This is a log after installed:
07-18 10:17:50.284 12085-12214 D/CHCP: Dispatching Before install event
07-18 10:17:52.286 12085-16526 D/CHCP: Update is installed
07-18 10:17:52.299 12085-12085/ D/CHCP: Loading external page: /data/user/0/it.project/files/cordova-hot-code-push-plugin/2016.07.15-18.24.31/www/index.html
07-18 10:17:52.328 12085-12085/ D/JsMessageQueue: Set native->JS mode to null
07-18 10:17:52.412 12085-12214/ D/CordovaBridge: Ignoring exec() from previous page load.
07-18 10:17:52.454 12085-12085/ W/cr.BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 12085
07-18 10:17:52.458 12085-12085/ W/cr.BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 12085
Thank you
Hi,
Thanks! Will try to reproduce that.
I add more information:
Thank you, D.
In installationCallback I have put a $state.go("tabsController.home") to go in my homepage.
Actually, this line would be, probably, ignored. When update has been installed - plugin should reload webview to the index page. And the index page is the one, that is defined in config.xml
:
<content src="index.html" />
So, it will take this url and load it in the view.
Haven't got time to play with your setup yet, sorry...
@davidellolio Tried it out for Android and worked fine. This is what I did:
Created a tabbed Ionic project:
ionic start Test tabs
cd Test
ionic platform add android
ionic plugin add cordova-hot-code-push-plugin
ionic plugin add <ALL_YOUR_OTHER_PLUGINS>
The only plugin I skipped is cordova-hot-code-push-local-dev-addon
, since you do the installation and download manually.
Launched local server to ship files and generate configs:
cordova-hcp server
Configured config.xml
:
<chcp>
<auto-download enabled="false" />
<auto-install enabled="false" />
<config-file url="https://18efd8cd.ngrok.io/chcp.json"/>
</chcp>
Again, I disabled both auto-install and auto-download, since you do it from JS code. As a config-url I set a local server's url.
Added update code to www/js/app.js
:
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
// CHCP update code
chcp.fetchUpdate(function(err, data) {
if (err) {
return;
}
console.log('Fetched update');
chcp.installUpdate(function(err) {
if (err) {
console.log(err);
return;
}
console.log('Installed');
});
});
});
})
// the rest of the default project angular code
Launched the app:
ionic emulate android
App started fine, but since I didn't change anything - no updates were downloaded.
www/templates/tab-dash.html
and launched the app again. After a few moments update was downloaded and app reloaded to the index page, so I could see the changes.System:
Can you try to do the same steps in your app and see, if it works? Maybe all you need is to remove cordova-hot-code-push-local-dev-addon
from the project and set auto-install
and auto-download
to false
? Also, check that there are no JS errors in the project, because this can lead to the issue you are having.
Thank you @nikDemyankov
I will check if have any issue in javascript and follow your steps.
@nikDemyankov I have deleted $state.go row in installationCallback function and now I don't have update problem. I have checked js files and I don't have error. Maybe this command is not accepted.
Thank you for your support.
Good :) Please, close the issue, if it is solved :)
Yes. Thank you
Hi guys,
I have used javascript chcp support for the update the ionic project. The update works only restart the app.
Steps to reproduce
-auto-download set to true in config.xml -auto-install set to false in config.xml -Functions used :
checkForUpdate: function() { chcp.fetchUpdate(app.fetchUpdateCallback); },
fetchUpdateCallback: function(error, data) { if (error) { console.log('Failed to load the update with error code: ' + error.code); console.log(error.description); return; } console.log('Update is loaded, running the installation');
},
installationCallback: function(error) { if (error) { console.log('Failed to install the update with error code: ' + error.code); console.log(error.description); } else { console.log('Update installed!'); } }
When the installation is terminated the installationCallback function is called and angular view my old homepage and not new homepage. If i want see the new homepage i must restart the app.
Could you help me?
Thank you, Davide