2). 去掉SimplePushfolder里的pk.pem (它没用),把step 11.4生成的"PushDemoCK.pem" copy toSimplePushfolder
3). 修改simplepush.phpfile下面几行:
// Put your device token here (without spaces):
//device token来自Step 10的第4点,在output console获取,注意:要去掉前后的尖括号,和中间的所有空格
$deviceToken= '43fcc3cff12965bc45bf842bf9166fa60e8240c575d0aeb0bf395fb7ff86b465';
// Put your private key's passphrase here:
//该值是 3)生成PushDemoKey.pem时设置的密码
$passphrase= '123456';
// Put your alert message here:
$message= 'My first push notification!';
//.....stream_context_set_option($ctx, 'ssl', 'local_cert', 'PushDemoCK.pem');
4). 在terminal window里,go to the simplepush folder,然后执行下列命令,你的iPhone应该会收到一条push message。
phpsimplepush.php
注意:如果你的app在iphone里是正在运行,而且app是在front end时,当它收到push message时是不会出现在iPhone顶部的notification area的!
参考文章:http://www.easck.com/blog/static/121416962011111710934946/
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持ASPKU。
注:相关教程知识阅读请移步到IOS开发频道。










