0

How to implement this example :

      let device = this.googleAction().getRequest().getDevice();
      console.log(device);
      this.tell('Thanks for your precise location');

https://raw.githubusercontent.com/jovotech/jovo-framework-nodejs/master/examples/google_action_specific/appAskForPermission.js

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Your question is very broad and it is unclear what you are asking. Is the code you linked to not working? Are you getting an error? Are you trying to do something specific? We would like to help, but you haven't given us enough to help you. See https://stackoverflow.com/help/how-to-ask for more info about how to ask a good question. – Prisoner Mar 10 '18 at 23:19
  • Try: https://developers.google.com/actions/assistant/helpers#place_and_location I also have a video here that walks you through it. https://www.youtube.com/watch?v=QeANrxWTIFo – SysCoder Mar 11 '18 at 22:57

1 Answers1

0

Did you ask for 'precise location' first as shown in the example you linked?

this.googleAction().askForPreciseLocation('Precise Location pre text');

If a user gives you the permission, it then jumps into the 'ON_PERMISSION' handler, where you can access the information as explained:

 if (requestUser.permissions.indexOf('DEVICE_PRECISE_LOCATION') > -1) {
        let device = this.googleAction().getRequest().getDevice();
        console.log(device);
        this.tell('Thanks for your precise location');
    }

You can find more information in the Jovo Docs: Google Assistant > Data > ON_PERMISSION.

Jan König
  • 440
  • 3
  • 12