Share on LINE with custom URL

[Social Share] How to add Share on LINE button

Woratana Perth
Dec 14, 2016 · 2 min read

LINE is not only the top messaging app in Thailand, LINE users also share interesting links to each other just like Facebook. Web developers have to find a way to let them share links on the website easily.

LINE have prepared LINE it! button for websites. However, the button design is fixed with 5 pre-designed buttons as shown below.

Share LINE design buttons
Share LINE design buttons
LINE It! Share Buttons

Just like Facebook and Twitter native share buttons, these buttons loaded heavy resources (JavaScript, iFrame), thus slowing down your website especially for mobile users.

As I have discussed the solution for Facebook, Twitter, Google Plus Share buttons before, sharing on LINE can be done with the similar method.

Unfortunately, LINE does not provide us with web URL, but we can use the following target URL on link:

<a href="line://msg/text/<?php echo $post_permalink_encode; ?>" target="_blank">Share on LINE</a>

This will open LINE on mobile (iOS, Android) and the users can select a person, group, or his/her own timeline to share the link.

Let me know in the comment if you have the better way for LINE sharing buttons :)

Originally published at Woratana Perth.

Woratana Perth

Written by

Data Analyst at Servian | Monash Data Science Alumni | Front-end Developer based in Melbourne, Australia | LinkedIn: http://bit.ly/lkdn-perth