Xamarin Forms - Cannot get In-app Updates from App Center to work
Hey!
I have an app in Xamarin Forms (Android & iOS), which is distributed in App Center. I'm trying to enable the option to perform an in-app update when a new build has been completed, but I cannot get this to work. I'm using the tutorial on Microsoft Learn: https://learn.microsoft.com/en-us/appcenter/sdk/distribute/xamarin#remove-in-app-updates-for-google-play-builds
What I tried to build is the option to manually check for updates by pressing on a button. This button is just doing..nothing when I press it, but maybe someone here had that problem before as well.
The code that I have are given below. This example is for Android first (since I'm testing on a phyical Android device), but it should work for iOS as well.
Packages
So first I have installed the App Center Distribution package. Not the latest version (4.2.0), since the build is App Center fails then because it cannot handle version 4.1.0+ (I spoke to someone from App Center to confirm this).
App.cs
Then in App.cs, I have the following code:
Where OnReleaseAvailable is the following (literally from the docs):
MainActivity (Android)
Then in the Android MainActivity, I added the option to enable this for debug builds:
Check for Update option
Then I have a button on a ContentPage to check for updates:
I believe I have everything then for this option, but when I press the button nothing happens, update found or no update found.
Does someone know what I'm missing here?
Best,
Ganesh