2017-03-15 95 views
1

我创建了一个非常简单的应用程序UWPUWP瓷砖刷新超时

public MainPage() 
    { 
     this.InitializeComponent(); 
     // In a real app, these would be initialized with actual data 
     string from = "Jennifer Parker"; 
     string subject = "Photos from our trip"; 
     string body = "Check out these awesome photos I took while in New Zealand!"; 


     // Construct the tile content 
     TileContent content = new TileContent() 
     { 

      Visual = new TileVisual() 
      { 

       TileMedium = new TileBinding() 
       { 
        Content = new TileBindingContentPhotos() 
        { 
         Images = 
      { 
       new TileBasicImage() 
       { 
        Source = "Assets/images-15.jpg" 
       }, 

       new TileBasicImage() 
       { 
        Source = "Assets/images-7.jpg" 
       }, 

       new TileBasicImage() 
       { 
        Source = "Assets/trolltunga.jpg", 

       } 

       // TODO: Can have 12 images total 
      } 
        } 
       } 

       // TODO: Add other tile sizes 
      } 
     }; 
     var notification = new TileNotification(content.GetXml()); 
     TileUpdateManager.CreateTileUpdaterForApplication().Update(notification); 
    } 

所以应用程式只是为了检查长瓦将如何更新。所以我读到这个瓷砖会一直更新,但是在1-2天之后更新了停滞更新(无法正确检查)。所以我的问题是 - 有人知道瓷砖的生命周期更新吗?我找到了关于后台任务的信息,但是这个tile不使用后台任务

回答

1

要发送一个通知给tile,使用TileUpdateManager为主tile创建一个tile更新器,并通过调用“Update ”。无论它是否可见,您的应用的主要磁贴始终存在,因此您可以发送通知给它,即使它没有固定。如果用户稍后固定主要磁贴,则会发送您发送的通知。在修改图块之前,图块的内容不会改变。

我找到了关于后台任务的信息,但是这个tile不使用海关后台任务。

平铺使用的背景任务不是特别的。用于每15分钟更新瓷砖内容的正常后台任务形成article。使用后台任务的目的是确保在应用程序暂停时更新瓦片的内容。你也可以使用PushNotificationTrigger从网页服务器动态更新图块。

所以我看书上说这种瓷砖将更新所有的时间,但瓷砖后1-2天

By default,当地的瓷砖和徽章通知不会过期采空更新,而推,周期和预定的通知在三天后过期。因为平铺内容不应该持续比所需时间更长的时间,所以最好设置一个对您的应用有意义的截止时间,特别是在本地平铺和徽章通知上。