Android Google+writeMoment在示例代码中不起作用
瞬间在我看来似乎破碎了。使用google/google\u play\u services/samples/plus应用程序,我可以登录,也可以发送一篇互动帖子,但在编写示例时没有一个是有效的。从示例应用中,我可以选择List&remove moments,并列出了我认为由示例应用创建的一系列瞬间,但我不知道它们去了哪里。它们不会发布在我的Google+网站上,除非它们出现在我不检查的特定位置。有人能够成功地使用writeMoment吗 几分钟后,这将出现在Logcat窗口中: 01-27 17:11:31.179 1220-4693/?D/GooglePlusPlatform﹕ 请求时出现意外响应代码400:writeMomentAndroid Google+writeMoment在示例代码中不起作用,android,google-plus,Android,Google Plus,瞬间在我看来似乎破碎了。使用google/google\u play\u services/samples/plus应用程序,我可以登录,也可以发送一篇互动帖子,但在编写示例时没有一个是有效的。从示例应用中,我可以选择List&remove moments,并列出了我认为由示例应用创建的一系列瞬间,但我不知道它们去了哪里。它们不会发布在我的Google+网站上,除非它们出现在我不检查的特定位置。有人能够成功地使用writeMoment吗 几分钟后,这将出现在Logcat窗口中: 01-27 17
01-27 17:11:31.199 1220-4693/? W/谷歌Plusplatform﹕ {代码:400,错误:[{消息:缺少元数据字段:http://schema.org/url.,domain:global,reason:badRequest}]}编写SDK示例的瞬间对我来说很有用 确保您已更新到最新版本的GMS,您使用的示例可能是较旧的 确保已设置力矩的所有成员。特别是ItemScope中的项的类型 以下示例为审阅活动构造一个矩对象
ItemScope rating = new ItemScope.Builder()
.setType("http://schema.org/Rating")
.setRatingValue("100")
.setBestRating("100")
.setWorstRating("0")
.build();
ItemScope result = new ItemScope.Builder()
.setType("http://schema.org/Review")
.setName("A Humble Review of Widget")
.setUrl("https://developers.google.com/+/web/snippet/examples/review")
.setDescription("It is amazingly effective")
.setReviewRating(rating)
.build();
ItemScope target = new ItemScope.Builder()
.setUrl(targetUrl)
.build();
Moment moment = new Moment.Builder()
.setType("http://schemas.google.com/ReviewActivity")
.setTarget(target)
.setResult(result)
.build();
有关构建ItemScope/Moment对象的更多信息,请参见。我已安装了最新的Google Play services第14版,并已构建并运行了包含的Plus示例,未做任何更改。如果我不能得到他们自己的样本工作,我没有太多的希望使用任何其他样本代码。我试着瞄准安卓2.3.3、安卓4.0.3、谷歌Api的4.2,我在运行安卓2.3.4、4.0.4、4.1.2的设备上运行。