while using file plugin with ionic-native found out that readAsArrayBuffer(path, file) promise never resolves!
i did some digging and turns out it's an fixed angular 2 zone issue and here is a detailed closed ionic issue about it. https://github.com/driftyco/ionic/issues/6020
it looks like it's never been fixed for ionic 2
file promises to be resolved
Steps to reproduce:
Camera.getPicture(options).then((imageData) => {
File.readAsArrayBuffer(imageData).then((res)=>{
//never resolves.
});
});
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
https://github.com/angular/zone.js/issues/137
https://github.com/angular/angular/issues/2533
Which Ionic Version? 1.x or 2.x
Cordova CLI: 6.0.0
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
OS: Windows 8.1
Node Version: v4.4.3
This issue was moved to driftyco/ionic-native#505
Hello! Thanks for opening an issue with us! Since this was an issue with Ionic Native and not the Ionic framework I have moved this issue to that repo. Thanks for using Ionic!
I agree , Its not fixed .
var reader = new FileReader();
reader.onloadend = (evt: any) => { }
onloaded never gets fired
@jgw96 it seems a fix is found for this one in https://github.com/driftyco/ionic-native/issues/505#issuecomment-273504996
cordova.js must be loaded after polyfills.js in index.html
It will be best if this can be done in the Ionic starter projects, so it doesn't happen to other users, as it's very hard to debug and identify.
Thanks!
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
@jgw96 it seems a fix is found for this one in https://github.com/driftyco/ionic-native/issues/505#issuecomment-273504996
cordova.jsmust be loaded afterpolyfills.jsin index.htmlIt will be best if this can be done in the Ionic starter projects, so it doesn't happen to other users, as it's very hard to debug and identify.
Thanks!