kytta / shareon

📯 Lightweight, stylish, and ethical share buttons for popular social networks
https://shareon.js.org/
MIT License
465 stars 24 forks source link

LinkedIn share does not work in the apps #90

Closed sachin-arshna closed 11 months ago

sachin-arshna commented 1 year ago

I integrated shareon.js (https://giddysouls.com/category/mushroom-supplements/mushroom-supplements.html) which works great for most except the LinkedIn button just takes me to the home page at LinkedIn. I noticed the same behaviour on the LinkedIn shareon.js home page button.

Update: Share seems to work fine on the desktop - creates a post in Linkedin in a browser tab. My issue above was observed on an Android phone with a Linkedin app installed. In which case, it opens the app but the share isn't present. Share works fine with WhatsApp, Reddit apps installed on the same phone.

kytta commented 1 year ago

In browser, the share button for LinkedIn works only if you're already logged in to LinkedIn. When it comes to the phones, it's up to the app developer to include a share screen, and it seems like it doesn't :( I'll see if I can make this work, but don't expect much 😅

sachin-arshna commented 1 year ago

Thanks for looking into it.

kytta commented 11 months ago

So, no good news. I've had a look at the LinkedIn app, and here's what I've found:

The LinkedIn app has a screen for sharing stuff; it's the one that you can access if you click "Share" from any other app and choose LinkedIn. Sadly, this one cannot be opened in any other way. There are deep link filters in the app, but they only work with profile pages and posts.

As such, the only way to make the LinkedIn button work with the LinkedIn app is to use the catch-all share button:

<div class="shareon">
  <a class="web-share">
</div>

The web-share button will only be shown on devices that support it (smartphones, Safari on macOS, and Microsoft Edge on Windows)