PolarCape / polarcape-cordova-plugin-document-handler

Polar Cape Cordova Plugin Document Handler
MIT License
10 stars 19 forks source link

DocumentHandler.saveAndPreviewBase64File does not work #10

Closed TejendraGarge closed 7 years ago

TejendraGarge commented 7 years ago

I tried using the method DocumentHandler.saveAndPreviewBase64File(), it does not work.

it gives error "ReferenceError: Promise is not defined"

Can some one look into it!

dorritydj commented 7 years ago

Copying from here so this team is aware.

I actually came across this issue and worked to find the root cause. Android 7 no longer accepts the file:// schema as the "data" for Intents, and now requires content:// instead. The code needs to be updated to use FileProvider instead, specifically, this line. In the meantime, a quick fix is to set the android:minSdkVersion="23" since this fails past 24. If someone on the plugin team could update with when this can be fixed, that would be great.

http://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed?noredirect=1&lq=1

TejendraGarge commented 7 years ago

Even if it works, we cannot set the android:minSdkVersion="23" as some of the users are having Lollipop and KitKat in their device, so we need to cover those flavours as well. Can you update the plugin to accomodate all the Android flavours right from Kitkat to latest Nougat.

I tried using saveAndPreviewBase64File() on KitKat (4.4.2), it does not work - gives error "Promise is not defined" .

vkajtazov commented 7 years ago

This issue is covered by #9

TejendraGarge commented 7 years ago

Dear vkajtazov. Method saveAndPreviewBase64File() is not working for KitKat (4.4.2).

it gives error "ReferenceError: Promise is not defined"

Can some one look into it!