问题描述
我是 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.
推荐答案
对于每个通知,提供者必须组成一个 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:
- 显示给用户的警告信息
- 用于标记应用程序图标的数字
- 要播放的声音
那么,回答你的问题,
这个大小限制是否包括诸如设备令牌之类的东西?待发送以及有关通知的其他开销信息.
是的,此大小限制包括设备令牌和其他开销信息.
Yes, this size limit includes device token and other overhead information.
转换是 1 个字符 = 1 个字节还是更多.
如果您在通知中仅使用拉丁字母,则为真.
This is true if you're using only Latin letters in your notification.
这篇关于iPhone 推送通知字符限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!