Skip to content

Instantly share code, notes, and snippets.

@novaknole
Created November 6, 2020 14:22
Show Gist options
  • Save novaknole/332e27308687d6ec66eea6d06b78a272 to your computer and use it in GitHub Desktop.
Save novaknole/332e27308687d6ec66eea6d06b78a272 to your computer and use it in GitHub Desktop.
FB.init({
appId: process.env.FACEBOOK_ID,
version: "v3.3",
status: true,
cookie: true
});
let share = {
method: "feed",
link:
process.env.NODE_ENV === "development"
? "https://github.com"
: process.env.WEBSITE_URI
};
FB.ui(share, async response => {
if (typeof response == "undefined") {
ShowNotificationMessage("Ah. We couldn't detect that you shared this on social media. Sorry for that.", 'error', 3000)
return;
}
console.log("shared has just happened");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment