0

I'm using @awesome-cordova-plugins/instagram for sharing images from my ionic6 application to instagram. On android works, but on ios pops out a modal with error message.

I tired also with @awesome-cordova-plugins/social-sharing/ngx, again with android devices works but not with IOS devices. I have installed instagram in my device and already logged in.

I also added LSApplicationQueriesSchemes to the Info.plist

This is what I tried: component.ts

import {Instagram} from '@awesome-cordova-plugins/instagram';

  async sendInstagram(base64Img) {
    console.log({base64Img});
    Instagram.isInstalled().then(async (res) => {
      console.log({res});
      if(res){
        await Instagram.share(base64Img).then(res => {
          console.log(res);
        })
        .catch(res => {
          console.log({res});
        })
      }
    })
}

getBase64Img() {
  let base45data;
  this.http.get('assets/images/yellow-trophy.jpg', { responseType: 'blob' })
  .subscribe( res => {
    const reader = new FileReader();
    reader.onloadend = () => {
      base45data = reader.result;
      console.log({base45data});
      this.sendInstagram(base45data);
    }
    reader.readAsDataURL(res);
  });
}

0 Answers0