BlueMix推送通知-支持Apple本地化警报消息 [英] BlueMix Push Notification - support for Apple localized alert messages

查看:94
本文介绍了BlueMix推送通知-支持Apple本地化警报消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用IBM Bluemix推送通知服务,是否可以使用Apple的loc-keyloc-args字段发送推送通知?如果是这样,您如何使用REST API构造这样的请求?该文档没有提及这些字段的可用性.

Using IBM Bluemix push notification service, is it possible to send a push notification using Apple's loc-key and loc-args fields? If so, how can you construct such a request using the REST API? The documentation does not mention the availability of these fields.

推荐答案

因此,在使用

So after testing out a few things with the REST API it does not appear to currently support any aps or gcm specific fields for the "alert" value. I would say this is likely due to simplifying things to support both platforms.

您现在可能最接近使用REST API的是将loc-key和loc-args值输入到客户有效负载中,然后将它们提取到客户端代码中.

The closest you can probably get right now utilizing the REST API would be to input your loc-key and loc-args values into the customer payload and then extract them in your client-side code.

例如,在REST方面,您的请求可能看起来像

So for example on the REST side of things your request might look like

{
  "message": {
    "alert": "Silent Alert, Extract Payload"
  },
  "settings": {
    "apns": {
      "type": "SILENT",
      "payload": {
        "loc-key" : "GAME_PLAY_REQUEST_FORMAT",
        "loc-args" : [ "Jenna", "Frank" ]
      }
    }
  }
}

这将发送通知和有效负载,但不会警告用户,此时您可以提取有效负载,使用模拟loc-key和loc-args值创建自己的通知客户端,然后将其显示给用户.

Which would send the notification and the payload but not alert the user at which point you could extract the payload, create your own notification client-side using the mock loc-key and loc-args values, and then show that to the user.

但是,肯定不是理想的解决方案,我们将尝试与开发人员联系,并查看是否有可能将该功能添加到REST API中.

Certainly not the ideal solution however, we'll try to get in touch with the developers and see if it would be possible to add that functionality to the REST API.

这篇关于BlueMix推送通知-支持Apple本地化警报消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆