Xamarin.Forms: In-App Updates not find new releases

I would like to use In-App Updates to distribute public updates via AppCenter.
I followed this guide carefully:

https://docs.microsoft.com/en-us/appcenter/sdk/distribute/xamarin

and I configured the AppCenter Distribute module in the native application as follows:

protected override void OnCreate(Bundle bundle)
{
  base.OnCreate(bundle);

  Distribute.ReleaseAvailable = OnReleaseAvailable;    
  Distribute.NoReleaseAvailable = OnNoReleaseAvailable;
  Distribute.SetEnabledForDebuggableBuild(true);  

  AppCenter.LogLevel = LogLevel.Verbose;
  AppCenter.Start("android= [ ... ]", typeof(Analytics), typeof(Crashes), typeof(Distribute));
         
  LoadApplication(new App());
}

private bool OnReleaseAvailable(ReleaseDetails releaseDetails)
{
 string versionName = releaseDetails.ShortVersion;
 string versionCodeOrBuildNumber = releaseDetails.Version;
 string releaseNotes = releaseDetails.ReleaseNotes;
 Uri releaseNotesUrl = releaseDetails.ReleaseNotesUrl;

 // custom dialog
 var title = "Version " + versionName + " available!";
 Task answer;

 // On mandatory update, user can't postpone
 if (releaseDetails.MandatoryUpdate)
 {
     answer = App.Current.MainPage.DisplayAlert(title, releaseNotes, "Download and Install");
 }
 else
 {
     answer = App.Current.MainPage.DisplayAlert(title, releaseNotes, "Download and Install", "Maybe tomorrow...");
 }

 answer.ContinueWith((task) =>
 {
     // If mandatory or if answer was positive
     if (releaseDetails.MandatoryUpdate || (task as Task<bool>).Result)
     {
         // Notify SDK that user selected update
         Distribute.NotifyUpdateAction(UpdateAction.Update);
     }
     else
     {
         // Notify SDK that user selected postpone (for 1 day)
         // This method call is ignored by the SDK if the update is mandatory
         Distribute.NotifyUpdateAction(UpdateAction.Postpone);
     }
 });

 // Return true if you're using your own dialog, false otherwise
 return true;
}

private void OnNoReleaseAvailable()
{
AppCenterLog.Info("Log", "No release available callback invoked.");
}      

However, the OnReleaseAvailable method is never triggered.
This is the AppCenter log when the AppCenter.Start() method is called:

[AppCenter] HTTP response status=404 payload={"code":"not_found","message":"Error: No public releases found for appId: 67168064-b072-430e-b513-25171d1e8b5d"}
[AppCenterDistribute] No release available to the current user.
[AppCenterDistribute] Calling listener.onNoReleaseAvailable.

The new release has been correctly submitted on Google Play store through AppCenter and the update is available. Therefore, why is the release never found?

Source: Android Questions

LEAVE A COMMENT