GCM 的唯一变化 -> FCM 迁移文档 需要 正在更改端点:
更新您的服务器代码以使用新的 FCM 端点通过 HTTP 和 XMPP 发送消息...可选,您可能需要评估 FCM HTTP v1 API,它提供改进的安全模型和新功能,用于自定义跨域的消息
但视频似乎讲述了一个不同的故事:
我将需要更新到一个新的更安全的服务器密钥,我可以从 firebase 控制台获取它...下载服务帐户凭据然后我会将 JSON 文件拖到我的项目中...用此服务帐户密钥替换 GCM API 密钥我将更新我的 HTTP 标头以使用此访问令牌...
在向新的 FCM 端点发送请求时,我们是否可以继续使用 GCM 服务器 api 密钥,或者我们是否需要更新到从 FCM 控制台获取的更安全的服务器密钥"?
解决方案您指出的 GCM 文档有点(没那么)旧.它显示了从 GCM 迁移到 FCM Legacy 时需要更改的内容.Jen Person 在视频中展示的是当您使用 FCM v1(参见 8:19 上的 uri).p>
我们可以在向新的 FCM 端点发送请求时继续使用 GCM 服务器 api 密钥,还是我们需要更新到从 FCM 控制台获得的更安全的服务器密钥"?p>
来自我的评论这里(有少量更新):
根据您使用的 GCM API 密钥类型(如果这是一个非常古老的项目,您可能仍在使用不同类型的密钥),它可能无法正常工作.无论如何,在您将 GCM 项目导入到 Firebase 后,它可能会生成您可以(并且应该)使用的必要 API 密钥(对于这个问题的服务器密钥),以便 FCM 工作.
The only change that the GCM -> FCM migration doc requires is changing the endpoint:
Update your server code to use new FCM endpoints for sending messages via HTTP and XMPP... Optionally, you may want to evaluate the FCM HTTP v1 API, which offers an improved security model and new capabilities for customizing messages across
But the video seems to tell a different story:
I'll need to update to a new more secure server key which I can get from the firebase console... download the service account credentials then I'll drag the JSON file into my project... replace the GCM API key with this service account key I'll update my HTTP header to use this access token...
Can we continue to use the GCM server api key when sending requests to the new FCM endpoint or do we "need to update to a more secure server key" obtained from the FCM console?
解决方案The GCM documentation you pointed out is kinda (not that much) old. It shows what needs to change when migrating from GCM to FCM Legacy. What Jen Person showed in the video is when you are to use FCM v1 (see the uri on 8:19).
Can we continue to use the GCM server api key when sending requests to the new FCM endpoint or do we "need to update to a more secure server key" obtained from the FCM console?
From my comment here (with minor updates):
Depending on which type of GCM API Key you were using (if this is a reeeaally old project, you might still be using a different type of Key), it may not work. Regardless, after you import your GCM project to Firebase, it would probably generate the necessary API Keys (Server Key for this matter) that you could (and should) use in order for FCM to work.
更多推荐
服务器 api 密钥:迁移文档与迁移视频
发布评论