What is the “keyID” when using APNs push service

纵饮孤独 提交于 2019-11-30 01:04:44

问题


Usually there are 3 info I need to provide, to use Apple APNs: key, keyId, teamId, like here.

I understand key (pem file location) and teamId, but where do I find keyId? Is this somewhere in https://developer.apple.com ? Is this the bundle ID?


回答1:


key: 'apns.p8',   // Path to the key p8 file
keyId: 'ABCDE12345', // The Key ID of the p8 file (available at https://developer.apple.com/account/ios/authkey/)
teamId: 'ABCDE12345', // The Team ID of your Apple Developer Account (available at https://developer.apple.com/account/#/membership/)

You can find more on : https://eladnava.com/send-push-notifications-to-ios-devices-using-xcode-8-and-swift-3/




回答2:


If one don't have Key ID at https://developer.apple.com/account/ios/authkey, he or she can follow this steps to create it:

1) Go to Developer Account aka Member Center > Certificates, IDs & Profiles > Keys / All > press the "+"

2) Enter Name and check APNs. The key is the same among your apps, so don't add app name to the key name. Click Confirm.

3) Download the key and be careful with it. Here you can see the Key ID (kid) value.




回答3:


Key ID can also be derived from the name of the file for the key. Your file with the key will probably be named something like: AuthKey_ABC1DEF11G.p8, so ABC1DEF11G is the key ID.

Team ID can be found on the Apple account webpage (upper right corner).



来源:https://stackoverflow.com/questions/40621097/what-is-the-keyid-when-using-apns-push-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!