dkhamsing/apns-guide được TopGit xếp vào nhóm dự án mã nguồn mở, với 89 sao trên GitHub. :bell: Guide to setup APNS
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
:warning: Note this guide is quite old, additional resources below:
How to Generate a Push Certificate and Export It to a PEM File
Configuring Remote Notification Support
Apple Push Notification Device Tokens
Guide to setup APNS - 2016
Steps
Create Certificates, Identifiers and Profiles
Create the App Identifier
Certificates
Create the production APNS certificate
Setup production push service for the App Identifier
Devices
Provisioning Profiles
Final Steps
Signing
Testing
APNS with over-the-air (OTA) Deployments
Tools
Contact
Create Certificates, Identifiers and Profiles
Log into the Apple Developer Member Center.
Create the App Identifier
Go to "Identifiers" -> "App IDs" and create a new one
Enter the name of your app and an explicit bundle ID
Ensure "Push Notifications" is checked under "App Services"
Click continue and submit to save the app identifier
Note: It may make sense to use separate bundle identifiers for development and production to allow devices to run both versions simultaneously.
Certificates
This guide uses the openssl command rather than Keychain Access because it's easier to script and works cross-platform.
Open up a terminal and enter the following line to setup your app name. This is a variable that will be used by the other commands in this section to help generate consistent filenames so please adapt it to fit your needs:
APP="YourApp-Development-Push-Sandbox"
Create the private key and associated certificate signing request (CSR):
Fill out your location information, the OU, Email Address, Challenge Password, and CN may all be left blank. Skip entering the export password.
Create the APNS sandbox certificate for development use:
After you've created the identifier, go to "Certificates" and add a new one
Select "Apple Push Notification service SSL (Sandbox)" and click continue
Note: In addition to the push certificate, you'll also need to generate a separate key, csr, and cert for signing the app for development and distribution with if you haven't already done so
Now select the App ID that corresponds to the certificate you're creating and click continue
In the next step, choose the CSR file you created
The last step will allow you to download the generated certificate, named "aps_development.cer" for the sandbox and "aps_production.cer" for production
Rename the certificate to match your key and CSR (optional but recommended):
mv ~/Downloads/aps_development.cer "$APP.cer"
Create the P12 and PEM files with the private key and signed certificate:
You'll must specify an export password when generating the pkcs12 file.
Create the production APNS certificate
In the above steps you created a key and CSR for the sandbox APNS. To create an adhoc/production version:
Follow the above steps
When generating the certificate, select "Apple Push Notification service SSL (Production)" instead of the Sandbox option
You should replace "Sandbox" with "Production" to know what type of push service each certificate is for
Setup production push service for the App Identifier
After creating the identifier, you'll need to setup the APNS certificate for production push notifications, to do this click on the production/ad-hoc App ID you created and click "Edit"
Click "Create Certificate" under "Production SSL Certificate"
Use the certificate signing request that you generated in the previous section
Devices
Go to "Devices" and add the device ID (UDID) for any devices you'd like to test with
Provisioning Profiles
Go to "Provisioning Profiles" and add a new one
Select "Ad Hoc" for the profile type (you will also want to create a provisioning profile for development purposes)
Select the Ad Hoc App ID you created
Select your signing certificate for distribution
Note: This is a different type of certificate than the APS certificates generated in this guide, but the OpenSSL steps to generate it (above) are the same
Select the devies you want to allow
Enter the profile name: YourApp Ad Hoc
Download the provisioning profile file and open it, which will import the file into "~/Library/MobileDevice/Provisioning Profiles/UUID.mobileprovision"
Final Steps
After following the above steps, you should files that are something similar to the following:
In addition to the above files, you'll want to keep track of your own iOS signing certificates which are split out into development and production versions. For development, you can generally re-use these certifiates across all of the apps in your account but it may be advisable to create separate production signing certificates for App Store releases.
You may generate your signing certificates using the same openssl-based steps above for creating the push certificates. Note: If you used the above commands, you'll need to import the .cer and .p12 files into your keychain in order for Xcode to be able to sign your apps.
Testing
To test connecting to the APNS gateway (the development sandbox in this case):
To get push notifications working with over-the-air builds, you need to create and use a production certificate. (The development certificates are intended to be used when installing your app directly from Xcode/organizer and will provide extra debug information.)
Tools
Here are some tools to help you with APNS :+1:
Knuff: The debug application for Apple Push Notification Service
PEM: Automatically generate and renew your push notification profiles
Có — dkhamsing/apns-guide phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/dkhamsing/apns-guide.
dkhamsing/apns-guide là gì?
dkhamsing/apns-guide (dkhamsing/apns-guide) là dự án đa ngôn ngữ trên GitHub. Theo mô tả gốc: :bell: Guide to setup APNS
Đọc thêm về dkhamsing/apns-guide ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/dkhamsing/apns-guide là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về apns-guide?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về apns-guide.