Skip to content

Instantly share code, notes, and snippets.

@kkdai
Created March 27, 2020 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkdai/4cff8319dfe38c432092e78a8acb1e9d to your computer and use it in GitHub Desktop.
Save kkdai/4cff8319dfe38c432092e78a8acb1e9d to your computer and use it in GitHub Desktop.
if (liff.isApiAvailable('shareTargetPicker')) {
liff.shareTargetPicker([{
type: "text",
text: message
}])
.then(
//alert("ShareTargetPicker was launched")
).catch(function(res) {
//alert("Failed to launch ShareTargetPicker")
})
}
else {
alert("你的 LINE App 暫時不支援 Share Target Picker ,將開始外部瀏覽器。")
liff.openWindow({
url: "{{.LIFFRedirectURL}}",
external: true
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment