Comments (12)
@ibcooley and @joshgarwood whoops, looks like we weren't resolving the extract
promise correctly, we're working on a fix right now and will update you soon!
Mentioning this here, but it's just as applicable to #13 (comment)
from ionic-cloud-angular.
@joshgarwood extract()
will simply extract the update and save it to your device, to actually apply it you will then need to call load()
.
Here's an example from one of my testing apps:
deploy.check().then((hasUpdate: boolean) => {
if (hasUpdate) {
deploy.download().then(() => {
deploy.extract().then(() => {
deploy.load();
}, (error) => {
console.log("Error extracting: " + error);
})
}, (err) => {
console.log("Error downloading: " + err);
});
}
}, (cErr) => {
console.log("Check error: " + cErr);
})
As to your extract failing, I'd look to your logs to see if any errors are happening. I can't be certain what's going on from the code above, and can't reproduce the issue.
from ionic-cloud-angular.
@joshgarwood We don't recommend calling load()
, though, as it immediately refreshes the app, instead of just loading up the new app snapshot when the app is started again. Are you on Android or iOS?
from ionic-cloud-angular.
Hey guys! Thanks so much for the quick responses.
@Fuiste I am actually calling deploy.load()
in my handleUpdateResponse()
function if the extract was successful. But it never gets called because the success
parameter in the extract()
callback is always false. As well, my logs don't indicate any failure. In looking at the ionic-cloud deploy.ts (line 169), there isn't any log output for this scenario... The extract()
doesn't throw an error, it's just that success
is false.
@dwieeb That's definitely good to know. I am currently calling load()
in the event of a successful extract... are there potential issues with that? I've seen some odd behavior (such as my app always going back to the splash screen after opening from the background). I am on Android.
Thanks again guys, y'all are awesome!
from ionic-cloud-angular.
Sorry to be such a pest, but do either of you know if it's possible to expose a more useful error message (or add more detailed logging) for the extract()
method in the deploy plugin? That may help me diagnose my issue.
Thanks!
from ionic-cloud-angular.
@joshgarwood The error messages from the deploy plugin are going to be very unhelpful. We're aware of this and we want to take a look at modernizing the plugin and perhaps providing a better API as soon as we can. For now, you can do adb logcat
and try to look at the deploy plugin logs. You should be able to grep for "IONIC".
from ionic-cloud-angular.
Similar to @joshgarwood, i've seen an issue where the extract method promises to return a boolean, but returns false even if successful. Perhaps that is the problem?
From your examples above, it appears that you disregard the boolean return value as it comes from extract. Is that intentional?
My code is below
this.deploy.download().then((success) => {
let message = success ? 'Update successfully installed.' : 'An error occurred while updating the app';
if (success) {
this.deploy.extract().then(success => {
//TODO: proper extraction success checking
console.log("extract success: " + success); //is false
this.deploy.load();
}).catch(err => console.log("Extract Failed:" + JSON.stringify(err)));
}
this.loading.hide().then(() => { resolve(message) });
}).catch(err => {
this.loading.hide().then(() => { resolve('An error occurred while updating the app: ' + err) });
});
from ionic-cloud-angular.
What devices are you guys trying this on (specifically)? @joshgarwood @ibcooley
from ionic-cloud-angular.
@joshgarwood and I work on the same dev team, btw.
But our team has had issues with the following:
- iPhone 6
- Genymotion Emulator
- HTC M8
My ADB log when extracting is completing looks like this:
09-02 17:09:30.517 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 90%
09-02 17:09:30.518 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 92%
09-02 17:09:30.519 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 93%
09-02 17:09:30.524 29524 29524 W art : Attempt to remove non-JNI local reference, dumping thread 09-02 17:09:30.538 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 95%
09-02 17:09:30.540 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 96%
09-02 17:09:30.543 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 98%
09-02 17:09:30.543 29524 29598 I IONIC.DEPLOY.EXTRACT: Progress: 100%
09-02 17:09:30.554 29524 29598 I IONIC.DEPLOY.REMOVE: Removed www.zip
09-02 17:09:30.590 29524 29524 W art : Attempt to remove non-JNI local reference, dumping thread
09-02 17:09:30.657 29524 29524 W art : Attempt to remove non-JNI local reference, dumping thread
09-02 17:09:30.700 29524 29524 I chromium: [INFO:CONSOLE(29)] "extract success: false", source: http://192.168.1.2:8100/ (29)
09-02 17:09:30.700 29524 29524 I IONIC.DEPLOY.REDIRECT: Loading deploy version: a0550e7a-7137-11e6-8871-bed395d43cc5
Notice the "extract success: false" line.
from ionic-cloud-angular.
That is excellent news!
👍
from ionic-cloud-angular.
@ibcooley and @joshgarwood we just released a new version of ionic-cloud-angular
which addresses the issue (0.4.0
).
We've changed the download
and extract
promises to simply resolve on success and reject on failure, rather than resolving with a boolean, so your code may change slightly as a result.
Let us know if you still have any issues!
from ionic-cloud-angular.
@Fuiste, you guys are quick! thanks! We should be able to test this soon and let you know if it doesn't work, as expected.
edit: this seems to address one of the issues we were seeing! Will keep you updated on additional problems we may run into.
from ionic-cloud-angular.
Related Issues (20)
- Using with Ionic-Super-Starter HOT 6
- platform.toLowerCase is not a function HOT 5
- Deploy.load fails silently HOT 1
- Version 0.10.0 - Object prototype may only be an Object or null: undefined HOT 5
- access_token for linkedIn in undefined all the time
- rollup failed: Unexpected token HOT 2
- Build failure in iOS using ionic Packge HOT 42
- Doesnt work with Angular 4.0.0-rc.2 aot build HOT 10
- Able to use WKWebView 3.0? HOT 1
- Clearing notifications opens up Ionic app HOT 1
- I think ionic 2 is a nightmare, don't use it HOT 4
- Push imports complete RxJS library HOT 1
- CocoaPods was not found - [phonegap-plugin-push] HOT 1
- How to use this in browser ?
- not compatible with ionic3
- Ionic Deploy Error
- unable to install plugin in new ionic 3 project HOT 3
- cant build PROD HOT 2
- iOS app is crashing due to NSInvalidArgumentException in deploy plugin HOT 1
- OpaqueToken deprecated in Angular 5
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 ionic-cloud-angular.