我已将 Facebook 分析与 Facebook 通知一起集成到我的 iOS 应用程序中。
当我尝试使用我得到的设备 token 向设备发送测试推送通知时
"The device token does not match the environment of the certificate. For example, the device token is created by development build but the uploaded push certificate is for production. Uploading a universal push certificate is recommended."
证书和 token 都是开发的,并且可以通过 firebase 完美运行。有什么想法吗?
最佳答案
我认为您可能会使用您的 FCM token 作为 facebook 推送事件所需的“设备 token ”。 使用“didRegisterForRemoteNotificationsWithDeviceToken”方法的设备 token 发送通知。
此代码可能对您有所帮助,请尝试将此“deviceTokenString”放入 facebook 的设备 token 字段中。
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Convert token to string
let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
}
关于ios - Facebook 测试推送通知 "Device token does not match the environment",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46200558/