Perform the following steps to implement iOS push notifications.
Click "+" sign to create a new push notification certificate.
- For the development environment, please select Apple Push Notification service SSL (Sandbox).
- For the production environment, please select Apple Push Notification service SSL (Sandbox & Production).
In this case, we use the App ID, "io.hyphenate.demo.im", created under the tab Identifiers, App IDs -> "+" sign to create new app ID.
- Open Keychain Access app. Go to finder → Application folder → Utilities → Keychain Access
- Under the Keychains, select the tab login
- Under the Category, select the tab My Certificates
- Two types of environments:
Apple Development IOS Push Services:io.hyphenate.demo.im
Apple Push Services: io.hyphenate.demo.im
- Export the desired P12 certificate by right-clicking on the certificate and make sure you set a password for certificate
- This push certificate name will be used directly as the identifier in the source code,
let options: EMOptions = EMOptions(appkey: appKey) options.apnsCertName = apnsCertname let error:EMError? = EMClient.shared().initializeSDK(with: options)
- Upload the Push Certificate Exported from Step 1.
- Enter the password of the
- Select the corresponding Certificate Type,
- Click the Upload button
Congratulations!! You have successfully setup the environment for the iOS push notification service!!
Next Section: Customize Push Notification
Updated 2 years ago