Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a phone call within Google Assistant App

I am trying to develop a Google Assistant App, primarily for Google Home and Google Assistant on the phone.

Is there a way to integrate Google's hands-free calling capability to the Assistant App, so that a user can directly initiate a phone call within my app?

For example. my app is providing a few suggestions for some stores, and will prompt the user to ask if they would like to make a call to a store.

Does anyone know if this is possible?

Many Thanks!

like image 733
Iris Wei Avatar asked Oct 11 '17 15:10

Iris Wei


1 Answers

You can show a call button which will redirect to the specified number on the dialer app.

Here's a way to do that from fulfillment response:

"buttons": [
   {
    "title": "Call",
    "openUrlAction": {
        "url": "tel:+91123456789",
        "androidApp": {
            "packageName": "com.android.phone"
        },
        "versions": []
    }
  }
]

Add this JSON to your response and it will show a button which will redirect to default call app and shows +91123456789 number filled.

EXTRA

Similarly, if you want to send mail then you can add:

{
    "title": "Send Mail to Jay",
    "openUrlAction": {
        "url": "mailto:[email protected]",
        "androidApp": {
            "packageName": "android.intent.extra.EMAIL"
        },
        "versions": []
    }
}
like image 85
Jay Patel Avatar answered Oct 21 '22 06:10

Jay Patel