When your software directs a card message to Google Talk, the space (speak place otherwise lead content) screens a card. This new card can be include certain UI elements, and you may install onClick incidents to the elements and work out a cards interactive.
- openLink enables you to identify a beneficial Url to monitor.
- step enables you to admission app-certain guidance back once again to this new app implementation to make usage of random choices. Which decisions can include updating cards which might be already shown inside the new chat, given that shown on more than example.
Simply click to open Url
Beginning an effective Url is straightforward: the fresh card content merely represent the fresh new Hyperlink that should be opened if the simply click happen:
Once giving the newest card content, the brand new application has no further involvement; Google Talk manages beginning the specified Website link in the event that click occurs.
Mouse click to execute application action
If you want the software to do something whenever a view here takes place, utilize the action object in order to explain recommendations and that’s sent back into the fresh new app.
In this situation, the specified data is taken to the new software in the event the mouse click happens, therefore the software may then get compatible step in reaction to the latest simply click.
Exhibiting an entertaining switch
Showing an interactive option, an app delivers a card message detailed with an onClick target that have related action as found on the following example:
HTTP and you will Cloud PubSub applications
Affect PubSub and you can HTTP apps need certainly to identify step.actionMethodName to spot the action. They’re able to also use action.variables to pass through trick/really worth pairs which has had almost every other random suggestions back once again to on their own. Such key/worth pairs try elective.
Apps Program software
Apps Software software might also want to indicate action.actionMethodName , and you will optionally can use action.details . To help with interactive notes, applications should establish an onCardClick(event) approach to deal with user presses. This method gets an effective callback if user presses toward the fresh card.
Upgrading an interactive credit
Should your software protects an enthusiastic onClick.action , occasionally you’ll want to upgrade this new cards that is currently presented (unlike incorporating an alternative content toward area).
For example, an insect system get blog post a different insect into the a cam space and just have an option towards the bottom that states “Assign in my experience”. In the event that user presses they, the fresh cards position to state “Bug is actually allotted to username ” https://besthookupwebsites.net/pl/erotyczne-randki/.
The second paragraphs speak about how the software obtains associate click advice, and ways to answer they sometimes by inserting a different credit otherwise because of the updating the existing you to definitely.
Searching user mouse click pointers
When the affiliate clicks an object throughout the credit who has a keen onClick.step defined, Google Speak delivers a message on app discussing the event.
A credit_Clicked skills are introduced returning to the latest creator towards action payload which was given over. Your app is to manage it experiences and function correctly. You can utilize action.actionMethodName and you will action.variables to provide unique-situation ticks to various keys for your application.
Apps can answer a demand of the updating the original message, otherwise by making a separate content. They do this by indicating the fresh actionResponse.input the newest JSON response.
JavaScript analogy: Vote App
Lower than is actually a typical example of an interactive software that have tune off a vote number. If user ticks “Upvote”, the newest software updates this new vote depend on the initial cards. When the user clicks “The new Vote”, the brand new software postings an alternative cards.
Except once the or even listed, the message from the web page try authorized beneath the Imaginative Commons Attribution 4.0 Permit, and you may code examples is licensed beneath the Apache 2.0 License. To own facts, comprehend the Yahoo Developers Webpages Policies. Coffees is actually a subscribed signature of Oracle and you may/otherwise the associates.