首页 > 解决方案 > 是否可以通过 APNS 向通过 FCM 生成的设备令牌发送推送通知?

问题描述

在项目中,我使用 FCM 为 IOS 和 Android 生成设备令牌。并推送通知。在我的研究中,我发现推送通知可以发送https://fcm.googleapis.com/fcm/send

但是是否可以通过使用 APNSapi.sandbox.push.apple.com向 FCM 生成的令牌发送推送通知到 IOS 设备?

苹果文档链接

标签: androidiosfirebase-cloud-messagingapple-push-notifications

解决方案


不能。Api.sandbox.push.apple.com 只能与 Apple 生成的令牌一起使用。您需要使用 didRegisterForRemoteNotificationsWithDeviceToken 在客户端中获取 Apple 令牌并将其发送到您的服务器。顺便说一句,Firebase SDK 正是这样做并获取此令牌以发送 iOS 通知。对于每个 FireBase 令牌,他们从设备中获取相关的 Apple 令牌并在连接到 Apple 服务器时使用它。


推荐阅读