1
votes

I implemented background tasks on Windows Phone 8.1 (No Silverlight) into my Xamarin Forms project and it works fine unless you reboot your device.

About the project:

Xamarin Forms project (with the lastest XF library)

WinRT project added to create the background tasks.

I have modified the manifest on the WP project in order to set the new background task as the tutorials explain.

My device: NOKIA Lumia 925 - Windows Phone 8.1

When I run my app it works fine, I close it and every 15 minutes a notification is fired. However I reboot my device and the background task disappears. The App was deployed on Release and Debug mode too, I have given permissions to "Run on Background mode event when battery saver is on".


Test Concept:

Also I have found a very odd behaviour, using a test WinPhone 8.0 project I tryed to add a Scheduled Task Agent (with Silverlight) project and for some reason it was added as "Scheduled Task Agent (Windows Phone 8.0)" and this agent keep my background tasks after rebooting and all worked fine. I think WinPhone 8.0 always use Silverlight, please correct me if I am wrong!

I tryed to to the same way with my WinPhone 8.1 (no Silverlight) project with the Scheduled Task project added using Silverlight and I could not reference it because they are different compiled dlls (Silverlight DLLs and .NET CLR) which is correct.

Any idea to keep my task after rebooting?

Thanks in advance!

1

1 Answers

0
votes

According to this question:

"The only way for an application to be started in Windows Phone 7 is in response to a user action."

Is there something like AlarmManager(Android) in WindowsPhone7 mango, which will launch the app when the alarm goes off?

For Windows Phone 8 and according to this another question, there is a "Background Agent" which you can set every 30 min or so:

is there any boot complete event in windows phone 8

Hope this helps.