【发布时间】:2019-04-08 09:26:21
【问题描述】:
已在所有 iOS 设备上收到 FCM 通知。但是通知在大约 1 年前注册的某些设备上不起作用。 FCM 令牌和 APNs 令牌似乎没有改变。为什么没有到达通知? FCM 令牌是否必须过期?
XCode 10.1、Firebase 5.20.1
1.AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
```
Messaging.messaging().delegate = self
```
}
func application(application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
```
Messaging.messaging().apnsToken = deviceToken
```
```
//store fcmtoken and apnstoken
```
}
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
```
//store fcmtoken and apnstoken
```
}
2.info.plist
FirebaseAppDelegateProxyEnabled = No
FCM 令牌和 APNs 令牌没有变化,但在大约 1 年前安装的某些设备上无法收到通知。
【问题讨论】:
-
只需更新您在 Apple 帐户上的证书和配置文件
-
非常感谢。但我使用身份验证密钥。我不使用证书,并且仅将配置文件用于测试。 Configuring APNs with FCM
标签: ios swift firebase apple-push-notifications firebase-cloud-messaging