Widget & Iframe
WidgetEmbed LikeCoin button using <iframe>
LikeCoin button is available as either an embedded page which can be used in an iframe
, or a widget which can be used as a clickable link or popup.
Instructions
Construct an URL according to the following format:
Iframe base URL:
https://button.like.co/in/embed/{{LikerID}}/button?iscn_id={{iscn_id}}&referrer={{referrer}}&type={{type}}
Widget base URL:
https://button.like.co/in/like/{{LikerID}}?iscn_id={{iscn_id}}&referrer={{referrer}}&type={{type}}
Parameter | Type | Required? | Description |
|
| required if using | The LikerID of the content author. Set to |
|
| either | The ISCN ID of the content, overrides |
|
| either | The source (canonical) URL of the content in |
|
| optional |
|
|
| optional | Set to |
For testing purpose, you may use
button.rinkeby.like.co
instead ofbutton.like.co
Example links:
In case of iframe sandbox,
allow-scripts
,allow-same-origin
,allow-popups
allow-popups-to-escape-sandbox
,allow-top-navigation-by-user-activation
,allow-storage-access-by-user-activation
are needed for proper register/login functionality.
Extra feature for embedded Iframe
CSS Style
Embed the sample HTML and replace {{ src }} with the embed URL into your HTML, include the CSS code for recommended display style.
Update referrer via postMessage
The LikeCoin button <iframe>
's src (especially the referrer
param) should be updated to when the URL is changed. In case updating <iframe>
's src is not possible (e.g. for some SPA usecases), you may call postMessage()
to the <iframe>
with following payload to update the referrer
.
Sample Repository
https://github.com/likecoin/LikeCoinButton-integration
Integration Examples
https://medium.com/likecoin/likecoin-button-%E6%95%B4%E5%90%88%E6%96%B9%E6%B3%95%E5%92%8C%E7%A4%BA%E7%AF%84-579045858eae (Chinese article)
Last updated