Home php教程 php手册 关于APNS的一些事(是以前的补充)

关于APNS的一些事(是以前的补充)

Jun 06, 2016 pm 08:09 PM
a apns about

在之前也写过一些关于apns的事情,不过都没有深究。都是抄抄改改,写写弄弄,近日 在与人讨论时,人说纯中文可以发76个汉字左右。当时我就想了,这不应该

 在之前也写过一些关于apns的事情,不过都没有深究。都是抄抄改改,写写弄弄,近日 在与人讨论时,人说纯中文可以发76个汉字左右。当时我就想了,这不应该啊。apns总长度不能超过256字节,76个汉字。json_encode一下。一个汉字8个字节,早就超了不知道多少了。还要组成payload。。难道不超吗?

然后看了一下别人的函数,原来是用了一个自定义的json_encode。看了他的自定义json_encode之后,突然想起,风雪之隅在他的博客上提到过,5.4的json_encode加了一些参数(参考:让Json更懂中文(JSON_UNESCAPED_UNICODE)),于是看了一下。json_encode($str,JSON_UNESCAPED_UNICODE)。计算下来的长度与那个自定义的json_encode一样了。

自此,记录下来。推送的时候也可以多推几个汉字了。(仅限php5.4,之前的版本还是网上找自定义的json_encode函数吧,关键字:中文自定义 php json_encode ,或者直接看:http://yige.org/p/458)

早期关于APNS的文章 :

  • [2013-02-16] - 关于APNS的一些小问题 (浏览:698,评论:0)
  • [2013-02-07] - APNS 推送 (浏览:686,评论:0)
  • [2012-10-13] - 还是APNS的一些问题 (浏览:1232,评论:0)
  • [2012-07-18] - apns 二三事 (浏览:1371,评论:0)
  • [2012-07-17] - 关于APNS的一件挫事 (浏览:1494,评论:2)
  • [2012-04-17] - 供应商与苹果推送信息服务器通信 翻译苹果文档 (浏览:2172,评论:0)
  • [2012-04-17] - 苹果服务器反馈服务 (浏览:2820,评论:0)
  • [2012-04-17] - 苹果推送注意事项 (浏览:2893,评论:0)
  • [2011-12-07] - 伤不起的程序猿 (浏览:1866,评论:0)
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1669
14
PHP Tutorial
1273
29
C# Tutorial
1256
24
AMD Ryzen AI is now only available on Windows, with plans to support Linux in the future AMD Ryzen AI is now only available on Windows, with plans to support Linux in the future Oct 22, 2023 pm 12:01 PM

According to news on October 22, AMD’s latest Ryzen7040 series laptops are equipped with a dedicated AI engine called “RyzenAI”, which is based on Xilinx IP and is designed to accelerate the operation of machine learning frameworks such as PyTorch and TensorFlow. However, currently RyzenAI only supports Microsoft Windows operating system, but as customer demand continues to grow, this situation may change. As early as June this year, AMD released some RyzenAI demo codes on GitHub. Although some of them are open source, they are only available for Windows systems, and AMD has not released any RyzenAILinux drivers. subsequently

Loongson 3A6000 challenges Core 10th generation: performance comparable to new generation processors! Loongson 3A6000 challenges Core 10th generation: performance comparable to new generation processors! Nov 11, 2023 pm 12:01 PM

According to news on November 11, Loongson Zhongke’s business model is gradually showing a completely different look from that of industry giants. Hu Weiwu, the company's CEO, said that unlike Huawei, Haiguang and Sugon, which adopt the IBM model, Loongson is more focused on building an ecosystem, likening it to Intel's business model. However, affected by policy market stagnation, Loongson Zhongke's performance has been relatively weak in the past period. According to the third quarter report, the operating income in the first three quarters of this year was 394.3 million yuan, a year-on-year decrease of 18.49%; the net profit attributable to the parent company dropped to -206.9 million yuan, a year-on-year decrease of 383.24%. According to the editor’s understanding, Hu Weiwu said at the performance meeting that for the recovery of the government policy market in the fourth quarter of 2023

The difference between link tag and a tag The difference between link tag and a tag Feb 19, 2024 pm 06:16 PM

The link tag and the a tag are two commonly used tags in HTML. They have different functions and usages. link tag The link tag is mainly used to introduce external resources into HTML documents. It is usually used to introduce external style sheets (CSS files). It can also be used to introduce other types of files, such as image files, audio files, etc. The link tag is located within the tag, usually written after other metadata (such as tags). Basic grammatical format of link tag

Top 10 virtual currency trading app platforms 2025 Top 10 virtual currency trading app platforms latest list Top 10 virtual currency trading app platforms 2025 Top 10 virtual currency trading app platforms latest list Mar 06, 2025 pm 04:21 PM

The top ten virtual currency trading app platforms in 2025 are: 1. OKX; 2. Binance; 3. Gate.io; 4. Huobi Global; 5. Kraken; 6. Coinbase; 7. KuCoin; 8. Crypto.com; 9. Bitfinex; 10. MEXC Global. The ranking considers factors such as market share, user experience, security, transaction fees, etc., but is for reference only.

ColorOS15 interface exposed. About this machine, here is a big change ColorOS15 interface exposed. About this machine, here is a big change Aug 28, 2024 pm 03:31 PM

Recently, ColorOS15 took the lead in launching internal beta testing. Some netizens exposed the relevant interface. Let’s see how it goes. As you can see in the picture above, some netizens posted the “About This Machine” interface of OPPO Find X7 after upgrading ColorOS15Beta. In addition to the big change in the top pattern, The configuration information in the lower half has also changed from the previous two columns to a single column vertical distribution. Attached is the "About This Phone/Mobile Phone" interface in the latest versions of mobile phones from six brands: Huawei, Honor, Xiaomi, OPPO, vivo, and Meizu. You can tell me which layout you like better. Regarding ColorOS 15, previous news said In addition to supporting LivePhoto live photos on a wide scale, it will also "support AirDrop&

What is the difference between iframe and a What is the difference between iframe and a Aug 25, 2023 pm 02:02 PM

The main difference between iframe and a tag is their function and purpose. Detailed introduction: 1. iframe is used to embed another web page in a web page, and the a tag is used to create a link; 2. iframe is suitable for displaying external content in a web page or multiple web pages in one page, and the a tag is suitable for Navigate within a web page or link to other web pages.

ColorOS15 interface exposed. About this machine, here is a big change ColorOS15 interface exposed. About this machine, here is a big change Aug 28, 2024 pm 03:31 PM

Recently, ColorOS15 took the lead in launching internal beta testing. Some netizens exposed the relevant interface. Let’s see how it goes. As you can see in the picture above, some netizens posted the “About This Machine” interface of OPPO Find X7 after upgrading ColorOS15Beta. In addition to the big change in the top pattern, The configuration information in the lower half has also changed from the previous two columns to a single column vertical distribution. Attached is the "About This Phone/Mobile Phone" interface in the latest versions of mobile phones from six brands: Huawei, Honor, Xiaomi, OPPO, vivo, and Meizu. You can tell me which layout you like better. Regarding ColorOS 15, previous news said In addition to supporting LivePhoto live photos on a wide scale, it will also "support AirDrop&

Use Curl, APNS+FCM and other extensions to implement the full platform message push function of PHP applications Use Curl, APNS+FCM and other extensions to implement the full platform message push function of PHP applications Jul 24, 2023 pm 01:49 PM

Use Curl, APNS+FCM and other extensions to implement the full-platform message push function of PHP applications. Message push is one of the essential functions in today's mobile application development. In PHP development, we can use various extensions to implement platform-wide message push functions, including Curl, APNS (ApplePushNotificationService) and FCM (FirebaseCloudMessaging). In this article I'll show you how to make

See all articles