【问题标题】:Urban Airship Android push getting "This app is not configured for iOS push"Urban Airship Android 推送出现“此应用未配置为 iOS 推送”
【发布时间】:2013-09-03 21:58:24
【问题描述】:

我正在使用 Urban Airship 并使用他们的 REST API 进行测试。我有Google Cloud Messaging连接到Urban Airship账号,并且一台安卓设备注册成功。
我可以从 Urban Airship 仪表板上的界面成功发送测试消息。

但是当我尝试将 REST API https://go.urbanairship.com/api/push/ 与正文一起使用时

{
 "audience" :  "all" ,
 "device_types" : "all",
 "notification" : {
   "android": {
     "alert" : "This is a broadcast."
   }
 }
}

我收到了400 Bad Request 回复This app is not configured for iOS push

知道为什么吗?

更新:在“受众”部分列出特定设备 APID 会返回相同的结果

【问题讨论】:

  • 我不知道 API,但您似乎应该在“device_types”中指定“android”而不是“all”(假设您只想推送到 Android 应用程序)。
  • 这个问题仍然开放,但我设法通过 UrbanBlimp github.com/SimonCropp/UrbanBlimp 发送推送消息

标签: android push-notification google-cloud-messaging urbanairship.com


【解决方案1】:

您所拥有的是正确的,但是您需要包含以下 HTTP 标头:

Accept: "application/vnd.urbanairship+json; version=3;

对于初学者 Ruby 开发者,可以这样实现:

req = Net::HTTP::Post.new(uri.path)
req["Accept"] = "application/vnd.urbanairship+json; version=3;"

例如,向 UrbanAirship 发布通知时。

【讨论】:

  • 添加accept 标头使它对我有用device_types: "all"。希望它在文档中,UA。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多