Exemple #1
0
        public void OnComplete(Com.Google.Android.Play.Core.Tasks.Task task)
        {
            if (!task.IsSuccessful)
            {
                inAppRateTCS.TrySetResult(false);

                launchTask?.Dispose();

                return;
            }

            try
            {
                var reviewInfo = (ReviewInfo)task.GetResult(Java.Lang.Class.FromType(typeof(ReviewInfo)));

                launchTask = reviewManager.LaunchReviewFlow(Platform.CurrentActivity, reviewInfo);

                launchTask.AddOnCompleteListener(this);
            }
            catch (System.Exception ex)
            {
                ShowAlertMessage("ERROR", "There was an error launching in-app review. Please try again.");

                inAppRateTCS.TrySetResult(false);

                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
        public void OnComplete(Com.Google.Android.Play.Core.Tasks.Task task)
        {
            if (!task.IsSuccessful || forceReturn)
            {
                tcs.TrySetResult(forceReturn);
                launchTask?.Dispose();
                return;
            }

            try
            {
                var reviewInfo = (ReviewInfo)task.GetResult(Java.Lang.Class.FromType(typeof(ReviewInfo)));
                forceReturn = true;
                launchTask  = manager.LaunchReviewFlow(Activity, reviewInfo);
                launchTask.AddOnCompleteListener(this);
            }
            catch (Exception ex)
            {
                tcs.TrySetResult(false);
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }