Follow the tutorial blog. csdn. netnewjueqiarticledetails7898591. Note: 1. the push address used in the test phase: ssl: gateway.sandbox.push.apple.com: 2195 the push address used for official launch: ssl: gateway.push.apple.com: 21952. The php push code from there is a question.
It is done by following the tutorial http://blog.csdn.net/newjueqi/article/details/7898591. Note: 1. push address used in the test phase: ssl: // gateway.sandbox.push.apple.com: 2195: ssl: // gateway.push.apple.com: 2195 2. the php push Code provided there is a question
It is done by following the tutorial http://blog.csdn.net/newjueqi/article/details/7898591.
Note:
1. Push address used in the test phase:
Ssl: /gateway.sandbox.push.apple.com: 2195
The push address officially launched:
Ssl: // gateway.push.apple.com: 2195
2.
If there is a problem with the php push code, I will post the code successfully pushed after the modification:
$ Message, 'Forum _ id' => 88, 'topic _ id' => 999,); // Encode the payload as JSON $ payload = json_encode ($ body ); // Build the binary notification // $ msg = chr (0 ). pack ('n', 32 ). pack ('h', $ deviceToken ). pack ('n', strlen ($ payload )). $ payload; $ msg = chr (0 ). pack ("n", 32 ). pack ('H * ', str_replace ('','', $ deviceToken )). pack ("n", strlen ($ payload )). $ payload; // Send it to the server $ result = fwrite ($ fp, $ msg, st Rlen ($ msg); if (! $ Result) {echo 'message not delivered '. PHP_EOL;} else {echo 'message successfully delivered '. PHP_EOL;} // Close the connection to the serverfclose ($ fp);?>
[Author] Zeng jiansheng
[Author email] zengjiansheng1@126.com
[Author QQ] 190678908
[Blog] http://blog.csdn.net/newjueqi
Http://blog.sina.com.cn/h6k65