How to answer a user in Home device and send a notification to user's phone

匆匆过客 提交于 2019-12-11 05:49:20

问题


Is there any way to answer a user question in the Home device and at the same time, send a notification to another device? For example, if the user ask for a direction, answer with the location (voice) and finish saying to the user:"I've sent you the location to your phone" and send him a map...

I know there is a way to switch conversation to another device (say, for example, one with screen) but I don't want to finish it in Home device.

Thanks in advance.


回答1:


Not in a straightforward way, no, but there are a few options that you have that may do what you want.

You can try to use Assistant Notifications. Right now, notifications only appear on mobile devices, but even if/when they allow speaker notifications in the future, your user could still open it on a mobile device. You need to ask for permission to send a notification, and when they trigger the notification, an Intent in your Action will be triggered to actually show what you want to show.

You can also look into using a more standard notification channel such as Firebase Cloud Messaging. This does require you to have your own app on the mobile device, and it works outside of the Assistant, but may be a good choice if it meets your needs.



来源:https://stackoverflow.com/questions/51779910/how-to-answer-a-user-in-home-device-and-send-a-notification-to-users-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!