stefanobartoletti / nuxt-social-share

Simple Social Sharing for Nuxt 3
https://stefanobartoletti.github.io/nuxt-social-share/
MIT License
106 stars 8 forks source link

Share to Facebook not working #175

Closed junogueira closed 3 weeks ago

junogueira commented 1 month ago

Sharing to Facebook is not working, even on https://stefanobartoletti.github.io/nuxt-social-share.

Maybe they changed the URL for sharing? Didn't find anything on their docs yet.

stefanobartoletti commented 1 month ago

I cannot reproduce this, especially not by pinpointing the issue to facebook.

I checked the demo at https://stefanobartoletti.github.io/nuxt-social-share/ and it actually is not using the correct URL, it is trying to share links with localhost. So in example the share URL is something like https://www.facebook.com/sharer/sharer.php?u=http://localhost/nuxt-social-share but for ALL networks, not just Facebook. This is creating some errors in some networks, but it is not a Facebook issue per se.

I will try to have a look and see what's going on there, probably some misconfiguration with obtaining the correct url.

Anyway, you can see a "real world" live example here https://nuxt-storyblok-starter.netlify.app/blog/article-8/ (scroll down to the end of the article), I tested and the share buttons are all working as expected, both on desktop and on mobile.

It would be helpful if you can provide more details about your specific implementation, with a minimal reproducible demo, and the environment where this issue is happening to you (OS, Browser, etc.)

pauladiniz commented 1 month ago

Hi @stefanobartoletti, I'm going through the same.

I tried testing with the live example you provided and couldn't share as well:

https://github.com/stefanobartoletti/nuxt-social-share/assets/19434356/81b2c1b3-d16d-469c-a6c4-bfcb8c774a72

My project:

https://github.com/stefanobartoletti/nuxt-social-share/assets/19434356/ed1e8f00-7cd0-4378-bf12-b4129b3ac78f

My implementation, pretty simple:

Screenshot 2024-05-29 at 10 45 33

My current environment OS: macOS Sonoma 14.5 Browser: Chrome

Thank you so much :)

stefanobartoletti commented 1 month ago

I'm not sure what is happening here, I can see from your screens that you are always having a "localhost" shared, even on https://nuxt-storyblok-starter.netlify.app/blog/article-8/, where it should use instead the correct URL.

About your own example, I see that you are using it on your own local development server on localhost:3000, so of course you are not able to share it on any social, because your local environment is not accessible to the web.

You should try to publish it online on some hosting platform and see if this still happens on your own implementation, and maybe share the details of the server (hosting platform, specific configuration, and so on)

Anyway, for what I can see, this seems to be related to how the current URL is retrieved internally, but at the moment I cannot give a solution, this has to be investigated further.

stefanobartoletti commented 1 month ago

I opened a more generic issue here #177 , if you want to follow.

junogueira commented 1 month ago

Thanks for checking the issue, Stefano.

stefanobartoletti commented 3 weeks ago

Closing this and continuing in the more generic #177