简体   繁体   English

如何将Azure Notification中心迁移到Firebase云消息传递?

[英]How to migrate Azure Notification hub to Firebase Cloud Messaging?

I used Azure Notification Hubs with my custom .NET backend with Apple's push notification service and Google Cloud Messaging. 我使用Azure Notification Hubs和我的自定义.NET后端以及Apple的推送通知服务和Google Cloud Messaging。 That means, my client app registers itself with Apple's or Google's services but notifications will be sent by Notification Hub via the backend and never directly via the vendors' services. 这意味着,我的客户端应用程序使用Apple或Google的服务注册自己,但通知将由Notification Hub通过后端发送,而不是直接通过供应商的服务发送。

Now that GCM is no longer supported, I tried to migrate it over to FCM. 现在不再支持GCM,我尝试将其迁移到FCM。

In the Firebase console I created a new project. 在Firebase控制台中,我创建了一个新项目。 The project has a name, a public facing name, a project ID and a Web API Key. 该项目具有名称,面向公众的名称,项目ID和Web API密钥。 All of this is information from the general tab. 所有这些都是来自常规选项卡的信息。

In the "Cloud Messaging" tab I am presented a server key and a sender ID. 在“云消息传递”选项卡中,我显示了服务器密钥和发件人ID。

Question 1: What do I have to paste into Azure's push notifications settings where my GCM key was used before? 问题1:我需要将哪些内容粘贴到之前使用GCM密钥的Azure推送通知设置中? The Web API key from "General" or the server key from "Cloud Messaging"? 来自“常规”的Web API密钥或来自“云消息传递”的服务器密钥?

Question 2: My Xamarin.Android client app had to provide the "Google API Project Number" as the sender ID for GCM, in order to register itself for push notifications. 问题2:我的Xamarin.Android客户端应用程序必须提供“Google API项目编号”作为GCM的发件人ID,以便为推送通知注册自己。 Should this now be changed to use the "sender ID" from the "Cloud Messaging" tab in the Firebase Console? 现在是否应该更改为使用Firebase控制台中“云消息传递”选项卡中的“发件人ID”?

Question 1 : Yes, use the Server Key from the Cloud Messaging Tab . 问题1 :是,使用Cloud Messaging选项卡中服务器密钥 Since both GCM and FCM only works using a Server Key. 由于GCM和FCM仅使用服务器密钥。

Question 2 : Yes. 问题2 :是的。 Since you have to use the corresponding/correct Sender ID in order to properly register your client app to the right project. 由于您必须使用相应/正确的发件人ID才能将您的客户端应用程序正确注册到正确的项目。


On a side note, if you originally had a project in Google Developers Console, why not just Import it to Firebase Console? 另外,如果您最初在Google Developers Console中有项目,为什么不将其导入 Firebase控制台? Also, GCM is still supported has been officially deprecated . 此外, 仍支持 GCM已被正式弃用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM