简体   繁体   中英

How to configure Push Notification for an iOS app using APNs key (.p8)

I'm trying to configure an app to use Push Notifications using Firebase. From the firebase console, the recommended method to configure an ios app is to use a p8 certificate (APNs key).

I can create the p8 key from apple developer console, then upload it to Firebase for my app.

What seems to be missing is the part where I authorize my app to use Push Notifications. From the apple console, the only option is to create development and production certificates, which are completely unrelated to the p8 key.

How can I authorize push in my app using p8 key?

Without a doubt the P8 is the best way to go.

Apple insist that developers should use "Token Based Authentication" instead of the traditional P12 for push notification.

You should authorize your App, regardless, this a very easy and straightforward process. Both by activating the console switch and Enable the Push Notifications Capability on Xcode, I quote Apple:

Apps must have the proper entitlements to use push notifications. To add these entitlements to your app, enable the Push Notifications capability in your Xcode project

在此处输入图片说明

And remember to match the certificates scope, classic mistake: Production = Production , etc.

Should you need any further assistance please reply or comment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM