【iOS推送】信鸽出现生产证书验证失败


Configuring Push Notifications

Apple Push Notification service (APNs) allows an app that isn’t running in the foreground to notify the user that it has information for the user. Use Xcode to enable push notifications. If necessary, Xcode creates an explicit App ID with the APNs entitlement enabled and a team provisioning profile using the explicit App ID. You then generate and download a corresponding client SSL certificate—this step fully enables push notifications—and later, install the client SSL certificate and key on your server.

Enabling Push Notifications

First enable push notifications in your Xcode project.

To enable push notifications

  1. In the Capabilities pane, if Push Notifications isn’t enabled, click the switch in the Push Notifications section.

    ../Art/4_enablepushnotifications_2x.png

In Member Center, the Push Notifications service will appear as Configurable (not Enabled) until you create a client SSL certificate.

Creating a Universal Push Notification Client SSL Certificate

You use Member Center to generate a push notification client SSL certificate that allows your notification server to connect to the APNs. Each App ID is required to have its own client SSL certificate. The client SSL certificate Member Center generates is a universal certificate that allows your app to connect to both the development and production environments.

Important: Only a team agent or admin can generate Apple Push Notification service SSL certificates.

To generate a universal client SSL certificate

  1. In Certificates, Identifiers & Profiles, select Certificates.

  2. Click the Add button (+) in the upper-right corner.

    ../Art/12_ios_apns_certificate_1.shot/Resources/shot_2x.png
  3. Under Production, select the “Apple Push Notification service SSL (Sandbox & Production)” checkbox, and click Continue.

    ../Art/12_ios_apns_certificate_2.shot/Resources/shot_2x.png
  4. Choose an App ID from the App ID pop-up menu, and click Continue.

    Choose the explicit App ID that matches your bundle ID.

  5. Follow the instructions on the next webpage to create a certificate request on your Mac, and click Continue.

  6. Click Choose File.

  7. In the dialog that appears, select the certificate request file (with a .certSigningRequest extension), and click Choose.

  8. Click Generate.

    ../Art/12_ios_apns_certificate_3_2x.png
  9. Optionally, click Download.

  10. Click Done.

Verifying Your Steps

In Member Center, the status of the Push Notifications service for the specified environment (Development or Distribution) changes from Configurable to Enabled.

To verify the App ID settings

  1. In Certificates, Identifiers & Profiles, select Identifiers and under Identifiers, select App IDs.

  2. Select the explicit App ID that matches the bundle ID.

    A green circle followed by “Enabled” appears in the Push Notifications row and the Distribution column.

    ../Art/12_ios_apns_certificate_4.shot/Resources/shot_2x.png

Installing a Client SSL Signing Identity on the Server

Install the SSL distribution signing identity you obtained earlier on the server that runs the provider code and connects with the development or production version of APNs. Export the signing identity from the keychain on the Mac where you created it, and copy it to the appropriate place on the server.

To export a client SSL signing identity

  1. Launch Keychain Access.

  2. In the Category section, select My Certificates.

  3. Find the certificate you want to export and disclose its contents.

    You’ll see both a certificate and a private key.

  4. Select both the certificate and the key, and choose File > Export Items.

  5. From the File Format pop-up menu, choose a file format that your server accepts.

  6. Enter a filename in the Save As field, and click Save.

    Files in the Personal Information Exchange format have a .p12 extension, and files in the Privacy Enhanced Mail format have a .pem extension.

For techniques to resolve push notification server issues, read Troubleshooting Push Notifications.

Enabling Game Center (iOS, tvOS, Mac)

Game Center is Apple’s social gaming network. It allows players to connect their devices to the Game Center service and to exchange information.

To use Game Center, first enable Game Center in Xcode.

To enable Game Center

  1. In the Capabilities pane, if Game Center isn’t enabled, click the switch in the Game Center section.

    ../Art/4_enablegamecenter_2x.png

Xcode automatically provisions your app to use Game Center and adds the GameKit framework to your project.

For Mac apps, Xcode also sets your Outgoing network entitlements in the App Sandbox section, located in the Capabilities pane in Xcode. If your app also listens for network connections, it needs to allow incoming connections. To set additional network entitlements, read Configuring App Sandbox (Mac).

For how to write your GameKit code, read Game Center Programming Guide. To configure your app in iTunes Connect, read Adding New Apps in iTunes Connect Developer Guide to create the app record (enter your explicit App ID), and read Game Center Configuration Guide for iTunes Connect to configure game features.

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW11

转载于:https://my.oschina.net/onepieceios/blog/550587

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值