github 下载地址
https://github.com/stefanhafeneger/PushMeBaby php
1.运行若是报错,那么导入CoreServices.framawork
替换这句 #include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h> 为 #include <MacTypes.h>
2.把你的开发证书.cer 文件更更名为apns.cer,放入工程中,代码中是经过
self.certificate = [[NSBundle mainBundle] pathForResource:@"apns1" ofType:@"cer”];取你的证书文件的
3.在输入框中粘贴进去你的deviceToken,注意不要带<>,空格能够有
4.能够开心的测试了~ html
////////////////////////// git
应该是你证书的问题,你运行pushmebaby的时候有弹出对话框让你选择使用证书吗?还有你的keychain中 Apple Production Push Services.cer下面有密钥吗?都有的话你的程序是能够创建链接的。
还有result = SSLSetPeerDomainName(context, "gateway.push.apple.com", 30);
应该改为 result = SSLSetPeerDomainName(context, "gateway.push.apple.com", 22); 22指的是前面字符串的length