UrbanAirship:在namedUser上设置标记时出错

时间:2015-06-24 20:13:15

标签: android urbanairship.com

按照UrbanAirship文档的说明,我需要在Android上的演示应用程序中使用这行代码将一个TagGroup添加到namedUser

airship.getPushManager().getNamedUser().setId("123456");
airship.getPushManager().getNamedUser().editTagGroups().addTag("loyalty", "elite").apply();

但是,LogCat显示了这个错误:

D/UrbanAirshipDemo - UALib﹕ Received a response for tag groups: Response: ResponseBody:  ResponseHeaders: {null=[HTTP/1.1 400 Bad Request], Connection=[close, Transfer-Encoding], Content-Type=[application/vnd.urbanairship+json; version=3], Date=[Wed, 24 Jun 2015 20:02:06 GMT], Transfer-Encoding=[chunked], X-Android-Received-Millis=[1435176126629], X-Android-Response-Source=[NETWORK 400], X-Android-Sent-Millis=[1435176126427]} ResponseMessage: Bad Request Status: 400
E/UrbanAirshipDemo - UALib﹕ Update tag groups failed with status: 400
E/UrbanAirshipDemo - UALib﹕ Both add & remove fields are present and the intersection of the tags in these fields is not empty.

他们的API有点奇怪吗?来自此处的说明:http://docs.urbanairship.com/platform/android.html#named-user-tag-groups

只是简单的实现,但他们的API返回400.推送通知正常工作

1 个答案:

答案 0 :(得分:2)

我能够重现同样的问题。错误消息不正确,真正的问题是标签组尚不存在。组只能通过Go创建。尝试创建以下群组 - http://docs.urbanairship.com/topic-guides/tag-groups-walkthrough.html#create-a-tag-group,然后重试。

错误消息将在以后的版本中修复。