Copy the URL and share it via Email, Twitter, Facebook and others.
PRE-REQUISITES
For the following snippets to work as intended you will need to add fliplet-communicate library to your app. Use the following instructions to add it:
- When in Fliplet Studio’s Edit screen, open the Developer Options from the right hand menu
- With the Developer Options open, click the Libraries button in the top right corner
- In the search field, type in ‘fliplet-communicate’
- Click it to add it to the list
- Click Save
Share URL on web
Share URL on mobile
To help users share a website URL with other people, you can offer them shortcuts to do this. For example you can give the user options to copy the URL or share it via Twitter, Facebook or WhatsApp (if they have the app).
To pop open the URL sharing menu, run the code below (in this example we’re sharing a link to a Google map).
JavaScript
// A simple way to share a URL
Fliplet.Communicate.shareURL('https://maps.google.com/?addr=EC2A+4DN');
On desktop browsers it’s also possible to share the URL with a message for the recipient. You can do this with the following code:
JavaScript
// Add an optional message for apps that support the sharing a URL with a message
Fliplet.Communicate.shareURL({
url: 'https://maps.google.com/?addr=EC2A+4DN',
message: 'Drop by and say hi!'
});