iPhone 推送通知字符限制 [英] iPhone Push Notification Character Limit

查看:49
本文介绍了iPhone 推送通知字符限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 IOS 推送通知的新手.我一直在阅读有关它们的信息,但似乎在任何地方都找不到这些信息.我已经读到推送通知的大小限制是 256 字节.此大小限制是否包括诸如必须发送的设备令牌和有关通知的其他开销信息之类的内容.如果是这样,我的内容可用的实际大小是多少.

I'm brand new to IOS push notifications. I have been reading about them and can't seem to find this information anywhere. I have read that the size limit on a push notification is 256 Bytes. Does this size limit include things such as the device token that have to be sent and other overhead information about the notification. If so what is the actual size I have avaliable for my content.

还有他们使用什么格式来解释我发送的文本?转换是 1 个字符 = 1 个字节还是更多.我真的想知道我可以在推送通知中发送多少个字符.

Also what format are they using to interpret the text that I send? Is the conversion 1 character = 1 byte or is it more than that. Really I want to know how many characters can I send in a push notifications.

感谢您在理解推送通知负载限制方面的任何帮助.

Thanks for any help in understanding the limitations of push notification payloads.

推荐答案

每个推送通知都带有一个有效载荷.有效载荷指定如何提醒用户等待数据下载到客户端应用程序.允许的最大尺寸通知有效载荷为 256 字节;苹果推送通知服务拒绝任何超过此限制的通知.

Each push notification carries with it a payload. The payload specifies how users are to be alerted to the data waiting to be downloaded to the client application. The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.

对于每个通知,提供者必须组成一个 JSON 字典对象严格遵守 RFC 4627.这本词典必须包含另一个由密钥 aps 标识的字典.aps 字典包含一个或多个指定以下操作的属性:

For each notification, providers must compose a JSON dictionary object that strictly adheres to RFC 4627. This dictionary must contain another dictionary identified by the key aps. The aps dictionary contains one or more properties that specify the following actions:

  • 显示给用户的警告信息
  • 用于标记应用程序图标的数字
  • 要播放的声音

-本地和推送通知编程指南

那么,回答你的问题,

这个大小限制是否包括诸如设备令牌之类的东西?待发送以及有关通知的其他开销信息.

Does this size limit include things such as the device token that have to be sent and other overhead information about the notification.

是的,此大小限制包括设备令牌和其他开销信息.

Yes, this size limit includes device token and other overhead information.

转换是 1 个字符 = 1 个字节还是更多.

Is the conversion 1 character = 1 byte or is it more than that.

如果您在通知中仅使用拉丁字母,则为真.

This is true if you're using only Latin letters in your notification.

这篇关于iPhone 推送通知字符限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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