Meet Push Notification
                   搭建稳健的iOS推送服务




12年3月24日星期六
About Me

        • @jeff_kit
        • 新晋奶爸
        • M%*技术+N%*产品
        • 图睿信息Co-Founder
        • 珠三角技术沙龙组委

12年3月24日星期六
点歌台




              ⼀一起         速推
12年3月24日星期六
大纲

              • 认识推送
              • 理解推送
              • 推送最佳实践
              • 吐糟

12年3月24日星期六
认识推送



12年3月24日星期六
12年3月24日星期六
12年3月24日星期六
12年3月24日星期六
12年3月24日星期六
12年3月24日星期六
理解推送



12年3月24日星期六
12年3月24日星期六
XMPP




12年3月24日星期六
XMPP




                     NSNotificationCenter


12年3月24日星期六
XMPP




              APS          NSNotificationCenter


12年3月24日星期六
12年3月24日星期六
12年3月24日星期六
12年3月24日星期六
推送凭证--Token




12年3月24日星期六
12年3月24日星期六
推送工作流程




12年3月24日星期六
推送工作流程




12年3月24日星期六
Payload
              {

                  "aps" : {

                       "alert" : "You got your emails.",

                       "badge" : 9,

                       "sound" : "default"

                  },

                  "acme1" : "bar",

                  "acme2" : 42

              }


12年3月24日星期六
sample code
   from apns import APNs, Payload

   apns = APNs(use_sandbox=True, cert_file='cert.pem',
          key_file='key.pem')

   # Send a notification
   token_hex = 'my_device_token'

   payload = Payload(alert="Hello World!", sound="default", badge=1)

   apns.gateway_server.send_notification(token_hex, payload)




12年3月24日星期六
APS Protocol




12年3月24日星期六
APS Protocol




12年3月24日星期六
APS Protocol




12年3月24日星期六
APS Protocol




12年3月24日星期六
APS Protocol




12年3月24日星期六
对比Android推送

              • 唯⼀一实现 VS 各自为政
              • 统⼀一 VS 混乱
              • 节省 VS 浪费资源
              • 可靠 VS 不稳定

12年3月24日星期六
推送最佳实践



12年3月24日星期六
APNS




12年3月24日星期六
APNS




12年3月24日星期六
APNS




12年3月24日星期六
APNS




12年3月24日星期六
APNS-Agent
              • 约定胜于配置
              • 兼容测试环境
              • 使用队列加快响应时间
              • 重用APNS Socket
              • Design for Failure
              • 监控
12年3月24日星期六
自描述目录结构




12年3月24日星期六
APNS



              APNS-Agent

                           apps




12年3月24日星期六
APNS



              APNS-Agent

                           apps




12年3月24日星期六
sample code


         from apnsagent.client import PushClient

         client = PushClient(‘com.toraysoft.alert’)
         client.push(token,alert,badge,sound,custom)




      fork from:   https://github.com/jeffkit/PyAPNs

12年3月24日星期六
12年3月24日星期六
吐糟



12年3月24日星期六
12年3月24日星期六
Q&A



12年3月24日星期六

More Related Content

KEY
给Geek们的音乐课
KEY
冲浪 Object-c
KEY
Taste Rabbitmq
PDF
REST is not enough: Using Push Notifications to better support your mobile cl...
ODP
OWD - Push Notification Server Architecture [DEVCON1_2012]
KEY
漫游iOS开发指南
PDF
Presentation on CBO’s Projections of the Costs of U.S. Nuclear Forces, 2014 t...
PDF
Scala jeff
给Geek们的音乐课
冲浪 Object-c
Taste Rabbitmq
REST is not enough: Using Push Notifications to better support your mobile cl...
OWD - Push Notification Server Architecture [DEVCON1_2012]
漫游iOS开发指南
Presentation on CBO’s Projections of the Costs of U.S. Nuclear Forces, 2014 t...
Scala jeff

More from jeff kit (6)

PPT
原创音乐会
PDF
杯具是怎样练成的
PDF
PDF
PDF
Autoforms
PDF
Brief intro of Dropbox
原创音乐会
杯具是怎样练成的
Autoforms
Brief intro of Dropbox
Ad

构建稳健的iOS推送服务