title: Set multiple triggers to background task
body: <p>I have problem setting more then one trigger to my background task. Is it allowed to set multiple triggers to one task? I can't find any documentation about working with more than one SetTrigger statements.</p>
  
  <p>The problem is that, when I run my app, myTrigger fires as I want it to, but the TimeTrigger won't fire. I've let it run during whole night but without any change. It hasn't started.</p>
  
  <p>MainPage.xaml.cs:</p>
  
  <pre><code>builder.SetTrigger(new TimeTrigger(15, false));
  builder.SetTrigger(myTrigger);  
  ...
  await myTrigger.RequestAsync();
  </code></pre>
  
  <p>Thank you very much.</p>
  
  <p>EDIT (Firing only <code>syncTrigger</code> still. I'm waiting for almost hour.):</p>
  
  <pre><code>ApplicationTrigger syncTrigger = new ApplicationTrigger();
  
  private void InitBackgroundTasks()
  {
      IBackgroundCondition m_BKTaskCondition = new SystemCondition(SystemConditionType.InternetAvailable);
  
      var triggers = new List&lt;IBackgroundTrigger&gt; { new TimeTrigger(15, false), syncTrigger };
      var conditions = new List&lt;IBackgroundCondition&gt; { m_BKTaskCondition };
  
      var registrations = RegisterBackgroundTask(typeof(BackgroundSync).ToString(), nameof(BackgroundSync), triggers, conditions).ToList();
  
      registrations = registrations;
      // Both triggers are null
  
  }
  
  public IEnumerable&lt;BackgroundTaskRegistration&gt; RegisterBackgroundTask(string taskEntryPoint, string TaskName, IReadOnlyList&lt;IBackgroundTrigger&gt; triggers, IReadOnlyList&lt;IBackgroundCondition&gt; conditions)
  {
      var builder = new BackgroundTaskBuilder();
  
      builder.Name = TaskName;
      builder.TaskEntryPoint = taskEntryPoint;
  
      BackgroundTaskRegistration registeredTask = null;
  
      foreach (var condition in conditions)
      {
          if (condition != null)
          {
              builder.AddCondition(condition);
          }
      }
  
      foreach (var trigger in triggers)
      {
          if (trigger != null)
          {
              builder.SetTrigger(trigger);
          }
  
          try
          {
              registeredTask = builder.Register();
          }
          catch (Exception ex)
          {
              Debug.WriteLine("Error: RegisterBackgroundTask - {0}\n\n", ex.Message);
          }
  
          yield return registeredTask;
      }
  }
  </code></pre>
  
  <p>TimeTrigger look fine, but syncTrigger don't - weird.
  <a href="https://i.stack.imgur.com/dshvp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dshvp.png" alt="enter image description here"></a></p>