且构网

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

iPhone 推送通知字符限制

更新时间:2023-02-27 08:47:20

每个推送通知都带有一个有效载荷.有效载荷指定如何提醒用户等待数据下载到客户端应用程序.允许的最大尺寸通知有效载荷为 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.