#iOS开发笔记#Push Notification配置(PHP和Java语言)

本文简要介绍了在iOS端实现推送的主要配置步骤,包括获得授权,使用PHP语言和Java语言时对授权文件的不同处理方式,以及在Client如何获得当前设备的token。

iOS推送的原理和机制在本文中并没有涉及。

Java实现Server端遇到握手失败(handshake_failure)的原因和解决办法参见:Java实现iOS推送握手失败的解决办法


1. Server 端配置 (Mac OS)


1) Request Certificate

Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority....(save to disk)
得到文件:xxx0. certSigningRequest

2) Export as file xxx1.p12

Keychain Access -> 右键上一步中生成的 xxx0 private key -> Export “xxx0”
得到文件:xxx1.p12

3) Create App SSL Certificate

  1. iOS Dev Center: https://developer.apple.com/ios
  2. Certificates, Identifiers and Profiles -> App IDs
  3. Create a new specific App ID, add “Push Notifications” Service//必须是Explicit,不能用Wildcard
  4. Edit, under “Push Notification”, click “Create Certificate”
  5. Upload xxx0. certSigningRequest
  6. Download to get the certificate
得到文件:“aps_development.cer”

4) Make .pem file - 针对PHP语言

1.Convert the .cer file into a .pem file
在存放上文得到的几个文件的文件夹中,打开terminal,输入以下命令。
$ openssl x509 -in aps_de
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值