push notification for iphone
由于公司业务需求,以前一直做PHP开发,突然让我研究push notification ,一下子迷糊啦,不知所措,抓狂!但是在自己的努力下还是初有成效!现拿出来显摆一下!
1:push notification 的流程及其原理

- 应用启用推送通知功能,需要用户确认;
- 应用收到设备识别ID(device token),相当于接收推送通知的地址;
- 应用将设备识别ID发送到你开发的服务器;
- 当有推送通知的需要时,你就可以通过你开发的服务组件发送信息到苹果的服务器上;
- 苹果推送通知服务将信息推送到用户的设备上。
2:生成证书文件
这部分是有我们的制作人生成,提供以.cer和.p12文件并且包含.p12文件的密码,然后使用php生成以.cer结尾的证书和密码,为将来发送push做准备!具体PHP代码如下:
<1>:cer文件生成pem文件
system('openssl x509 -in .cer证书文件 -inform der -out .cer生成的文件名.pem');
<2>:p12文件生成pem文件
system('openssl pkcs12 -nocerts -out .p12文件生成文件名.pem -in .p12文件名 -passin pass:.p12文件密码 -passout pass:.p12生成文件密码);
<3>:将第一步和第二步生成的文件合并最终文件
system('cat .cer生成的文件名.pem .p12文件生成文件名.pem > 最终文件名.pem);
3:获取用户device token
如果是自己开发的app,则只需要写一个接口,用来收集用户的device token,如果使用adodb的发布系统则使用一下方法来转换device token,进而搜集用户的device token。
4:
push notification for iphone的更多相关文章
- iOS上简单推送通知(Push Notification)的实现
iOS上简单推送通知(Push Notification)的实现 根据这篇很好的教程(http://www.raywenderlich.com/3443/apple-push-notification ...
- 远程通知APNs(Apple Push Notification Server)
推送通知是由应用服务提供商发起的,通过苹果的APNs(Apple Push Notification Server)发送到应用客户端.下面是苹果官方关于推送通知的过程示意图: 推送通知的过程可以分为以 ...
- (转)How to renew your Apple Push Notification Push SSL Certificate
转自:https://blog.serverdensity.com/how-to-renew-your-apple-push-notification-push-ssl-certificate/ It ...
- (转)How to build an Apple Push Notification provider server (tutorial)
转自:https://blog.serverdensity.com/how-to-build-an-apple-push-notification-provider-server-tutorial/ ...
- (转)Apple Push Notification Services in iOS 6 Tutorial: Part 2/2
转自:http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2 Upda ...
- (转)Apple Push Notification Services in iOS 6 Tutorial: Part 1/2
转自:http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 Upda ...
- (转)苹果推送通知服务教程 Apple Push Notification Services Tutorial
本文译自http://www.raywenderlich.com/.原文由iOS教程团队 Matthijs Hollemans 撰写,经原网站管理员授权本博翻译. 在iOS系统,考虑到手机电池电量,应 ...
- Push Notification总结系列(一)
Notification系列概括: 1.Push Notification简介和证书说明及生成配置 2.Push Notification的iOS处理代码和Provider详解 3.Push Noti ...
- 陌陌架构分享 – Apple Push Notification Service
http://blog.latermoon.com/?p=878 先描述下基本概念,标准的iPhone应用是没有后台运行的,要实现实时推送消息到手机,需要借助Apple提供的APNS服务. iPhon ...
随机推荐
- Undefined property: Illuminate\Database\Eloquent\Builder
是因为在 $activity=Activity::where('center_id','=',$center->id)->where('Date','=',date("Y-m-d ...
- 如何判断一个数是否为素数(zt)
怎么判断一个数是否为素数? 笨蛋的作法: bool IsPrime(unsigned n){ if (n<2) { //小于2的数即不是合数也不是素数 throw 0; ...
- js页面刷新的几种方法
Javascript刷新页面的几种方法: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(locat ...
- PHP读书笔记(6)- 数组
数组定义 数组就是一个键值对组成的语言结构,键类似于酒店的房间号,值类似于酒店房间里存储的东西.PHP 中的数组实际上是一个有序映射.映射是一种把 values 关联到 keys 的类型. 定义数组 ...
- find & rm
1)查找并删除3天前的历史文件 rm -rfi `find /tmp/ -ctime 3` 2)按分钟查找 find -cmin N
- LeetCode 80
Remove Duplicates from Sorted Array II Follow up for "Remove Duplicates": What if duplicat ...
- PE制作实录 —— 定义我的 PE 工具箱
Step 1 想个好听的名字 我倒是没什么文化,洋气点又要方便记忆,最终锁定 Operit! ,源自英语 Operate .it ,合并一下再加上感叹号,洋气吧~ Step 2 利用百草霜制作 Mes ...
- nmap命令-----基础用法
系统漏洞扫描之王-nmap NMap,也就是Network Mapper,是Linux下的网络扫描和嗅探工具包. 其基本功能有三个: (1)是扫描主机端口,嗅探所提供的网络服务 (2)是探测一 ...
- Servlet & JSP - Listener
Servlet API 中的 6 个事件类 1. ServletContextEvent:该类表示上下文事件,当应用上下文对象发生改变,例如创建或销毁上下文对象时,将触发上下文事件. 2. Servl ...
- Ehcache(2.9.x) - API Developer Guide, Class Loading
About Class Loading Class loading, within the plethora of environments that Ehcache can be running, ...