cyph / cordova-plugin-chooser

Cordova file chooser plugin.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Promise never resolve/reject with Ionic-native

wideLandscape opened this issue · comments

Maybe this bug doesn't directly relate to the plugin, but it might be interesting for who is using it with ionic-native. Feel free to close/remove the issue

Using ionic-native ( https://ionicframework.com/docs/native/chooser/ ) the promise never resolve nor reject.
I thought it was an Angular/Cordova event conflict ( http://weblogs.thinktecture.com/thomas/2017/02/cordova-vs-zonejs-or-why-is-angulars-document-event-listener-not-in-a-zone.html ) but it didn't work either.

I've forked this project and implemented www/chooser.js with callbacks instead of promise and it works.
( https://github.com/wideLandscape/cordova-plugin-chooser ).
Replace \node_modules@ionic-native\chooser\index.d.ts with the index.d.ts file in the root folder of the repo.

Tested on real device Huawei Mate 10 lite, EMUI: 5.1, Android: 7.0
If someone could test it on iOS that would be great.

Environment info:
Ionic:
ionic (Ionic CLI) : 4.2.0
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0

System:
Android SDK Tools : 26.1.1
NodeJS : v8.11.4
npm : 6.4.1
OS : Windows 10

Issue on ionic native repo:
#2768

Closing this for now pending investigation of the Ionic issue.