http://www.cnblogs.com/wengzilin/archive/2012/05/02/2479241.html
apns pem 文件生成命令
openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12
openssl pkcs12 -nocerts -out key.pem -in key.p12
cat cert.pem key.pem > ck.pem
APNS PHP
https://github.com/manifestinteractive/easyapns
测试接口:gateway.sandbox.push.apple.com:2195
产品接口:gateway.push.apple.com:2195
测试接口:sandbox:feedback.push.apple.com:2196
产品接口:feedback.sandbox.push.apple.com:2196
三、apns推送且传送指定参数:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
可直接使用 [userInfo objectForKey:@"aps"] 获取推送消息
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
接收推送消息是不能直接使用 [userInfo objectForKey:@"aps"] 获取,需用一下fang's
//判断程序是不是由推送服务完成的
if (launchOptions) {
//截取apns推送的消息
NSDictionary* pushInfo = [launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];
//获取推送详情
NSString *pushInfo = [[NSString stringWithFormat:@"%@",[pushInfo objectForKey:@"aps"]];
}