internal class jsonObj
{
//public bool delay_while_idle { get; set; }
public data data { get; set; }
public notification notification { get; set; }
public string to { get; set; }
public string priority { get; set; }
}
internal class data
{
public int Id { get; set; }
public int commentId { get; set; }
public string type { get; set; }
public string DisplayName { get; set; }
public string licensePlateCode { get; set; }
public int licensePlateId { get; set; }
public string text { get; set; }
}
internal class notification
{
public string title { get; set; }
public string body { get; set; }
public string sound { get; set; }
public string badge { get; set; }
[JsonProperty("content-available")]
public string contentAvailable { get; set; }
}
1 回答
也许如果有帮助,这就是我用来为IOS和Android发送通知的(C#)对象 .
在编写代码的那一刻,我在android中使用了旧的
WakefulBroadcastReceiver
和IntentService
,不再推荐了 . 但如果有兴趣,它看起来像this questionEDIT: OP评论了this post on github . 那里描述了同样的问题,但仍未解决(2016年9月) . 可以在那里找到解决方法,您必须发送不同的IOS和Android请求 .