Apple 推送通知中可以包含多少个字符?
假设您有一个超级简单的通知,例如
{
"aps": {
"alert" : <MY_MESSAGE>
}
}
256 字节限制来处理 MY_MESSAGE 可以有多少个字符?或者相关问题可以表述为:每个字符有多少字节?
是不是就像假设 UTF-8 编码在我的示例中添加了 18 个字节的非内容字符一样简单?
Given that you have a super simple notification such as
{
"aps": {
"alert" : <MY_MESSAGE>
}
}
and the 256 byte limit to deal with how many characters can MY_MESSAGE be? Or the related question could be phrased as, how many bytes are in each character?
Is it as simple as assuming UTF-8 encoding which adds up to 18 bytes worth of non content characters in my example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据经验,在截断消息的其余部分之前,警报框将允许您有 141 个字符。完整的消息可能比这大得多,但出于我的目的,我只需要警报框限制。
iOS 5 更新
如果启用新样式的列表视图通知,您将获得大约 62 个字符。
Empirically, the alert box will let you have 141 character before truncating the rest of the message. The full message can be much larger than that but for my purposes I only need the alert box limit.
Update for iOS 5
If the new style of list view notifications is enabled, you get about 62 characters.