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 905 forks source link

IOS trouble on sharing to Facebook and Instagram. #1216

Open FranGhe opened 2 months ago

FranGhe commented 2 months ago

I'm developing for Android and IOS App and I'd like to share contents. On android all work fine but I have trouble on IOS. Reading instructions I have updated my config.xml like this:

<platform name="ios">
  <edit-config file="*-Info.plist" mode="merge" target="LSApplicationQueriesSchemes">
      <array>
          <string>fb</string>
          <string>facebook</string>
          <string>facebook-stories</string>
          <string>mailto</string>
          <string>twitter</string>
          <string>instagram-stories</string>
          <string>instagram</string>
          <string>whatsapp</string>
      </array>
  </edit-config>
</platform>

I'm tring to share some text and an image by Facebook, Instagram and Twitter About Twitter: it work fine, it open the Twitter App and share text and image About Instagram: I use this code:

  window.plugins.socialsharing.canShareVia(
          'instagram', 
          'some text', 
          'subj', 
          ['https://www.google.nl/images/srpr/logo4w.png'], 
          null, 
          function(result) {
              alert('yep');
              window.plugins.socialsharing.shareViaInstagram(
                    'some text', 
                    ['https://www.google.nl/images/srpr/logo4w.png'],  
                    function(result) {alert('done')}, 
                    function(errormsg){alert(errormsg)}
                );
           }, 
          function(errormsg){alert(errormsg)}
  );

I have the first alert ('yep') but than the application doesn't open the Instagram App.... It open a dialog with all application that I can use to share contents. On xcode log I have an error like this:

error fetching file provider domain for URL:file:///private/var/mobile/Containers/Data/Application/AA0DF3F3-B0D5-4CC2-804F-B4D315FD2A34/tmp/instagram.igo : (null)

Collaboration: error loading metadata for documentURL:file:///private/var/mobile/Containers/Data/Application/AA0DF3F3-B0D5-4CC2-804F-B4D315FD2A34/tmp/instagram.igo error:Error Domain=NSFileProviderInternalErrorDomain Code=0 "No valid file provider found from URL file:///private/var/mobile/Containers/Data/Application/AA0DF3F3-B0D5-4CC2-804F-B4D315FD2A34/tmp/instagram.igo." UserInfo={NSLocalizedDescription=No valid file provider found from URL file:///private/var/mobile/Containers/Data/Application/AA0DF3F3-B0D5-4CC2-804F-B4D315FD2A34/tmp/instagram.igo.}

Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}

elapsedCPUTimeForFrontBoard couldn't generate a task port

Error: BSLogAddStateCaptureBlockWithTitle(FBScene - com.apple.sharinguiservice:scene::SharingUI::CF7FE1592216) state data format error: <NSError: 0x282efb810; domain: BSSharedStateCapturing; code: 1; "Input generated no data"> {
    NSUnderlyingError = <__NSCFError: 0x282efb150; domain: NSCocoaErrorDomain; code: 3851> {
        NSDebugDescription = Property list invalid for format: 200 (property lists cannot contain NULL);
    };
}

connection invalidated

About Facebook: You can't share links (www.example.it) as text in message... image disappear

  window.plugins.socialsharing.shareViaFacebookWithPasteMessageHint(
     "Search us on www.example.it", 
      'https://www.google.nl/images/srpr/logo4w.png',
      null,
     "Message copied! Paste it dude!", 
      function(result) {}, 
      function(errorMsg) {}
  );
asg1997 commented 1 week ago

Same here