【发布时间】:2019-06-20 21:41:17
【问题描述】:
我尝试为我的 Google 助理应用程序制作推送通知。 我使用了谷歌开发者网站的 sendNotification 代码:https://developers.google.com/actions/assistant/updates/notifications
我正在编写 Java 代码。 一切正常,期待获得正确的用户 ID。 当我对我的用户进行硬编码时,它可以工作,但是如何在代码中获取用户 ID?
我尝试了以下代码:
Argument arg_userId = request.getArgument(ConstantsKt.ARG_UPDATES_USER_ID);
String userId = request.getUser().getUserId();
--> 我得到“java.lang.reflect.InvocationTargetException”
String userId = arg_userId.getRawText();
--> 相同的异常
【问题讨论】:
标签: push-notification dialogflow-es actions-on-google google-api-java-client