Facebook Sharing on Android - no URL or Image (or Message) #253

Closed
rajatrocks opened this Issue Nov 30, 2014 · 10 comments

Projects

None yet

2 participants

@rajatrocks

On Android 4.4 I've tried sharing to Facebook via .share, .shareViaFacebook, and . shareViaFacebookWithPasteMessageHint - with no image and a url. My url never gets added. Maybe this has something to do with the splitting out of Messenger functionality?

On iOS this works fine.

@EddyVerbruggen
Owner

Hi, that URL should be picked up by Android to show a little preview of that webpage. Which URL are you trying to share? Perhaps my code thinks it's malformed...

@rajatrocks

You're right! My domain is one of the new TLD's - .fail - so my URL looks like http://www.cannot.fail?id=something. That fails to attach properly to the Facebook post on Android. Using a .com instead works fine. Any chance that can be changed to accept other TLDs? Thanks!

@EddyVerbruggen
Owner

Haha, cool domain ;)

Are you able to use the .fail domain in a regular Facebook post? I guess so, because iOS works..

Or is it perhaps a whitelisting issue in your config.xml?

@rajatrocks

Yes, I can use it with no problems using Facebook's normal feed dialog (https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.2) and the iOS version of the social sharing plugin.

My config.xml currently has access origin="*". Is there something else I should look at?

Thanks!

@EddyVerbruggen
Owner

Hmm, strange. I just tried this myself and it works on my Samsung Galaxy S3 (Android 4.3). Can you give it a try?

<button onclick="window.plugins.socialsharing.shareViaFacebook('hi', ['http://www.icu.fail/public/style_images/tctc91_simplify/feed.png'], null, function(msg) {alert(msg)}, function(err) {alert(err)})">img via Facebook</button>
@rajatrocks

Hi Eddy - sorry if my original post wasn't clear - I'm trying to share a URL, not an image.

.share("Hello there", "Test Subject", null, "http://www.cannot.fail?id=something")

@EddyVerbruggen
Owner

Ehm oops you're right - I'll take a look tomorrow!
Knowing the exact url may help me. If it's sensitive feel free to PM me.

@rajatrocks

Thanks! Sent it to you in email.

@EddyVerbruggen
Owner

Hi, I've tested this URL and every time I try to share it to facebook, the log spits out a stacktrace of the Facebook app. It can't resolve a specific class it seems to need to share this url.

I tried a workaround: use a link shortener, which actually tricks it into sharing the damn thing. It may not produce a nice preview and shows the shortened url, but it does share your original link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment