Update Checker in UWP

Vishvanathan K 46 Reputation points
2021-03-23T11:58:09.267+00:00

Hi,
I had installed the journal app(the new one ) from Microsoft Store. So presumably it is an UWP.
And how do I have an update checker in my UWP app.
Like this,
80639-image.png

So that I would alert my app users to update to the latest version,
Thanks,
Vishvanathan K

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,866 Reputation points
    2021-03-24T01:43:19.247+00:00

    Hello,

    Welcome to Microsoft Q&A.

    If you have submitted the app to the Microsoft Store, then you can check the updates through StoreContext.

    This document may help you:

    Download and install package updates from the Store

    private StoreContext context = null;  
      
    private async void Button1_Click(object sender, RoutedEventArgs e)  
    {  
         
        if (context == null)  
        {  
            context = StoreContext.GetDefault();  
        }  
      
        // Get the updates that are available.  
        IReadOnlyList<StorePackageUpdate> updates =  
            await context.GetAppAndOptionalStorePackageUpdatesAsync();  
      
        if (updates.Count > 0)  
        {  
            
        // has available update   
        }  
    }  
    

    Currently GetAppAndOptionalStorePackageUpdatesAsync can't use to check the new version number in store, you just use it to notify user, it has update now, and then use StoreContext.GetAppAndOptionalStorePackageUpdatesAsync to get update.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vishvanathan K 46 Reputation points
    2021-03-24T07:07:59.23+00:00

    Thanks for the link and answer @Nico Zhu (Shanghai Wicresoft Co,.Ltd.)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.