Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url button/emilie #39

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,14 @@ The `url` button is useful when sharing a link to a website. By default, it will
messenger_extensions: true

```

Enabling messenger_extensions allows your webview to access a selection of features from the Messenger platform. More info [here](https://developers.facebook.com/docs/messenger-platform/webview/extensions?source=post_page). Without this parameter set to true, the webview opens in a separate tab or window if a user is visiting from the 'messenger.com' domain.

You can also specify the height of the webview window that opens up in Messenger via: `webview_height`. You can choose between `compact`, `tall`, and `full`.

More info [here](https://developers.facebook.com/docs/messenger-platform/webview).

You can also disable the default share button of the webview window (for sensitive info) by setting the `webview_share_button` property to `hide`.


#### call

Expand Down
9 changes: 9 additions & 0 deletions lib/stealth/services/facebook/reply_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def generate_buttons(buttons:)
"type" => "web_url",
"url" => button["url"],
"title" => button["text"]

}

if button["webview_height"].present?
Expand All @@ -405,6 +406,14 @@ def generate_buttons(buttons:)
_button['messenger_extensions'] = true
end

if button['webview_share_button'].present?
_button['webview_share_button'] = 'hide'
end

if button['fallback_url'].present?
_button['fallback_url'] = button['fallback_url']
end

_button

when 'payload'
Expand Down