在安装类中,我已根据需要添加了两个新列ContactID
和UserEmail
。
现在发送推送通知时,我想查询某些ContactID
或UserEmail
。
parse.dll 提供的推送功能如下:
SendAlertAsync(string alert, ParseQuery<ParseInstallation> query);
ParseInstallation
类具有预定义的属性。如何添加我的两个新属性并构建ParseQuery?
答案 0 :(得分:0)
在这里找到答案
https://parse.com/docs/dotnet/guide#push-notifications-using-advanced-targeting
var push = new ParsePush();
push.Query = from installation in ParseInstallation.Query
where installation.Get<int>("ContactID") == 12
select installation;
push.Alert = "Willie Hayes injured by own pop fly.";
await push.SendAsync();
或
await ParsePush.SendAlertAsync("Hi this is test message", new ParseQuery<ParseInstallation>()
.Where(i => i.Get<string>("UserEmail") == "abc@gmail.com"));