Should your application delivers a credit message in order to Google Chat, the space (chat room otherwise direct message) displays a cards. The new card can also be contain individuals UI issues, and you may attach onClick incidents to these elements while making a card interactive.
- openLink enables you to indicate a great Backlink to display screen.
- action enables you to admission application-particular guidance returning to the application implementation to implement random behavior. Which behavior can include upgrading cards which might be currently presented from inside the the fresh cam, because the revealed regarding significantly more than example.
Simply click to start Hyperlink
Opening a Url is simple: new credit message only describes new Website link that needs to be unwrapped if the mouse click happen:
Just after sending the latest card message, the new software does not have any next involvement; Google Cam manages beginning the desired Url when the mouse click takes place.
Click to execute software step
If you want your application to do something when a follow this link takes place, utilize the step target in order to establish suggestions and that is sent returning to brand new software.
In such a case, the specified information is provided for the new app when the mouse click happens, additionally the application are able to bring appropriate action responding to help you brand new simply click.
Exhibiting an entertaining switch
To show an entertaining button, a software delivers a card content detailed with a keen onClick target that have involved step given that shown regarding following the analogy:
HTTP and Affect PubSub apps
Cloud PubSub and you will HTTP applications need establish action.actionMethodName to understand the experience. They are able to additionally use action.parameters to take and pass trick/well worth pairs which has most other arbitrary information back to by themselves. These trick/well worth sets was elective.
Software Program programs
Applications Program apps should specify action.actionMethodName , and you can optionally can use step.details . To support entertaining cards, programs might also want to explain an onCardClick(event) method of handle user presses. This technique will get a great callback in the event that member ticks to the the new credit.
Updating an entertaining cards
Should your app handles an enthusiastic onClick.step , in many cases you’ll want to posting the new credit that is already demonstrated (instead of adding a unique message for the area).
Such as for instance, a bug program may blog post an alternate insect towards the a speak room and have an option towards the bottom one states “Designate if you ask me”. In the event that member presses it, the latest card updates to express “Bug are assigned to login name “.
Another paragraphs explore just how their app obtains user click information, and ways to answer they possibly of the inserting a new credit otherwise by the upgrading the present one.
Finding associate simply click guidance
In the event that affiliate clicks an object on the credit who may have an onClick.action outlined, Google Chat directs a message on application detailing case.
A cards_Engaged knowledge is passed to this new designer to the action payload which had been given over. Their app should handle this experience and you may function appropriately. You need to use step.actionMethodName and step.details to include special-circumstances clicks to various buttons to suit your app.
Software can address a consult by updating the first message, otherwise by creating a new content. They do this because of the indicating new actionResponse.type in the newest JSON reaction.
JavaScript analogy: Vote Software
Below is an example of an entertaining application one provides track away from a ballot number. In the event that member clicks “Upvote”, the fresh software condition the newest choose trust the initial card. When the associate presses “The new Vote”, the new application postings a different sort of cards.
But once the otherwise indexed, the content in the webpage is registered according to the Imaginative Commons Attribution 4.0 Permit, and you can password trials is actually subscribed according to the Apache 2.0 Permit. To have information, see the Bing Builders Site Regulations. Coffee is an authorized signature out-of Oracle and/otherwise its affiliates.