Skip to content

Commit

Permalink
Merge pull request #33 from line/fix-stp-call
Browse files Browse the repository at this point in the history
Fix bugs related to ShareTargetPicker
  • Loading branch information
kazuma0129 authored Aug 16, 2024
2 parents 6674c5f + 3cb17d2 commit 6365d1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function App() {
pulldownOptions={SHARE_TARGET_PICKER_FIXED_ARGUMENT_LIST}
skipAutoRun={true}
runner={async (options) => {
return await liff.shareTargetPicker(JSON.parse(options))
return await liff.shareTargetPicker([JSON.parse(options)])
}}
loginRequired={true}
/>
Expand Down
11 changes: 6 additions & 5 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const base = new URL(location.href).origin;
export const SHARE_TARGET_PICKER_FIXED_ARGUMENT_LIST = [
{
label: 'text',
Expand All @@ -18,24 +19,24 @@ export const SHARE_TARGET_PICKER_FIXED_ARGUMENT_LIST = [
label: 'image',
value: {
type: 'image',
originalContentUrl: `${location.href}assets/stp_image.png`,
previewImageUrl: `${location.href}assets/stp_image.png`,
originalContentUrl: `${base}/assets/stp_image.png`,
previewImageUrl: `${base}/assets/stp_image.png`,
},
},
{
label: 'video',
value: {
type: 'video',
originalContentUrl: `${location.href}assets/stp_video.mp4`,
previewImageUrl: `${location.href}assets/stp_video.mp4`,
originalContentUrl: `${base}/assets/stp_video.mp4`,
previewImageUrl: `${base}/assets/stp_video.mp4`,
trackingId: 'track-id',
},
},
{
label: 'audio',
value: {
type: 'audio',
originalContentUrl: `${location.href}assets/stp_audio.mp3`,
originalContentUrl: `${base}/assets/stp_audio.mp3`,
duration: 60000,
},
},
Expand Down

1 comment on commit 6365d1a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.