Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Commit

Permalink
Describe Open Graph template
Browse files Browse the repository at this point in the history
closes #10
  • Loading branch information
Bajena authored May 12, 2018
1 parent 9cec58a commit 7a34d9e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,21 @@ image = UI::ImageAttachment.new(img_url)
show(image)
```

### Open Graph Attachment

The Open Graph template allows you to send a structured message with an Open Graph URL, plus an optional button. Currently, only sharing songs is supported. The song will appear in a bubble that allows the message recipient to see album art and preview the song.


```ruby
song_url = 'https://open.spotify.com/track/5qqabIl2vWzo9ApSC317sa'
open_graph_element = UI::FBOpenGraphTemplate.new(song_url, [{title: 'Button', url: 'https://github.com/progapandist/rubotnik', type: 'web_url' }])
show(open_graph_element)
```

here's the result:

![opengraph](./docs/open_graph.png)

## Other events

Events other then `message` and `postback` are currently not supported.
Expand Down

0 comments on commit 7a34d9e

Please sign in to comment.