2

I am trying to implement the Push notifications as described here: https://developers.google.com/actions/assistant/updates/notification

Here are the steps I followed:

  1. Register Action for the Intent as Implicit Invocation in Google Actions.

enter image description here

As you can see, 'notif_intent' is my intent which I want to invoke as a result of a push notification.

  1. In the User Engagement section of this Action, I have enabled the push notification option:

enter image description here

  1. One of my Intent "Setup Push Notifications" is having the keywords like "enable notifications" in order to trigger it, which is used to ask the user for permission for sending push notification. Here is the Inline Editor's nodejs code used to handle this:

    app.intent("Setup Push Notifications", conv => {
    conv.ask(new UpdatePermission({
        intent: 'notif_intent'
    }));
    });
    
  2. Another Intent 'FinNotfSetup' is having the event 'actions_intent_PERMISSION' so that it is triggered when UpdatePermission() function is used in above code.

    app.intent('FinNotfSetup', (conv) => {
      if (conv.arguments.get('PERMISSION')) {
        const userId = conv.arguments.get('UPDATES_USER_ID');
        console.log("userId", userId);
        conv.close(`Ok, I'll start alerting you.`);
      } else {
        conv.close(`Ok, I won't alert you.`);
        console.log("not opted");
      }
    });
    

Now when I am triggering the "Setup Push Notifications" intent from my Device/Simulator, the Agent stops unexpectedly every time. On observing the error logs in Simulator, I get following error:

MalformedResponse at expected_inputs[0].possible_intents[0].input_value_data: The intent the app is asking for permission to send updates for is not found."

enter image description here

How is the Intent name not found? Is there any step or config that I am missing?

Bhavik
  • 346
  • 4
  • 11

0 Answers0