ios - Facebook 测试推送通知 "Device token does not match the environment"

标签 ios objective-c swift xcode facebook

我已将 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/

相关文章:

ios - 如何在使用 NSURLSession 时传递凭据

ios - JSON 抛出错误

android - 如何在iOS设备上运行Android Studio开发的flutter应用?

objective-c - 将焦点放在输入字段时停止自动调整 uiwebview web 内容的大小

ios - 如何在拖动另一个按钮时检测 View 中的 UIButton?

swift - 当 facebook graph api 本地化时如何从相册中获取个人资料图像

ios - 为什么我的单元格数据没有显示在 UITableView 中?

ios - 如何使 splitViewController 在所有设备上表现相同

ios - UIScrollView 中的多个 AVPlayer - 只显示了其中的 16 个

ios - Swift:将 [String] 拆分为具有给定子数组大小的 [[String]] 的正确方法是什么?