Ich benutze Xamarin.Fomrs SPS-Projekt, ich versuche, eine Benachrichtigung zu zeigen, sogar App geschlossen ist, im Moment funktioniert es gut, wenn App läuft, weil ich setze den Notification Thread auf OnStart()
, was ich tun soll Benachrichtigung arbeiten zu machen, auch wenn App geschlossen istXamarin.Forms Wie man eine Benachrichtigung zeigt, wenn App geschlossen ist
auf der A kurzen Code nach deutlicher zu sein:
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();
}
}