New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
8 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

This comment has been minimized.

Show comment
Hide comment
@EddyVerbruggen

EddyVerbruggen Nov 30, 2014

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...

Owner

EddyVerbruggen commented Nov 30, 2014

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

This comment has been minimized.

Show comment
Hide comment
@rajatrocks

rajatrocks Nov 30, 2014

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!

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

This comment has been minimized.

Show comment
Hide comment
@EddyVerbruggen

EddyVerbruggen Nov 30, 2014

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?

Owner

EddyVerbruggen commented Nov 30, 2014

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

This comment has been minimized.

Show comment
Hide comment
@rajatrocks

rajatrocks Nov 30, 2014

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!

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

This comment has been minimized.

Show comment
Hide comment
@EddyVerbruggen

EddyVerbruggen Nov 30, 2014

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>
Owner

EddyVerbruggen commented Nov 30, 2014

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

This comment has been minimized.

Show comment
Hide comment
@rajatrocks

rajatrocks Nov 30, 2014

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")

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

This comment has been minimized.

Show comment
Hide comment
@EddyVerbruggen

EddyVerbruggen Nov 30, 2014

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.

Owner

EddyVerbruggen commented Nov 30, 2014

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

This comment has been minimized.

Show comment
Hide comment
@rajatrocks

rajatrocks Nov 30, 2014

Thanks! Sent it to you in email.

Thanks! Sent it to you in email.

@EddyVerbruggen

This comment has been minimized.

Show comment
Hide comment
@EddyVerbruggen

EddyVerbruggen Dec 1, 2014

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.

Owner

EddyVerbruggen commented Dec 1, 2014

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.

@rajatrocks

This comment has been minimized.

Show comment
Hide comment
@replysam2009

This comment has been minimized.

Show comment
Hide comment
@replysam2009

replysam2009 Feb 12, 2017

@EddyVerbruggen Hi, I am using Social Sharing plugin in one of my Ionic2 projects. Earlier everything was working fine but from past 3 days I am not being able to share anything using different share functions (except for shareViaMail()). Whenever I try to share anything it says: "Attempt to invoke virtual method 'android.content.res.XmlResourceParserandroid.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference."
This happens only when I try to share image. If I share only message and Url, it works fine but if I try to share any image (by giving its url as a string), it throws an error.
Is there anything you can help me with?

replysam2009 commented Feb 12, 2017

@EddyVerbruggen Hi, I am using Social Sharing plugin in one of my Ionic2 projects. Earlier everything was working fine but from past 3 days I am not being able to share anything using different share functions (except for shareViaMail()). Whenever I try to share anything it says: "Attempt to invoke virtual method 'android.content.res.XmlResourceParserandroid.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference."
This happens only when I try to share image. If I share only message and Url, it works fine but if I try to share any image (by giving its url as a string), it throws an error.
Is there anything you can help me with?

@gianpaj

This comment has been minimized.

Show comment
Hide comment
@gianpaj

gianpaj Oct 4, 2017

Do we know why this happens only on Android? Is the Android Facebook or Messenger App doing something after a cordova/ionic sends the correct URL, but not on iOS?
Or can we update some native SDK/code inside this plugin, that could allow for this?

gianpaj commented Oct 4, 2017

Do we know why this happens only on Android? Is the Android Facebook or Messenger App doing something after a cordova/ionic sends the correct URL, but not on iOS?
Or can we update some native SDK/code inside this plugin, that could allow for this?

@marceviana

This comment has been minimized.

Show comment
Hide comment
@marceviana

marceviana Jan 9, 2018

I can´t share anything via facebook. The facebook app will crash before opening completely if I use window.plugins.socialsharing.shareViaFacebook


                    window.plugins.socialsharing.shareViaFacebook(null, [fileURL], null, 
                        function successShare(s) {
                            console.log('share ok')
                        }, function errorShare(errormsg){
                            console.log('Error in: shareViaFacebook >> msg:')
                            console.log(errormsg)
                        })

The only function currently working that won't make fb to crash is window.plugins.socialsharing.shareVia('facebook', null, [fileURL]) but then the sharing activity is shown but won't load the file. I've tried both with a local file (file:/...) and a web hosted one, and also video files. All the other apps work as expected (whatsapp, gmail, drive, etc) both with image and video. Any ideas what might be happening?

I'm using version 5.2.1 of the plugin for android:minSdkVersion="14" and android:targetSdkVersion="26"

I can´t share anything via facebook. The facebook app will crash before opening completely if I use window.plugins.socialsharing.shareViaFacebook


                    window.plugins.socialsharing.shareViaFacebook(null, [fileURL], null, 
                        function successShare(s) {
                            console.log('share ok')
                        }, function errorShare(errormsg){
                            console.log('Error in: shareViaFacebook >> msg:')
                            console.log(errormsg)
                        })

The only function currently working that won't make fb to crash is window.plugins.socialsharing.shareVia('facebook', null, [fileURL]) but then the sharing activity is shown but won't load the file. I've tried both with a local file (file:/...) and a web hosted one, and also video files. All the other apps work as expected (whatsapp, gmail, drive, etc) both with image and video. Any ideas what might be happening?

I'm using version 5.2.1 of the plugin for android:minSdkVersion="14" and android:targetSdkVersion="26"

@mfdeveloper

This comment has been minimized.

Show comment
Hide comment
@mfdeveloper

mfdeveloper Feb 28, 2018

@replysam2009 See my comment #774 (comment) into your issue about loadXmlMetada() error.

@replysam2009 See my comment #774 (comment) into your issue about loadXmlMetada() error.

@mattkenefick

This comment has been minimized.

Show comment
Hide comment
@mattkenefick

mattkenefick Apr 9, 2018

Any updates on this?

I can share an image on Android via Facebook, but the URL doesn't take.

Any updates on this?

I can share an image on Android via Facebook, but the URL doesn't take.

@kierangillen

This comment has been minimized.

Show comment
Hide comment
@kierangillen

kierangillen May 25, 2018

It seems that .edu also doesn't work?

It seems that .edu also doesn't work?

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