Search code examples
c#uwpwindows-10-mobilebackground-task

Windows 10 Mobile App background task or service auto start when phone restarts


I am writing a Windows 10 Mobile App (c#); it’s a notification/alarm app; I was wondering can I run a background service or task or scheduler which can trigger alarms or notifications. I am looking for something similar to windows services, so even when my phone restarts, that service or background task starts automatically and continuously run and show notifications to user. I have created windows 10 runtime (background task) but they stop when I restart my phone. How to automatically start a background task or windows mobile service. (It’s a windows 10 mobile app).


Solution

  • I have created windows 10 runtime (background task) but they stop when I restart my phone.

    Since your background task is for triggering alarms or notifications, theoretically speaking, your background task should not be stopped when you restart your phone. Once the background task is registered, your background task should work until you unregister it or user turn off it, unless there are resource constraints which can force your background task stops.

    Based on your description, you can try Periodic notification, this notification should also not be effected by restarting of your device.

    How to automatically start a background task or windows mobile service. (It’s a windows 10 mobile app).

    I don't know what cause your background task be stopped when your device is restarted, but most of the background tasks can automatically be started by system. By mobile service, I'm not clear what you referred to, if it is the app service like Azure, you can use Push notifications, if it is the local app service, I personally think this is not quite suitable for your scenario.