Firebase + APNs Authentication Key

最近個 app 上咗 Apple App Store 之後就收唔倒 Firebase 嘅 Push Notifications,我知道 APN Cert 有分 Development 同 Production,我隻 app Development 就無問題,但係 Production 就整嚟整去佢都係收唔倒,搞搞下,我就諗,不如試下 APNs Authentication Key,用佢就唔使分 Development 定係 Production 啦!一於試下:

首先去 Apple Developer Console 整條 APNs Auth Key 出嚟,Keys > All > + 俾個名佢,我用 APNsAuthKey,用一個 中性啲嘅名,因為同一個 Key 可以用喺你所有 apps 都得,冇分嘅。要選第一個 choice。
花一秒時間去確認一下你真係要? 搞掂,抄低個 Key ID,然後 Download 個 .p8 檔案。
去你個 Firebase Console,改你隻 iOS app 嘅資料,我目前係分別用兩張 Certs,APNs Authentication Key 冇上資料。Click UPLOAD。 紅色警示,用咗 APNs Auth Key 就癈咗其餘兩張 Certs。Browse 去選你張 Cert(Key 即是 Cert,Cert 即是 Key),Key ID 啱啱抄低嗰個。
搞掂。 個 Xamarin iOS app 有兩度要改嘅,第一個係 Info.plist 入面要加一個 metadata:FiresbaseAppDelegateProxyEnabled = false(我之前之所以唔得,可能同佢有關)。
Entitlements.plist 要改 metadata: abs-environment = production。

唔講你唔信,整完就成功收到 Push Notifications!