Skip to content

Commit

Permalink
Merge pull request #43 from line/restrict-send-messages
Browse files Browse the repository at this point in the history
Display liff.sendMessages() only in LIFF mode
  • Loading branch information
kazuma0129 authored Feb 3, 2025
2 parents 6ffcec2 + 6720681 commit 6c626d5
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,28 +185,30 @@ function App() {
return liff.permanentLink.createUrl()
}}
/>
<Snippet
apiName="liff.sendMessages"
version="1.0"
docUrl="https://developers.line.biz/en/reference/liff/#send-messages"
needRequestPayload={true}
hideResponse={true}
defaultRequestPayload={JSON.stringify(
[
{
type: 'text',
text: 'Hello, World!',
},
],
null,
4
)}
skipAutoRun={true}
runner={async (messages) => {
return await liff.sendMessages(JSON.parse(messages))
}}
inClientOnly={true}
/>
{filter === FilterTypes.LIFF && (
<Snippet
apiName="liff.sendMessages"
version="1.0"
docUrl="https://developers.line.biz/en/reference/liff/#send-messages"
needRequestPayload={true}
hideResponse={true}
defaultRequestPayload={JSON.stringify(
[
{
type: 'text',
text: 'Hello, World!',
},
],
null,
4
)}
skipAutoRun={true}
runner={async (messages) => {
return await liff.sendMessages(JSON.parse(messages))
}}
inClientOnly={true}
/>
)}
<Snippet
apiName="liff.openWindow"
version="1.0"
Expand Down

1 comment on commit 6c626d5

@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.