j3k0 / cordova-plugin-openwith

Get your Cordova App in the O.S. "Share" menu on iOS and Android
MIT License
138 stars 114 forks source link

Share URL, decode the base64 and the result is badly encoded data that cannot be read #117

Open j-d-carmichael opened 3 years ago

j-d-carmichael commented 3 years ago

From the example, in the repo this is the extraction:

 openwith.load(intent.items[0], function (data, item) {
  console.log( atob(data))
});

I cannot see how to extract the data... the above log just outputs a string of unreadable content.

The item after load looks like this:

base64: "/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQ"
type: "application/octet-stream"
uri: "content://com.android.chrome.FileProvider/BlockedFile_319287714984242"

content://com.android.chrome.FileProvider/BlockedFile_319287714984242

I am completely new to android development so I can only assume that I have a wrong config? Should the URI be "BlockedFile"?

related: https://github.com/j3k0/cordova-plugin-openwith/issues/102