I have a problem with the Instagram plugin and the base64 Plugin from Cordova.
What I am trying is: I want to share an Image via Instagram (prefereably Story).
I have the absolute path like this: '/assets/images/storyTemplates/diary.png'
And now, the documentation says, all I have to do is something like this:
this.base64.encodeFile(path).then((base64File: string) => {
console.log('nativepath: ' + path);
console.log('base64: ' + base64File);
if (this.instagram.isInstalled()) {
this.instagram.share('data:image/png;base64,file://' + base64File, 'caption').then(data => {
if (data) {
console.log(data);
}
});
}
});
but the console.log(base64File) is empty... Error outputs:
nativepath: /assets/images/storyTemplates/diary.png
base64:
copying caption: caption
vendor.js:45196 ERROR Error: Uncaught (in promise): Share Cancelled
at resolvePromise (polyfills.js:4086)
at resolvePromise (polyfills.js:4043)
at polyfills.js:4147
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.js:3657)
at Object.onInvokeTask (vendor.js:64580)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.js:3656)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (polyfills.js:3429)
at drainMicroTaskQueue (polyfills.js:3835)
Do I have to import some XML in the config file? or in the AndroidManifest?
I am really helpless right now :D
Thanks in advance!