1

My images are stored in firebase storage. I have noticed that if I store the image in a folder, I am no longer able to use it with the SocialSharing plugin from ionic native.

Anyone has found any workaround on this?

whatsappShare() {

        let image = "https://firebasestorage.googleapis.com/v0/b/instagram-test-fe4a8.appspot.com/o/000.jpg?alt=media&token=64dd92cd-27c2-4c36-9c1d-2ab376ffd16c"  //This is working
        //let image = "https://firebasestorage.googleapis.com/v0/b/instagram-test-fe4a8.appspot.com/o/test%2F000.jpg?alt=media&token=2bc49648-cf1c-41fe-8e1f-071d54f56402"  //This is failing because stored in test/ folder

        //shareViaWhatsApp(message, image, url) 
        SocialSharing.shareViaWhatsApp("Checkout this picture!", image, "lycos.com/")
            .then( () => {
                    alert("WhatsApp Success");
                }, () => {
                    alert("WhatsApp failed")
                })
    }

I have found this github which seems related https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/696

It means the plugin can work in iOS and fail in android? Any possible solution to this?

Dee
  • 909
  • 3
  • 10
  • 18
  • It's been about 3 hours looking for an answer. Seems an old (5-6 months) issue. I haven't been able to find anything. Thanks anyway for proposing that 'no folder' solution. – Becario Senior Apr 02 '17 at 22:23

1 Answers1

1

Yes. Finally I got a way to share images from Firebase Storage to any service. Just follow these two conditions:

  1. Convert the image from the uri to a base64 string. You can find plenti of examples of that conversion out there.
  2. Send the image data using shareWithOptions(). Other methods seem not to work with image data encoded that way.

I'm interested in any other updates regarding this issue. Hope that helps anyone.

Becario Senior
  • 704
  • 10
  • 18