What could be the reason for a Google Action with external endpoint (API) to work on the Actions Console Simulator, but not as deployed? - actions-on-google

I am new to the whole creation-process of Google Actions.
I created an Action with the new Action Console.
It has an fulfillment endpoint to my server (as example: www.mypage.com/api).
For testing purposes it has no authentification, so it generates a public API response.
Said API generates a simple JSON response based on a send event handler.
In short: Action onEnter sends handler to API, API queries SQL database and sends the response back to my Google Action that then "speaks" the SQL result.
The result with the Actions Console Simulator is:
Testing with "Smart Display device: everything works.
Testing with "Speaker (e.g. Google Home): everything works.
Testing with "Phone": main intent is invoked and text is shown but does not get spoken.
So i tested the command "Hey Google, talk to the unicorn app" directly on my smartphone.
Here **everything works fine ** as said smartphone has the same e-mail like the one on my Action Console account: it recognizes the main invocation command and when i ask by voice to get the data, the data is received from my server and spoken.
So something is wrong with the "Phone" device in the simulator. This has been confirmed by me from other users saying that they often have trouble with the simulator function correctly.
I then deployed my Action.
It was reviewed and approved.
A few seconds later i received an auto-email saying that there were too many errors with my app, asking me to check its health status. I did so and in the Health tab, i can see that it has an error but it does not show me what the error is.
THEN I CONTACTED A ACTIONS-ON-GOOGLE EXPERT
They helped me a lot into the right direction but could not go deeper into the problem as my connection (the endpoint API) is outside of their servers.
So i ended with their tip on checking the Google Cloud Logging Console.
As said Logging Console is also new for me, i learned on how to query my results but:
How can i query for the so called "is_health_check" flag?
I am asking this because the Google Expert recommended me to search for said flag but i do not know on how to query it.
Sorry for this ultra-long entry but i am trying to be as transparent to you as possible, as i have been trying this out for several days now.
Thanks in advance for your time, ppl!

So the error is simple once that you know how Google handles the external webhooks. Thanks to the help of 2 Actions-On-Google Experts i was informed that Google pings your external Webhook from time to time.
As soon as they get an error as result from said ping, the Action will be deactivated from the Assistant until a new ping response sends that everything is fine again.
My problem was that after deploying the action and while it was under reviews, i continued to work on the code on my server. While coding, the Google server pinged and received an error code.
My fault, but at least i learned the thing about pinging your action!

Related

Dialogflow + Actions on Google webhook request not being sent

I'm having a little (big) problem using webhook on Dialogflow (API.AI) and Actions on Google.
I have enabled webhooks on Dialogflow, and I'm getting the requests when trying my intents on their console (on the right of the page). I have also completed actions on google integration (setting the welcome intent + auto propagating changes).
However whenever I try my app on a Google Assistant app (phone/google home/their simulator) I'm not getting any request to my server (not even a 404 one), but their debugger shows this error:
status": {
"code": 206,
"errorType": "partial_content",
"errorDetails": "Webhook call failed. Error: 404 Not Found"
},
Has anyone had the same problem, or knows a fix for this ? I know it's not on my end since dialogflow requests are arriving and being correctly responded to.
Jo's answer gave me some hint that solved my problem.
In my case, webhook doesn't work after I turned it on for my agent, so I switched to another agent in the DialogFlow console(top left corner), then switch back to my working agent, click Fulfillment and found it mysteriously got disabled!
So what I did was re-enabled and re-entered the webhook link then click save. After that it worked.
Hope this helps.
Okay, I'm not marking this as resolved because I believe there are many "bugs" on the implementation between Dialogflow and Actions on Google.
Take note that this works IF you are getting webhook requests from Dialogflow console (on the right of the page) but NOT from actions on google simulator.
1) Try changing the name of the app on the "Info" section of Actions on Google and sending messages from Google assistant asking Talk to <new_app_name>
2) Try opening another project from Actions on Google dropdown (up right) and opening the first one after (It causes some reloading on the back I guess)
3) Try both
These have been working for me
I was facing the same issue where the Fulfillment didn't get saved even though a successful message is shown. In my case, I only kept only one Dialogflow tabs (closed the rest) and after clicking on Save a few times, I refreshed the page and made sure the webhook was still enabled. Then tested the app on Simulator and got a post request to my server!
Please make sure the following points :
(1) you have to fill all parameters under Directory Information (you can find this information at Left pane of actionOnGoogle).
(2) your Webhook URL must be a valid HTTPS URL.
(3) please make sure your server is listening for post request as dialogFlow or actionOnGoogle will send POST request on given fulfillment URL.
Directory Information on actionOnGoogle
You might have given link in fulfillment tab for the webhook url starting with http. Dialogflow's internal architecture rejects links which starts with http. Please make it https and it will work. It worked for me.

How to make the agent say something before leaving the mic open?

Google rejected my app and give the following feedback:
During testing we noticed that when the Action is not able to get data
it opens the mic and leaves it open without prompting. Make sure that
your agent always says something before leaving the mic open for the
user, so that the user knows what they can say. This is particularly
important when your agent is first triggered.
I've built my app using API AI tool and webhooks (connects to a web service running on Heroku). Heroku sleeps after 30 minutes of inactivity. I think this error occurs when Heroku takes a long time to respond. Any idea how can I make the agent say something before leaving the mic open?
I am not sure why I got this feedback because in case the web service request times out, Google Home speaks the following response.
It might answer the text response you added on API.ai but at the bottom of the page of your intent (under the text response) click on "Actions on Google" then check "End conversation" Check this screenshot
When you use assistant.ask in your fulfillment logic, you should be asking the user a question. It should be clear to the user what they are expected to answer.
If your fulfillment instance goes to sleep or doesn't respond quickly, then typically the assistant will play a message that indicates your action isn't responding.

Unity WebGL Google Analytics failed hits

I'm currently having a bit of trouble with GA and Unity WebGL. Every time I try to submit and event I keep getting the error "Google Analytics hit request failed with error "in the JS console with no message, but the events for the first user are being recorded.
It also seems to be only registering the first user when I'm looking at the real time feed. It seems to work as expected when I build my game to iOS.
Thanks in advance.
I had the same problem, the reason was this:
The GoogleAnalyticsV4 plugin logs the warning "Google Analytics hit request failed with error" when it didn't find a STATUS field in the response headers. However, the GA Server does not respond with that field when sending from within Unity / WebGL. The good news: Your hits will be counted anyway, as long as your request was valid. You can check your request data/url by using the Google Test Server or the Hit Builder.

Registration Process in XMPP Chat for iPhone

I am implementing a XMPP client for my iPhone App, I ahve completed all the things in (Chatting with other users , showing presence of other users , etc.)
But the one thing for which I am stuck is that , I am unable to get the new user registered from my App. I am using following snippet,
if ([appDelegate.xmppStream supportsInBandRegistration])
[appDelegate.xmppStream registerWithPassword:txt_Password.text error:nil];
But for this, supportsInBandRegistration method always returns NO and the registerWithPassword: method is never called.
Please provide some help regarding the same.
What server are you using? Some servers support in-band registration even thought they don't send the correct stream:feature according to XEP-0077. Most of them should give the feature in the disco results however.
In other words, try commenting out your if ([appDelegate.xmppStream supportsInBandRegistration]) and see if it works. If so, you'll need to complain either to your library developer or to your server developer or both.

Integrating Facebook Credits results in "The application you are using is not responding."

I've been trying to integrate Facebook Credit purchases into my app, but any call to the pay dialog results in the error message "The application you are using is not responding." To eliminate any application specific problems, I've downloaded the Credits API Example and am just trying to get that to work -- it results in the same error message.
I've been trying for a couple of days to pinpoint this error message, but with no luck. Here's what I know so far:
Clicking the "Pay with Facebook" button results in error code 1383008, but there's no error_message being displayed.
I'm running Apache 2.2 on Windows 7. As far as I can tell, Apache is configured to allow requests from any source.
The canvas page is configured to point at http://localhost:8080/facebook.../ while the callback page is configured to point at http://localhost:8080/facebook.../callback.php. However, I have verified that the callback page is not being accessed.
I'm not sure how to verify whether or not Facebook is receiving my data correctly or if it's passing anything back. Any help in this regard would also be appreciated!
Credits attempts to make a callback to a web accessible url (or IP). If Facebook's spider cannot fetch the information from the callback script, then it will continue to return errors, since Facebook expects you to send information like the cost, name, image, custom parameters in order to process the payment.
Have a look at the creating a callback section of the docs:
http://developers.facebook.com/docs/creditsapi/
Adding to Fancis' answer, what you can do is setup a hole in your firewall and connect it to a dynamic dns service such as http://dyn.com/. Then you will be able to test your credits code.