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

Issue posting to Facebook #827

Open c0m3tx opened 7 years ago

c0m3tx commented 7 years ago

Hi, we implemented a simple title + message + link sharing system in a ionic v1 app using this library.

On Android it works perfectly, on iOS it works but only when not sharing with Facebook. XCode shows this error (we are testing using an iPad mini running iOS 9):

2017-05-09 16:24:21.035 APP[275:19111] plugin com.apple.share.Facebook.post interrupted
2017-05-09 16:24:21.040 APP[275:19111] Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.facebook.Facebook.ShareExtension" UserInfo={NSDebugDescription=connection to service named com.facebook.Facebook.ShareExtension}
2017-05-09 16:24:26.290 APP[275:18149] Share completed? false
2017-05-09 16:24:26.290 APP[275:18149] Shared to app: com.apple.UIKit.activity.PostToFacebook

The application UI hangs for a couple of seconds then resumes normal functionality (but no share happens, of course). The code used for sharing is:

var options = {
    message: scope.news.content,
    subject: scope.news.title,
    url: scope.news.link
};

var shareCallbacks = { 
    success: function(result) {
         console.log("Share completed? " + result.completed);
         console.log("Shared to app: " + result.app);
     },
     error: function(msg) {
          console.log("Sharing failed with message: " + msg);
     }
};

if(window.plugins && window.plugins.socialsharing) {
    window.plugins.socialsharing.shareWithOptions(options, shareCallbacks.success, shareCallbacks.error);
} else {
    console.error('Sharing is not supported on this platform');
}

Any idea?

Edit: also tested on an iPhone 6 Plus (iOS 10) and it works. Is there any issue known with iPads or iOS 9 version?

alexandre-g commented 6 years ago

also facing this issue on native app on iPad mini 1 / iOS 9

jpanettiere commented 6 years ago

Has anyone found a solution to this problem? I'm facing the same concern.