且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iPhone推送通知字符限制

更新时间:2023-02-27 09:10:35


每个推送通知都带有一个有效负载。有效负载
指定如何向等待下载到客户端应用程序的
的数据发出警报。
通知有效负载允许的最大大小为256字节; Apple推送通知服务
拒绝任何超出此限制的通知。

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:


  • 要显示给用户的警报消息

  • 标记应用程序图标的编号
  • 播放声音

  • An alert message to display to the user
  • A number to badge the application icon with
  • A sound to play

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

所以,回答你的问题问题,

So, answering your question,


此大小限制是否包括诸如要发送
的设备令牌等内容以及有关通知。

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 b是或者不止于此。

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.