1

Has anyone been able to make the askForNewSurface() working ? It's supposed to ask the user if s/he wants to proceed the conversation on another support but it seems to actually just silently fails, at least for me.

I tried with a french assistant on a french Google home linked to a french account also configured on a french android phone and it didn't work.

I tried to switch everything to english and it's a bit better as the "hasAvailableSurfaceCapabilities" returns true (which wasn't the case in french if my memory isn't too bad..), but it just stops on the askForNewSurface() call.

I made the assistant via the actions on google SDK following their documentation.

Here is the code :

if (assistant.hasSurfaceCapability(assistant.SurfaceCapabilities.SCREEN_OUTPUT)) {
    if (!assistant.isNewSurface()) {
        assistant.tell("I found no screen.");
    } else {
        assistant.tell("You seem to have a screen available !");
    }
} else if (assistant.hasAvailableSurfaceCapabilities(assistant.SurfaceCapabilities.SCREEN_OUTPUT)) {
    try {
        let res = assistant.askForNewSurface("To display additional content", "Do you want proceed on this scree ?", [assistant.SurfaceCapabilities.SCREEN_OUTPUT]);
        console.log(res);
    }catch(e) {
        console.error("ERROR askForNewSurface()");
        console.log(e);
    }
} else {
    assistant.tell("Sorry i found no screen");
}

Of course the "console.error("ERROR askForNewSurface()");" is never fired. Everything seems fine, but nothing happens.

Any idea ?

Have a good day :)

Durss
  • 306
  • 2
  • 11
  • I'm actually wondering if the feature is ready. If i tell to my Home, "show me google dot com on my phone", it answers "Well there's no screen to show website on". I guess i'll try that again later ! – Durss Oct 27 '17 at 16:01
  • Hmmm, this feature should be working. Also, there should be feature parity between English and French so there should be no difference. I will get someone to try this on Monday and see if we can work out what is going on here. – Wayne Piekarski Oct 28 '17 at 00:56
  • 1
    Hi Durss, for me it worked. Video shown below. A few questions: Are you getting to the point where it is asking the user if they want to switch? If you are using Dialogflow, are you setting up the proper event in Diaglogflow? Also, it appears that you are using this documentation https://developers.google.com/actions/reference/nodejs/AssistantApp#askForNewSurface vs. https://developers.google.com/actions/assistant/surface-capabilities#multi-surface_conversations The second link has more information about the event in Dialog flow https://www.youtube.com/watch?v=92oZvkSZPPU – SysCoder Oct 28 '17 at 22:50
  • Thank you for your answers ! I'm gonna check this out tomorrow at work ! I indeed seem to missed the dialogflow event which may be the cause of my struggles. Thank you for your very helpful videi SysCoder ! I'll keep you both posted after i add that missing piece to my project ! – Durss Oct 29 '17 at 11:54
  • Just to be clear - are you getting the prompt that says it will carry on the conversation on the phone or not? – Prisoner Oct 29 '17 at 15:53
  • Nope i don't. When "askForNewSurface" is called, the conversation is simply stopped. I logged the result of the call which is a query object with a 200 status code, no sign of error. But maybe its stops because i haven't set any intent with the "actions_capability_screen_output " event on dialogflow(?). I'll try that monday morning as soon as i arrive at work ;) – Durss Oct 29 '17 at 17:15
  • Can you add to the question the contents of the query body? If you're not hearing the home say that it will carry on the conversation on the phone, then it isn't caused by missing an event. – Prisoner Oct 29 '17 at 17:56
  • Just posted the reason for all those struggles ;). Thank you again for your help ! – Durss Oct 30 '17 at 10:56
  • Damn i realized i forgot to look at the request's body before dumping everything and starting from scratch sorry.. And I deleted dialogflow and google projects, so i can't do it now that i think about it sadly.. If that can help anyone at google, i can still give you the project's ID. – Durss Oct 30 '17 at 15:20

1 Answers1

0

It's working !

I had really strange behavior with the project i was testing on so i started a new one from scratch.

It was a project made at the very beggining of the google actions with the GAction CLI. I later switched it to DialogFlow/webhook. What was very strange is that sometimes i was recieving request as DialogFlow source, some other times as SDK source. Also, the "Actions" part of the configuration which is supposed to tell if it's linked to "dialog flow", "SDK" or anything else, was empty and i couldn't manage to set it back properly. Finally, maybe the migration of dialogflow after their update to manage multi-lang probably wasn't perfect as the project was originally made full english, but when i exported the project, the JSON files were all named "intentName_fr" instead of "_en".

TLDR; the project was probably totally fucked up on every levels :D

I built a new one from scratch with the same source code and it's working properly. I get the question "is it ok if i send that to your phone ?" and if i say yes, i have the notification on my phone.

Thank you everyone for your answers :) !

Durss
  • 306
  • 2
  • 11