Skip to content

Commit

Permalink
fix: Fixed Hello Xamarin dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Dec 13, 2023
1 parent 832cfd3 commit 184c00f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/libs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<PropertyGroup Label="Nuget">
<Version>0.9.0</Version>
<Version>0.9.1</Version>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Authors>Oscore</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace Maui.Android.InAppUpdates.Internal;
/// </summary>
public static class UpdateEvents
{
private const int RequestUpdate = 4711;
public const int RequestUpdate = 4711;

private static IAppUpdateManager? _appUpdateManager;
public static IAppUpdateManager? AppUpdateManager { get; private set; }

/// <summary>
/// Set this to true to use the fake app update manager.
Expand All @@ -43,15 +43,15 @@ will be captured on the appupdatesuccess listener.
If comment this line it will simulate if the app update is not available. Then you can add logic when update is not available using immeidate update*/
updateManager.SetUpdateAvailable(3); // your higher app version code that can be used to test fakeappupdate manager
updateManager.SetUpdatePriority(4);
_appUpdateManager = updateManager;
AppUpdateManager = updateManager;
}
else
{
_appUpdateManager = AppUpdateManagerFactory.Create(activity);
AppUpdateManager = AppUpdateManagerFactory.Create(activity);
}

_appUpdateManager.AppUpdateInfo.AddOnSuccessListener(new AppUpdateSuccessListener(
appUpdateManager: _appUpdateManager,
AppUpdateManager.AppUpdateInfo.AddOnSuccessListener(new AppUpdateSuccessListener(
appUpdateManager: AppUpdateManager,
activity: activity,
updateRequest: RequestUpdate,
intent: activity.Intent));
Expand All @@ -63,9 +63,9 @@ will be captured on the appupdatesuccess listener.
/// <param name="activity"></param>
public static void HandleResume(Activity activity)
{
_appUpdateManager?.AppUpdateInfo.AddOnSuccessListener(new ResumeSuccessListener(
AppUpdateManager?.AppUpdateInfo.AddOnSuccessListener(new ResumeSuccessListener(
context: activity,
appUpdateManager: _appUpdateManager));
appUpdateManager: AppUpdateManager));
}

/// <summary>
Expand Down Expand Up @@ -97,17 +97,17 @@ public static void HandleActivityResult(Activity activity, int requestCode, [Gen
break;
}
}
else // Here we add our custom code since immediate update will not return a callback result code
{
using var dialog = new AlertDialog.Builder(activity);
var alert = dialog.Create();
alert?.SetMessage("Hello Xamarin. Additional instructions");
alert?.SetCancelable(false);
alert?.SetButton((int)DialogButtonType.Positive, "Ok", (_, _) =>
{
alert.Dismiss();
});
alert?.Show();
}
// else // Here we add our custom code since immediate update will not return a callback result code
// {
// using var dialog = new AlertDialog.Builder(activity);
// var alert = dialog.Create();
// alert?.SetMessage("Hello Xamarin. Additional instructions");
// alert?.SetCancelable(false);
// alert?.SetButton((int)DialogButtonType.Positive, "Ok", (_, _) =>
// {
// alert.Dismiss();
// });
// alert?.Show();
// }
}
}

0 comments on commit 184c00f

Please sign in to comment.