我正在使用 Java 快速启动应用程序来了解镜像 api。我将它部署到 aws 并且能够成功地与之交互。我已经更新了 MirrorClient 以将 callbackURL 设置为通过代理 ( https://mirrornotifications.Appspot.com/forward?url=http:// {myurl}/notify) 进行路由,并且我确实收到了通知,但响应始终为空. 这是我正在尝试处理的自定义菜单项,所以我想知道在构建菜单项时是否缺少一些基本的东西。相关代码如下。
List<MenuValue> menuValues = new ArrayList<MenuValue>();
MenuValue defaultValue = new MenuValue();
defaultValue.setDisplayName("Find");
defaultValue.setState("DEFAULT");
menuValues.add(defaultValue);
MenuItem nearMe = new MenuItem();
nearMe.setId("nearMe");
nearMe.setAction("CUSTOM");
nearMe.setValues(menuValues);
searchNearMeMenuList.add(nearMe);
TimelineItem timelineSearchNearMe = new TimelineItem();
timelineSearchNearMe.setText("Search near me");
timelineSearchNearMe.setIsBundleCover(false);
timelineSearchNearMe.setBundleId("mySearch");
timelineSearchNearMe.setSourceItemId("FIND_NEAR_ME");
timelineSearchNearMe.setMenuItems(searchNearMeMenuList);
timelineSearchNearMe.setNotification(new NotificationConfig().setLevel("DEFAULT"));
这是否与我部署在 aws 而不是应用引擎上的事实有关?提前感谢您的帮助。
更新了 GET 响应。
{
"kind": "mirror#timelineItem",
"id": "9944f290-89b5-46b0-aa7d-2a06623a5d07",
"sourceItemId": "FIND_NEAR_ME",
"bundleId": "mySearch",
"isBundleCover": false,
"selfLink": "https://www.googleapis.com/mirror/v1/timeline/9944f290-89b5-46b0-aa7d-2a06623a5d07",
"created": "2013-08-06T16:01:42.886Z",
"updated": "2013-08-06T16:01:42.886Z",
"etag": "\"ZECOuWdXUAqVdpmYErDm2-91GmY/01TB49uN8ZW2c8MYSuyXCySS-KE\"",
"text": "Search near me",
"speakableText": "This will find stores near you",
"menuItems": [
{
"id": "nearMe",
"action": "CUSTOM",
"values": [
{
"state": "DEFAULT",
"displayName": "Find"
}
]
}
],
"notification": {
"level": "DEFAULT"
}
}