`
moderating
  • 浏览: 205908 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

玩一玩iPhone Push( Apple Notification Push Service)

阅读更多

恩,iPhone的push很不错,我喜欢。官方名称Apple Notification Push Service,苹果通知推送服务,缩写ANPS。我喜欢称为iPhone push。


地球人都知道乔帮主对于程序驻留手机后台是很不赞同的,iOS 4开始支持,我还没见过,暂时不谈。所以iPhone只能有一个当前正在运行的程序,很显然你没办法弄一个后台线程/进程通过传统的轮询方式来模拟push,破解的就不要拿来现了,乔帮主会让你内牛满面的。因此苹果就搞了iPhone push。简单来说,就是苹果弄一个push server阵列,开发人员可以弄个程序,通过SSL向push server提交消息,push server再把消息推送给你指定的设备。


简单记一下步骤:

申请一个专门的apple id, 生成证书请求并上传,指定package。下载生成的证书,安装到keychain access。打开对iphone push的支持

制作一个provision profile,绑定到刚才的apple id上,下载该profile,安装到xcode

创建iphone应用,指定package,指定provision profile。在代码中注册notification服务,上真机测试,得到device id

到keychain access,选中证书和密钥,导出两个文件,得到一个p12文件

写一个java程序,通过p12文件与苹果的push server建立 SSL连接,构造一个payload对象,发送之。搞定

分享到:
评论

相关推荐

    iPhone的Push(推送通知)功能原理浅析

    APNS 是Apple Push Notification Service(Apple Push服务器)的缩写,下文统一使用该缩写。 因 此,整个过程可以分为三个阶段,下面用大家常用的聊天客户端BeejiveIM来说明。(BeejiveIM是一款支持多账户登录的...

    java实现给Iphone推送消息

    APNS(Apple Push Notification Service)苹果推送通知服务。该技术由苹果公司提供的APNS服务。工作原理:首先,APNS会对用户进行物理连接认证,和设备令牌认证(简言之就是苹果的服务器检查设备里的证书已确定其为...

    [iPhone开发书籍大全].Cocoa.Touch.for.iPhone.OS.3.0.Developer.Reference(Wiley.2009).pdf

    Work with the Apple Push Notification Service Use the Map Kit API to create apps with embedded maps Record audio, play video, and access the iPod Library Set up your developer certificates and code...

    Cocoa Touch for iPhone OS 3 (pdf 书及源代码)

    Work with the Apple Push Notification Service Use the Map Kit API to create apps with embedded maps Record audio, play video, and access the iPod Library Set up your developer certificates and code ...

    macos-push-tester:本地Mac应用程序,可轻松将Apple APNs推送消息发送到iOS应用程序

    macOS Pusher App允许您通过APNS(Apple Push Notification Service)发送推送通知,并在设备上接收它们。 它还可以从同一wifi网络上的任何iPhone获取设备令牌。 注意:此应用是由SSED SDK团队内部使用而创建的。 ...

    iOS10推送教程详解

    上个月接到一个需求,做ios10的推送,意图冲击AppStore头条....APNS 是Apple Push Notification Service(Apple Push服务器)的缩写,是苹果的服务器。 上图可以分为三个阶段。 第一阶段:.net应用程序把

    移动消息推送库 PushSharp.zip

    push.QueueNotification(new AppleNotification()  .ForDeviceToken("DEVICE TOKEN HERE")  .WithAlert("Hello World!")  .WithBadge(7)  .WithSound("sound.caf")); //Registering the GCM ...

    iOS消息推送原理及具体实现代码

    2、APNS:Apple Push Notification Service[苹果消息推送服务器]; 3、iPhone:用来接收APNS下发下来的消息; 4、Client App:IOS设备上的应用程序,用来接收iphone传递APNS下发的消息到制定的一个客户端app[消息的...

    iOS实现消息推送及原理分析

    2、APNS:Apple Push Notification Service[苹果消息推送服务器]; 3、iPhone:用来接收APNS下发下来的消息; 4、Client App:IOS设备上的应用程序,用来接收iphone传递APNS下发的消息到制定的一个客户端 app[消息...

    IOS消息推送总结

    此文档描述了IOS推送的实现原理、详细的证书制作及核心代码实现(带图)!

    iOS开发之(APNS)远程推送实现代码 附证书与真机调试

    顾名思义,就是从远程服务器推送给客户端的通知(需要联网)远程推送服务,又称为APNs(ApplePush Notification Services) 为什么需要远程推送通知传统获取数据的局限性只要用户关闭了app,就无法跟app的服务器沟通...

    ApnsPHP:ApnsPHP:苹果推送通知和反馈提供程序

    ApnsPHP:Apple推送通知和反馈提供程序 全套开放源代码PHP类,可与iPhone,iPad和iPod Touch的Apple Push Notification服务交互。消息2016年6月1日,首先实现的HTTP / 2协议的,请下载(请检查您是否卷曲与HTTP2支持...

    BasicUserNotification.m

    在联网的情况下,由远程服务器推送给客户端的通知,又称APNs(Apple Push Notification Services) 不管应用是打开还是关闭的情况下,都能接收到服务器推送的远程通知 5.远程通知的实现基础 在联网状态下,所有苹果...

Global site tag (gtag.js) - Google Analytics