Make google actions development project preview persist longer - actions-on-google

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.

Related

How do I trigger the 'Add to homescreen' prompt for a PWA?

I have a PWA setup with a manifest and service worker such that I can manually add to the homescreen on Chrome in Android if I select the 'add to homescreen' button under the menu. I also verified on the Desktop that I can add it as a webapp in Chrome.
However, it seems that the installation banner only pops up based on some heuristics that Google selects e.g. user must interact with the site for 30 seconds etc.
What I would like is a button on my homepage, such that when I trigger it, the add to homescreen banner will automatically pop up in Chrome. How do I do this?
I want something similar to the 'Install' button on this example site: http://airhorner.com, which manually triggers the banner. However, what I would like is a minimal working example that demonstrates this.
The first thing to check is with the Chrome Audit tools.
Run the Progressive Web App audit
Under Passed Audits, you should see
--- "User can be prompted to Install the Web App"
Notes I have for A2HS
Source code links there for my working example
https://ng-chicago.github.io/2018/06/18/add-2-home-screen/
There are also reference articles I used
Most of the work when testing your A2HS is constantly clearing out your browser and previous installs (Chrome desktop and mobile) to test again.

Share my objects using a link - ionic3

I'm imagining this situation: I have my app opened on my device. I've just created a new element (object) in my app, for example a new Film like this
film = {
title: 'Shark 3',
subtitle: 'the revenge',
date: '12-11-2019',
plot: '...'
};
and I've saved it in my local storage. Now I want to share it on socials (WhatsApp, Facebook...) generating a link to this object. By clicking on this link I want my app (or the app store if it is not installed) to open. In case my app is installed, it should display a page with the film's information.
Is it possible? How to do this in ionic?
The data you want to present is stored within the app and so available on every device your app is installed, I guess? Or is it data loaded from a backend?
What you want to do is called a Deep Link. This means clicking on a links opens your app and redirects the user to a specific page depending on the link.
This is possible with Ionic and the DeepLink native plugin.
But there need to be done other things outside your app to make it work. You need to register and verify your domain with Google and/or Apple.
And be aware testing this is very uncomfortable. It will only work with signed packes. So just running ionic cordova run android won't work, you will have to go the whole way creating a signed package as you need to do when you're going to publish it.
Here is a Blog article describing the functionality.

Facebook MessengerExtensions in Browser?

Attempting to load the Facebook MessengerExtensions appears not to work when using the in-browser experience for Facebook messenger (as opposed to the native apps on iOS or Android). When I interact with my bot's persistent menu to open a webview (that is trying to use MessengerExtensions), I get this error in the browser console of a newly opened tab:
Messenger Extensions are not enabled - could be "messenger_extensions" was not set on a url, the domain was not whitelisted or this is an outdated version of Messenger client
I have the impression that MessengerExtensions is simply not supported for the in-browser experience but have a couple of questions:
Can someone find where in the docs this lack of support is stated (because I've obviously missed it if it's there...)?
If this is supported somehow, suggestions for what I might be doing wrong? (I have confirmed that my persistent menu button has messenger_extensions: true and my web_url is whitelisted...)
Is there some kind of workaround (not using MessengerExtensions) for the webview opened in the browser to get the page-scoped user Id (PSUID) for the user interacting with the bot?
For a button generated with the Send API I could conceivably append the PSUID to the URL being opened as a query param (not sure of security considerations on that)
For the persistent menu the web_url of the button action is NOT dynamic (it's configured ahead of time) so I'm unsure how this URL when opened from the browser-based messenger interface is supposed to figure out what user opened it. Thoughts/Ideas?
I've just tried it on the chrome with facebook api version 2.10, and it works. When I clicked on the button, I got a "lightbox" looking window that opened on top of the messenger, and all the proper callbacks are called in javascript.
this is my button json:
{
type: 'web_url',
title: <title>,
url: <url>,
messenger_extensions: true,
fallback_url: <url>,
webview_height_ratio: 'tall'
}
these are a few things that I did:
the button spec should contain messenger_extensions: true
facebook whitelisted_domains doesn't do subdomains, so make sure you whitelist the entire url before the parameters.
fallback_url should be whitelisted as well.

Facebook messenger checkbox plugin is hidden (already checked other answers)

I have the same problem like asked here: Facebook messenger checkbox plugin is hidden
I tried the implementation of the Facebook Checkbox Plugin according to Facebooks documentation but it won't show on my VM in my Company.
The Facebook SDK Implementation works fine, I tried the "Share" and "Like"-Button, which show up correct.
I have a Facbook Page which has public access and a Messenger APP in DEV-mode. The "Send-API" from Facebook works correct too: I am able to send message to myself as administrator from my Webpage on my development VM.
Following Steps are done: use a random user_ref on every request, set my page on the whitelist, use "https", visit my page FB-loggedIN and FB-loggedOut
But the result ends in Markup and Log-Infos like this screen:
See FF DeveloperTools Markup Screenshot for current state
According to this I visited a page given as origin where the Plugin should work (see first link in my question) - but there the plugins' HTML is the same like mine.
So is there a general problem on Facebooks' site or is there quite more necessary, to get this plugin running? Could it be a problem with self-signed certificate on my VM?
At the moment I don't want to notify or login any user. All I want is that the checkbox is shown.
Pherhaps anyone has an idea or the same experiences :)
Additional Info: the console shows following message
fb:messenger_checkbox failed to resize in 45s
after some fiddling we found out that a registered webhook is required (even if you dont consume the events) to make the messenger checkbox plugin render properly.

Auto redirect google code to github

We have moved our codebase and wiki to github. However the google code version still shows up really high on Google. Is there any way to do an auto redirect to github when people land on the Google code version?
I'm not sure how long this option has been available (it may be related to Google announcing they're shutting down Google Code), but you can now set a "project moved" flag which will provide all visitors to your Google Code project with a link to any other site, including GitHub.
Note: It doesn't appear that you can fully revert this setting, at least not at the time of my writing this, so be sure you really don't want to access anything from the Google Code project before setting it.
You can mark your project as moved on your admin page. If you change your mind, you can clear the setting by clicking the publish button.
Setting the "Project Moved" Flag
Once a project has been successfully exported to GitHub, you will want to update your project's homepage on Google Code to avoid confusion.
Some project owners simply update their project homepage's text to indicate it has moved to GitHub. For example subtext or bwapi.
Another option is to set the Google Code "project moved" flag. When set, attempts to access the project will take users to an interstitial page indicating the new project location. In the future, the page will automatically redirect to well-known project hosting services such as github.com.
To set the "project moved" flag, navigate to your project's advanced admin page, at https://code.google.com/p//adminAdvanced.
Once there, enter the new project home page URL under "project moved". For example: https://github.com/google/kythe. Finally click the "Project Moved" button.
If you need to "un-move" a project, you can go back to the /adminAdvanced page at a later time and click "Publish". This will restore your project to its original state, before the move.