【发布时间】:2017-02-07 10:41:45
【问题描述】:
我正在使用 Xamarin.Fomrs PLC 项目,我正在尝试显示通知,即使应用程序已关闭,现在它在应用程序运行时工作正常,因为我将通知线程放在 @987654321 @,即使应用程序关闭,我应该怎么做才能使通知正常工作
关于下面的代码要更清楚:
namespace X
{
public class App : Application
{
INotificationService service;
}
void CheckNotifications ()
{
service = DependencyService.Get<INotificationService> ();
service.Notify (message);
System.Threading.Thread.Sleep (1000 * 60);
}
protected override void OnStart ()
{
var threadStart = new System.Threading.ThreadStart (CheckNotifications);
var thread = new System.Threading.Thread (threadStart);
thread.IsBackground = true;
thread.Start ();
}
}
【问题讨论】:
标签: android xamarin.forms portable-class-library