BuildIt.Config.Core.Services.ConfigurationHelpers.NotifyUserWhenNotMetAppRecommendedVer C# (CSharp) Method

NotifyUserWhenNotMetAppRecommendedVer() public static method

public static NotifyUserWhenNotMetAppRecommendedVer ( this configurationService, bool retrieveCached = false, System.Action failureHandler = null, string recommVerKey = Constants.AppConfigurationRecommVersionKey ) : Task
configurationService this
retrieveCached bool
failureHandler System.Action
recommVerKey string
return Task
        public static async Task NotifyUserWhenNotMetAppRecommendedVer(this IAppConfigurationService configurationService, bool retrieveCached = false, Action failureHandler = null, string recommVerKey = Constants.AppConfigurationRecommVersionKey)
        {
            var metRecommendedVer = await CheckRecommendedVersion(configurationService, retrieveCached, recommVerKey);

            if (!metRecommendedVer)
            {
                if (failureHandler != null)
                {
                    //developer might have the custom action rather than displaying out alert
                    failureHandler.Invoke();
                }
                else
                {
                    //Alert users
                    await configurationService.BlockAppFromRunning(Constants.AppConfigurationRecommendedVersionNotMetUserDialogTitle, Constants.AppConfigurationRecommendedVersionNotMetUserDialogBody);
                }
            }
        }