EddyVerbruggen / SocialSharing-PhoneGap-Plugin

👨‍❤️‍💋‍👨 Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget
MIT License
1.78k stars 910 forks source link

shareViaWhatsApp(null, image.URI) open a modal with other apps and not open WhatsApp directly (iOS) #953

Open Juliocbr opened 6 years ago

Juliocbr commented 6 years ago

shareViaWhatsApp function doesn't open whatsapp directly with image parameter (this only happens with ios, in android works well), opens a modal with other apps to share, if I share only a message, plugin opens whatsapp directly in ios.

code

this.screenshot.URI(80).then(image =>{
                    this.socialSharing.shareViaWhatsApp(null, image.URI, null).then((response) => {
                      // Success!
                    }, error =>{
                      console.error('Whatsapp not installed');
                      this.toast.show(messageNotAppInstalled, '5000', 'center').subscribe(
                        toast => {}
                      );
                    }).catch((errorCatch) => {console.error(JSON.stringify(errorCatch));});
                  });

plugin version

cordova-plugin-x-socialsharing: 5.4.0

ios version

11.3.1

ionic info

ionic (Ionic CLI) : 3.20.0 cordova (Cordova CLI) : 7.1.0 cordova ios 4.5.4

ahmadlinus commented 6 years ago

Hi, I have the same problem too. That's annoying. Although I am sending a text... I don't get anything.

danziv commented 6 years ago

Having the same issue. this.socialSharing.shareViaWhatsApp(null, base64, null) shows the iOS native share panel - and doesnt invoke WhatsApp sharing. When selecting "WhatsApp" sharing from the native panel - the image is displayed just fine.

When testing URL sharing, it works fine: this.socialSharing.shareViaWhatsApp(null, null, 'http://somewhere.com')

plugin version

cordova-plugin-x-socialsharing: 5.4.0

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0
JrSagas commented 6 years ago

Hi, I have the same problem. Does Anyone have a solution?

joaofolle commented 5 years ago

the image need file:// in my case.

Solangetatiana commented 5 years ago

I'm trying sharing data uri (PDF) with Social Sharing in Ionic 4... (using cordova-plugin-x-socialsharing and ionic-native/social-sharing ).

Bellow my installs:

ionic cordova plugin add cordova-plugin-x-socialsharing 
npm install @ionic-native/social-sharing
ionic cordova platform add browser 
ionic cordova platform add ios 
ionic cordova platform add android 

I've tried also

ionic cordova run browse
ionic cordova run android
ionic cordova run ios

instead of "ionic serve"

And I've had a lot of errors like "Cordova_not_avaliable" ( even in IOS device )... or "Error: exec proxy not found for :: SocialSharing :: shareViaWhatsApp"...

What could be wrong at my plugins instalations...? It seems the code is Ok (bellow needed change the real data uri string, but too long to put here as a question), follow the function shareViaWhatsApp:

shareViaWhatsApp() {
    // Image or URL works
    this.socialSharing.shareViaWhatsApp(null, "data:application/pdf;df:myOwnName.pdf;base64,JVEERi0.....etc etc etc",  '').then(() => {
    }).catch((e) => {
      alert(JSON.stringify(e));
    });
  }
cikcoh commented 5 years ago

Hi, has anyone figure out how to solve this issue?