Skip to content

Instantly share code, notes, and snippets.

@jirawatee
Last active June 27, 2020 10:25
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 jirawatee/534e79c704cdf9413bb529d72efa2a35 to your computer and use it in GitHub Desktop.
Save jirawatee/534e79c704cdf9413bb529d72efa2a35 to your computer and use it in GitHub Desktop.
Share Target Picker
<script>
function shareMsg(i, thumbUrl) {
// Ensure before calling shareTargetPicker()
if (confirm(`Share photo ${i}?`)) {
// Get original image from Image Resizes of Firebase Extentions
const origitalUrl = thumbUrl.replace('%2Fthumbs', '').replace('_200x200', '')
// Call Share Target Picker feature
liff.shareTargetPicker([
{
type: 'image',
previewImageUrl: thumbUrl,
originalContentUrl: origitalUrl
}
])
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment