【iMessage push protocol script group control Apple host real machine】¶
【iMessage Apple push notification family push】Apple scriptiOS development for iMessage group sending promotes C++ Server APNS source code¶
Online APNS code on a C++ server, to the annoyance of our background staff, today's Internet, PushNotificationDemo, PushnotificationDemo, demo. In addition, I have already completed PHP, so it is easy to promote the program using these two methods, whether it is a development certificate or a product certificate, it is not difficult.
The promotion principle is very simple, that is, build a long connection socket on the operating system and then poll. It's just a socket connection between the Apple push server and the iOS phone operating system. Why you do this is to extend battery life and save power. If there is no such function, just like Android, software can be implemented anytime, anywhere, and can receive server care from the server anytime, anywhere. Every software must run a socket in the background. It is obvious that this will be very powerful. capital. . The simplest way is to connect to the connection and receive notifications at any time without losing power, so it is driven. Then why Android can't do it? The reason is that Android is open source and many manufacturers and Google are restricted in China, resulting in the complete improvement of future Android phones. If one day, Oola Laours can replace Google's unified Android push market, no matter what mobile phone it is, through Oola Laour, use the Aurora push socket, which is an absolute good tool for Android mobile phone users. Generally speaking, students will definitely use Pushmebaby to verify the authenticity of the certificate, but veterans will pay attention to it.
iPhone/iOS development drives C++ Server APNS source code
First, you must use the user email address that is used with the AppID mailbox. The title is also best used together with the username of the AppID. If configured incorrectly, token symptoms can occur.
If you have two certificates on your computer, such as a company account on your computer and a developer account for your company. Don't think you can use CSR and have to use two different email requests twice. In other words, the CSR email address must be the same as the AppID to which the certificate belongs. If you can receive the token in your program, this step is successful.
Second, use the PushMebaby push service. Note that his serial number must comply with his original space format (if you use it directly). Then the serial number generated by the development certificate can only correspond to the development certificate. If you want to use the product certificate for the first time. Because you must wait for the software version before getting the product serial number, debugging is done with the server serial number on the server.
Third, you can find a replacement certificate that will not connect to the Apple Push Server, you must remember the address of the development certificate and the address of the product certificate, as well as many words that will calculate the connection address length. topic.
Fourth, if you use the serial number of the development certificate, you will test on Server Pushmebaby, you will invent it, click on the three folds. The solution is to quickly release the current software, download it using your test phone, let the background get the serial number, and then use this serial number as the debug serial number for the background product certificate. In fact, this method is the second point, but the problem is still stuck.
Fifth, Apple's push to a C++ server is different from PHP, which requires secret authentication and development certificate integration with CK.PEM. Objc does not directly develop certificates. In process with background C++ engineer. It is used by pushchatkey.pem and pushchatcert.pem as separate files.
Use qualityOfService under API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // Read-only after the thread starts @property (class, readonly, copy) NSArraycallStackReturnAddresses API_AVAILABLE(macos(10.5 ), ios(2.0), watchos(2.0), tvos(9.0)); @property (class, readonly, copy) NSArraycallStackSymbols API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0 )); @property (nullable, copy) NSString name API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); @property NSUInteger stackSize API_AVAILABLE(macos(10.5), ios(2.0) ), watchos(2.0), tvos(9.0)); @property (readonly) BOOL isMainThread API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); @property (class, readonly) BOOL isMainThread API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); // Report whether the current thread is working @property (class, readonly, strong) NSThread mainThread API_AVAILABLE(macos(10.5 ), ios(2.0), watchos(2.0), tvos(9.0)); - (instancetype)init API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) NS_DESIGNATED_INITIALIZER; - (instancetype )initWithTarget:(id)target selector: (SEL)selector object:(nullable id)argument API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); - (instancetype)initWithBlock: (void (^)(void))block API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)); @property (readonly, getter=isExecuting) BOOL execution
The names of pushchatkey.pey.pem and pushchatcert.pem can also be changed at will.
How to use Apple APNS communication? Developers who need iOS developers to provision servers
APS_Production.CER is downloaded from the Apple Developer website;
Oh everyone, you: ~chenshuangpump$ openssl x509-i that ps_production. from - everyone -
Double-click to install APS_Production.Cer to keychane, find the push certificate you just installed, click, right-click to export the secret, named xxx.p12; the demo is CSC123.P12.