【问题标题】:UrbanAirship: Error setting tags on namedUserUrbanAirship:在 namedUser 上设置标签时出错
【发布时间】:2015-06-24 20:13:15
【问题描述】:

按照 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。推送通知工作正常

【问题讨论】:

    标签: android urbanairship.com


    【解决方案1】:

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

    错误消息将在未来的版本中修复。

    【讨论】:

    • 哇,非常感谢!我想你是 UA 团队的一员吧?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多