diff --git a/src/SharedMauiCoreLibrary.Licensing/LicenseManager.cs b/src/SharedMauiCoreLibrary.Licensing/LicenseManager.cs index 7a7c4b9..ba5739c 100644 --- a/src/SharedMauiCoreLibrary.Licensing/LicenseManager.cs +++ b/src/SharedMauiCoreLibrary.Licensing/LicenseManager.cs @@ -354,11 +354,13 @@ public async Task GetLatestApplicationVersionAsync(IL WooCodeVersionResponse[] wooResult = await QueryLatestApplicationVersionFromWooCommerceAsync(WooSoftwareLicenseAction.CodeVersion, license).ConfigureAwait(false); if (wooResult?.All(result => result.Status == "success" && (result.ErrorCode == "s403")) == true) { + WooCodeVersionResponse res = wooResult.First(); result = new() { Success = true, - //Message = string.Join("|", wooResult?.Select(result => result.VersionMessage)), + Message = res.VersionMessage.UpgradeNotice, TimeStamp = DateTimeOffset.Now, + Version = res.VersionMessage.Version }; } else @@ -394,11 +396,13 @@ public async Task GetLatestApplicationVersionAsync(st WooCodeVersionResponse[] wooResult = await QueryLatestApplicationVersionFromWooCommerceAsync(WooSoftwareLicenseAction.CodeVersion, productCode).ConfigureAwait(false); if (wooResult?.All(result => result.Status == "success" && (result.ErrorCode == "s403")) == true) { + WooCodeVersionResponse res = wooResult.First(); result = new() { Success = true, - //Message = string.Join("|", wooResult?.Select(result => result.VersionMessage)), + Message = res.VersionMessage.UpgradeNotice, TimeStamp = DateTimeOffset.Now, + Version = res.VersionMessage.Version }; } else @@ -408,6 +412,7 @@ public async Task GetLatestApplicationVersionAsync(st Success = false, //Message = string.Join("|", wooResult?.Select(result => result.VersionMessage)), TimeStamp = DateTimeOffset.Now, + Version = "0.0.0", }; } break; diff --git a/src/SharedMauiCoreLibrary.Licensing/Utilities/AppUpdateManager.cs b/src/SharedMauiCoreLibrary.Licensing/Utilities/AppUpdateManager.cs index ae47855..53256f7 100644 --- a/src/SharedMauiCoreLibrary.Licensing/Utilities/AppUpdateManager.cs +++ b/src/SharedMauiCoreLibrary.Licensing/Utilities/AppUpdateManager.cs @@ -44,14 +44,21 @@ public override async Task CheckForUpdateAsync(string productCode, string? return updateAvailable; } IsCheckingForUpdates = true; - if (DeviceInfo.Platform == DevicePlatform.WinUI) + if (DeviceInfo.Platform == DevicePlatform.WinUI || DeviceInfo.Platform == DevicePlatform.MacCatalyst) { - IApplicationVersionResult? res = await LicenseManager.GetLatestApplicationVersionAsync(productCode: productCode, target: Enums.LicenseServerTarget.WooCommerce, null, null); + IApplicationVersionResult? res = await LicenseManager + .GetLatestApplicationVersionAsync(productCode: productCode, target: Enums.LicenseServerTarget.WooCommerce, null, null) + .ConfigureAwait(false); OnUpdateAvailable(new() { LatestVersion = new(res?.Version ?? "0.0.0"), }); } + else + { + OnClientIncompatibleWithNewVersion(); + return updateAvailable; + } IsCheckingForUpdates = false; return updateAvailable; } diff --git a/src/SharedNetCoreLibrary.Firebase/Models/FirebaseHandler.cs b/src/SharedNetCoreLibrary.Firebase/Models/FirebaseHandler.cs index 2900639..342db72 100644 --- a/src/SharedNetCoreLibrary.Firebase/Models/FirebaseHandler.cs +++ b/src/SharedNetCoreLibrary.Firebase/Models/FirebaseHandler.cs @@ -36,6 +36,7 @@ public static FirebaseHandler? Instance #endregion #region Properties + [ObservableProperty] public partial ConcurrentDictionary Subscriptions { get; set; } = []; #endregion