none
Windows app for 8.1 background task cannot work after reboot

    Question

  • We meet a issue when using background task on windows app for 8.1.

    We found that background task which register by time trigger cannot work after reboot on Windows 8.1 device.

    Before reboot device it works well which setting time trigger value is 15 minutes.

    Does any suggestion for this issue, thanks in advance.

    Here display some codes:

    Register background task codes:

    await BackgroundExecutionManager.RequestAccessAsync();
    var builder = new BackgroundTaskBuilder();
    builder.Name = "SampleBackgroundTask";
    builder.TaskEntryPoint = "Tasks.SampleBackgroundTask";
    builder.SetTrigger(new TimeTrigger(15, false));
    BackgroundTaskRegistration task = builder.Register();

    Run method codes:

    var deferral = taskInstance.GetDeferral();
    
    IToastText02 toastContent = ToastContentFactory.CreateToastText02();
    toastContent.Launch = "SampleLaunch";
    toastContent.TextHeading.Text ="Sample Test"
    toastContent.TextBodyWrap.Text ="Sample Test Content"
    toastContent.Duration = ToastDuration.Long;
    toastContent.Audio.Loop = true;
    toastContent.Audio.Content = ToastAudioContent.LoopingAlarm;
    ToastNotification toast1 = toastContent.CreateNotification();
    ToastNotificationManager.CreateToastNotifier().Show(toast1);
    
    deferral.Complete();





    • Edited by Tony Yang J Tuesday, November 27, 2018 6:45 AM
    Tuesday, November 27, 2018 3:23 AM

All replies

  • Hello Roy,

    I can reproduce this issue in win8.1 device.

    But for win10, it seems works fine.

    Best regards

    Jerry


    .Net Windows C#

    Wednesday, November 28, 2018 10:40 AM
  • Hi,

    I made a test again with the official windows 8.1 background sample. It could works well in my windows 10 device. Could you please make a try to use the official to test again?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 5, 2018 9:44 AM
    Moderator
  • Roy,

    I already said it not work in windows 8.1 device and it works well in windows 10 device.

    So could you please try it in win8.1 device?

    Best regards,

    Jerry


    .Net Windows C#

    Wednesday, December 5, 2018 10:09 AM
  • Hi,

    I have to say there is no Windows 8.1 device here in my side. You might need to report this in the FeedBack Hub. You could find it in the Start Menu.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 7, 2018 7:53 AM
    Moderator
  • Hi Roy

    Could you provide the link to FeedBack Hub, thanks.

    Best regards,

    Tony

    Friday, December 7, 2018 9:13 AM