APNS推送通报的流程
APNS推送通知的流程下面是我的所有部署配置过程。1. 将app注册notification里面, 并从APNS上获取测试机的de
APNS推送通知的流程
下面是我的所有部署配置过程。
1. 将app注册notification里面, 并从APNS上获取测试机的deviceToken.
????????????????????????????????????????????????????????message:[[userInfo objectForKey:@"aps"] objectForKey:@"alert"]?????????????????????????????????????????????????????? delegate:self ??????????????????????????????????????????????cancelButtonTitle:@"关闭"??????????????????????????????????????????????otherButtonTitles:@"更新状态",nil];????????[alert show];????????[alert release];????}}
启动程序,将app注册到通知项后,在console里面找到打印的deviceToken:
fwrite($fp, $msg); fclose($fp);?>
请求一次 http://127.0.0.1/apns/apns.php?message=A%20test%20message%20from%20localhost&badge=2&sound=received5.caf就会向APNS进行一次推送。我的请求结果如下:
复制代码
Connection OK Sending message :{"aps":{"alert":"A test message from localhost","badge":2,"sound":"received5.caf"}}