How to vocally start app with parameter using Google Assistant? - actions-on-google

Currently, it's possible to open my app using Google Assistant by saying
"Ok Google, open MyApp"
Is it possible to pass a parameter to my app's main activity ?
For exemple, if I say
"Ok Google, open MyApp action A"
Can I get the "action A" parameter in the intent given to my app's main activity ?

You can say something like "talk to Resistance Decoder about a red, yellow, and blue resistor".
When this happens, your action is started but will skip the main intent. Instead, the rest of the phrase (a red, yellow, and blue resistor) will be sent to Dialogflow or Actions SDK and be processed as a different intent.
So the user will immediately get the answer they want.
It's referred to as a deep link intent: https://developers.google.com/actions/sdk/invocation-and-discovery#deep_link_invocation

Related

IBM Watson Assistant: Difference between "Try out" and Messenger in node with link

In one dialog node definition I tried to display HTML link but there is difference in the output or the response at both the palaces i.e messenger and the try out.
The dialog node we define:
Try out response:
Messenger response:
The possible error may be is the HTML rendring.What are the possible solutions.
Make sure that your HTML does not have any error.
Check that you are using the same API version in "Try out" and in your app or the messenger. The API versions can be checked in the Watson Assistant release notes.
Depending on the client the text may need encoding.

Make google actions development project preview persist longer

I want to make google voice actions app for my Google Home. But, based on quick research, as of Dec 11, google does not allow private projects for Google Home.
References:
Can I develop a private action only accessible via my google home or linked account?
How can I run my development action on my Google Home?
I understand that I can preview the app from API.ai project, and it deployes to the linked Google Home device.
But the issue is, the deployed app does not persist. It is no longer available after hour or so.
How can I make it permanent (if there is a way)?
UPDATE
Based on Leon's answer, I just wanted to extend the steps on how to enable the sample for 24 hours.
Click on the "Google Home Web Simulator" link on bottom right corner.
Then you will be presented with google home device - click on "Start" button on that page
On next page, top right corner you have the "ACTION PACKAGE" button Leon is talking about. Click on that and extend expiration time by clicking on "Preview for 24 hours" button. See screenshot below:
I have found a way to create the Action on API.ai and then preview it indefinitely.
From API.ai:
Open browser dev console (Network tab)
Go to Integrations
Turn on "Actions on Google" integration
Click "Authorize"
Click "Preview"
Inspect the XHR response from https://console.api.ai/api/agent/googleassistant/preview in the Network dev console
{
"status":{
"code":401,
"errorType":"unauthorized",
"errorDetails":"You are not authorized for this operation. ",
"webhookTimedOut":false
}
}
Copy/paste the content of the response into a file called action.json
Then, download and install the gactions CLI from here - gactions CLI and then run this command:
gactions preview --action_package action.json --preview_mins 9999999 \
--invocation_name [your_own_invocation_name_here]
The preview_mins value of 9999999 makes the preview effectively indefinite.
Here is a video demonstrating it:
As of today, May 17 2017, the highest voted answer to this question no longer works for new API.ai projects due to the upgrading of the Actions on Google SDK to v2. A similar methodology to #Brady's answer does work still, but they've made it more difficult in some ways (more information needs to be provided to Google, globally unique invocation name despite being a local only test), and better in others (gactions CLI docs now explicitly state that indefinitely timed previews are accepted, and actually is the default if not provided as a argument to the gactions test call).
Create your API.ai agent as normal.
Under the "Integrations" side menu, open the "Actions on Google" settings.
Select "Test" from the bottom of the dialog box that appears (you may need to jump through a few hoops here, signing in, authorizing account access, etc.)
This is where it gets a little different. You now need to create a project on the Actions on Google console. Create or import a project to the console.
The first required step is to supply an action package, which can come from either API.ai or the SDK directly. For API.ai, you have to go back to the Integrations page we were at and press "Update" on your Actions on Google settings. (On the previous version of the SDK, this was labeled "Deploy" and would have made your app public, but don't worry - all this does now is update the AoG console. You publish publicly from the AoG console later if desired).
This new console requires more information outright than was necessary before. I found that the "Assistant app name" can be whatever you want, but the "Pronunciation" is strictly limited to a few conditions (globally unique, reserved keywords, non-brand violating). I also found that I could still invoke using the app name and not just the pronunciation, but I suspect that will be fixed.
Once you've filled out all the necessary information, you can test
from API.ai. Return to the AoG settings menu in API.ai and retrieve
the response content from the HTTP request preview (just like in
#Brady's answer above). Here we hit another difference. The content
of the request response can't be used directly in the action.json
file as it is wrapped in another object. You want to use only the
object from the property actionPackage. (i.e. remove
{
"actionPackage":
from the beginning of the content and
}
from the end). You should end up with a object of a structure similar
to this (but maybe not exactly, it depends on the content of your
API.ai agent):
{
"actions": [...],
"types": [...],
"manifest": {...},
"conversations": {...}
}
Put this into your action.json file.
Execute the new gactions CLI command:
gactions test --project <your_project_name_from_aog_console> --action-package action.json
Enjoy your local v2 Actions on Google SDK project! And pray Google does not alter the deal any further...
I tried my best to recall what I had to do from memory, so there may be some mistakes in this write up. Hopefully this helps someone.
You can extend the time the development action can be previewed on the web simulator or Google Home device. After you preview the action from API.AI, click on the list of action packages in the web simulator. Then select the "Preview for 24 hours" link for your action package.

Facebook enhanced Auth Dialog Button Types

Using the Facebook enhanced auth dialog, the dialog itself shows a blue button to confirm the app at the user side. The text of this button could be:
Add to Facebook
Log in with Facebook
Go to App
Play Game
Is there any way to choose the displayed? For example I would like to use Log in with, but I always get Go to App.
Yes, you have to configure your application correctly per the blog article you got that info from ;)
http://developers.facebook.com/blog/post/2012/03/02/enhanced-auth-dialog-and-updates-to-permissions/
New button text
In the enhanced auth dialog, the button text will be one of four
cases: "Add to Facebook", "Log in with Facebook", “Go to App”, or
"Play Game". Each of these were extensively tested and showed that
more specific calls to action help users better understand the auth
process. As the first point of contact for an app, it’s important for
the auth dialog to exhibit a great user experience.
See our Open Graph documentation to learn more about permissions and
configuring the enhanced auth dialog.
And most importantly a quote from Lu's, the blog author, response to that same question from Sven Gali (oh svengali!):
the four cases are context-sensitive and currently, there is no
control for you to pick a particular button text. We show different
button text in different situations, as we've found that users are
more likely to install your application if the call-to-action text
aligns with their expectations. Thus, the logic currently is something
like*:
if the user has already installed the app and you are requesting additional permissions that includes "publish_actions", we use "Add to
Facebook"
if you're a game app, we use "Play Game"
if your auth dialog is shown in display=popup (e.g. after user clicks a "Log In with Facebook" fb:login button), we use "Log In with
Facebook"
in other situations, we use "Go to App"
*Obligatory Disclaimer: We may adjust the logic tree in the future without notice, as we're constantly testing variations to improve the
user-auth experience. But hopefully this is helpful so you can at
least understand how it is currently functioning under the hood :)
Note that Facebook appear to be adding more variants to this set of 4 now. I've noticed that newspaper apps generally have the text 'Read this article' as the button text.

How we can change facebook apprequest messages

Is there any way to customize apprequest message of facebook?
e.g. if a person sends request to his friend then default message comes "Shahid sent you a request in FarmVille"
here Shahid is username and FarmVille is an app name.
screenshot is given below
screenshot http://www.ogilvyapplications.com/temp/apprequest.jpg
You can only customise the message for where it appears in the Games and Apps dashboard, the notification in the dropdown will always have that default text. See the Requests docs for more information.
you can see in the screenshot above that the text CAN be edited. it almost always is "... sent you a request in ..." but there are some different ones, like "... wants to include you as a professional connection in ..."
i still didnt find out how to change it though
maybe you need to add "verbs" to your apps (in this case - "include" you as a "professional connection", or something like that) and thats the only way to change the text?

Facebook-connect demo - is "Callback URL" == "Connect Callback URL"?

I'm starting to feel stupid. I'm following the Facebook-Connect demo "The Run Around".
At the point when I navigate to http://www.[mysite].com/testing/register_feed_forms.php to register the one-line story, I get the following error:
Error while setting up application:
You need to configure your callback URL in the Facebook Developers App
However, when I edit my app settings in the http://www.facebook.com/developers/apps.php page, I CAN'T FIND ANY BOX TO PUT THE CALLBACK URL !!
Where is it?
What is it that I'm missing? I have found many references that it should be in the "Basic" tab of my App Settings, but I can't find it! Is it the Connect Callback URL?
To be more specific, this is the content I see in 'Basic':
Essential Information
Application Name
Application ID
API Key
Secret
Basic Information
Description
Icon
Logo
Language
Developers
Contact Information
Developer Contact Email
User Support Email
User-Facing URLs
Help URL
Privacy URL
Terms of Service URL
Thank you... Either docs are obsolete or I'm becoming slow...
A "Connect URL" and a "Callback URL" are two different things, though they often contain the same url value. Does that make sense?
And yes, the documentation is BEYOND horrible and completely unacceptable. What's worse is that because it is so outdated, it often suggests things that will BREAK an already working app.
Just horrible...
Here's how to set your connect url.
Login as you to facebook.
Go to facebook.com/developers
You'll see somthing along the right side that says "my applications". Click on your app.
Then click "edit settings."
You'll be taken to a new inteface that has tabs running vertically along left side. Click the tab that says (surprise) "Connect"
The connect url text input box will be the very first at the top.
If the 'callback url' you're talking about is the same as the 'Canvas Callback URL' that I'm thinking about, which is the only callback url that I know about, then it's the second text field in the 'Canvas' tab of the editor. This is mine:
Canvas Callback URL: http://localhost/ Facebook pulls the content for your application's canvas pages from this URL.