PolarCape/polarcape-cordova-plugin-document-handler

DocumentHandler.saveAndPreviewBase64File does not work

Closed this issue · 4 comments

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!

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

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" .

This issue is covered by #9

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!