我正在从C#Web应用程序向Android设备发送推送通知

时间:2018-07-19 11:57:57

标签: c# android azure push-notification

我正在创建应用程序,以使用firebase和天蓝色的通知中心将推送通知发送到Android设备。

如何在我的代码中使用RegistrationID存储Push.RegisterAsync ... 这里的RegistrationId是由firebaseinstanceID Refresh Token which is every time new So how Can I handle that id`生成的,用于向已注册的设备发送通知?

var refreshedToken = FirebaseInstanceId.Instance.Token;

var templates = new JObject();
templates["genericMessage"] = new JObject
{
    { "body", templateBodyFCM }
};

var client = new MobileServiceClient(HalalApps.App.MobileServiceUrl);
var push = client.GetPush();
await push.RegisterAsync(refreshedToken, templates);

0 个答案:

没有答案