示例#1
0
        /// <summary>
        /// Open Android in-app review popup of your current application.
        /// </summary>
        public async Task PerformInAppRateAsync()
        {
            inAppRateTCS?.TrySetCanceled();

            inAppRateTCS = new TaskCompletionSource <bool>();

            reviewManager = ReviewManagerFactory.Create(Application.Context);

            var request = reviewManager.RequestReviewFlow();

            request.AddOnCompleteListener(this);

            await inAppRateTCS.Task;

            reviewManager.Dispose();

            request.Dispose();
        }
        /// <summary>
        /// Requests an app review.
        /// </summary>
        public async Task RequestReview(bool testMode)
        {
            tcs?.TrySetCanceled();
            tcs = new TaskCompletionSource <bool>();

            if (testMode)
            {
                manager = new FakeReviewManager(Application.Context);
            }
            else
            {
                manager = ReviewManagerFactory.Create(Application.Context);
            }

            forceReturn = false;
            var request = manager.RequestReviewFlow();

            request.AddOnCompleteListener(this);
            await tcs.Task;

            manager.Dispose();
            request.Dispose();
        }