Skip to main content

Share Links and Deep Linking

buildfire.deeplink#

Provide a way to reference a plugin inside the application and navigate the user directly to that plugin with specific data that allow the plugin developers to change the plugin view or behavior depending on this data ( example: showing a video).

Methods#

generateUrl()
#

buildfire.deeplink.generateUrl(options, callback)

This function helps the developers to generate a shortened URL which points to the original URL which has been provided with meta tags that control how URLs are displayed when shared on social media (Facebook, Whatsup, Slack...etc)

buildfire.deeplink.generateUrl(
{
data: { videoId: "9Q-4sZF0_CE" },
},
(err, result) => {
if (err) {
console.error(err);
} else {
console.log(result.url);
}
}
);

options#

NameTypeRequiredDescriptionDefault
titlestringnoShare link titleName of the app
keywordsstringnoKeywords of the share linkName, description of the app
imageUrlstringnoThe image of the share linkApp icon
descriptionstringnoThe description of share linkApp description
dataobjectnoThe deep link data that developers need to provide to the plugin once the user opened the share link. For more information on how to reed this data from plugin, see buildfrire.deeplink.getData
extraMetaTags[object]noExtra graph meta tags, please check the following link for extra meta tags: https://ogp.me/#optional

callback(err, result)#

Function will be invoked after the link has been generated and return back the generated URL.

NameTypeDescription
errstringerror string, null when operation is successfull
resultobjectObject containting generated deep link url ex. { url : "DEEP_LINK_URL"}

More Examples#

let link = {};
link.title = "share link title";
link.description = "This is an example of buildfire share link";
link.imageUrl = "HTTP://buildfire.com/exampleImage.png";
link.extraMetaTags = [
{ property: "og:site_name", content: "YouTube" },
{
property: "og:video:url",
content: "https://www.youtube.com/embed/9Q-4sZF0_CE",
},
];
link.data = {
videoId: "9Q-4sZF0_CE",
};
buildfire.deeplink.generateUrl(link, (err, result) => {
if (err) {
console.error(err);
} else {
console.log(result.url);
}
});