【问题标题】:Local notifications using ACR notifications plugin in xamarin在 xamarin 中使用 ACR 通知插件的本地通知
【发布时间】:2018-01-09 10:28:00
【问题描述】:

我正在使用适用于 xamarin 的 ARC 通知插件创建一堆通知,并且所有通知都会在我打开应用程序后立即发送,尽管我将日期和时间设置为距当前日期至少一天。我的问题是,如何设置通知模型,以便我在指定的日期/时间收到通知?

var notif = new Notification(){
        Id = count++,
        Date = item.PostDate.Date,
        Title = item.Type.Equals(DayType.Duminica)
            ? item.Title
            : $"{item.Title} {Helpers.GetCurrentDateOldFormat(item.PostDate.AddDays(-13))}",
        Message = item.Content,                                
        When = App.Settings.NotificationTime // new TimeSpan(08, 00, 00)
};

【问题讨论】:

  • 是 ARC 还是 ACR 通知?

标签: xamarin notifications local


【解决方案1】:

试试这个,它会帮助你。

发送预定通知:

App.Settings.NotificationTime = TimeSpan.FromDays(50); 

var id = await CrossNotifications.Current.Send(
    item.Type.Equals(DayType.Duminica) ? item.Title : $"{item.Title} {Helpers.GetCurrentDateOldFormat(item.PostDate.AddDays(-13))}",
    item.Content,
    when = App.Settings.NotificationTime);

欲了解更多信息click here

【讨论】:

  • 感谢您的回复。我们迁移到推送通知,这是一个更好的选择。
  • 如何设置通知时间?
猜你喜欢
  • 1970-01-01
  • 2017-03-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-11
  • 2021-10-16
相关资源
最近更新 更多