Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

257
Views
requestReview() deprecated in iOS 14, Alternative for xamarin.forms?

I'm using

SKStoreReviewController.RequestReview ();

in a dependency service for Xamarin.Forms. However this is now deprecated from iOS 14. And I want to know how to integrate with the new UIWindowScene

requestReview(in windowScene: UIWindowScene)

in Xamarin.Forms

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

First, you can try to add SKStoreReviewController.RequestReview(Window.WindowScene) in the FinishedLaunching method of your xxx.ios->AppDelegate.cs; start the project to see if it is correct.

If the above method goes wrong, using DependencyService is the right way to go.

Here is the interface code:

 public interface MyInterface
{
     void RequestReview();
}

Here is the implementation method of the interface in ios:

[assembly: Dependency(typeof(MyInterfaceImpl))]
namespace App19.iOS
{
    public class MyInterfaceImpl : MyInterface
    {
        public void RequestReview()
        {
           var myv = UIDevice.CurrentDevice.CheckSystemVersion(14, 0);
            if (myv)
            {
                UIWindow window = UIApplication.SharedApplication.Delegate.GetWindow();
            SKStoreReviewController.RequestReview(window.WindowScene);
            }
            else 
            {
                SKStoreReviewController.RequestReview();
            }
        }
    }
}

You can call it in the OnStart method inside APP.xaml.cs:

 protected override void OnStart()
    {
        if (Device.RuntimePlatform == Device.iOS)
        {
            DependencyService.Get<IReviewService>().RequestReview();
        }
    }
over 4 years ago · Santiago Trujillo Report

0

I might have a solution:

using StoreKit;
using UIKit;

public void RequestReview(){
    var scene = UIApplication.SharedApplication.KeyWindow.WindowScene;

    if (scene is null)
    {
        //handle the scene being null here
        return;
    }

    SKStoreReviewController.RequestReview(scene);
}

I've found multiple ways of getting the current scene and they both worked when I tested them:

var scene = UIApplication.SharedApplication.KeyWindow.WindowScene;

var alsoScene = UIApplication.SharedApplication.Delegate.GetWindow()?.WindowScene;

You can read more about the difference between the two in this issue

The complete solution where you check the iOS version in order to call the right thing might look like this

using StoreKit;
using UIKit;

public void RequestReview()
{
    var isIos14OrAbove = UIDevice.CurrentDevice.CheckSystemVersion(14, 0);
    if (isIos14OrAbove)
    {
        var scene = UIApplication.SharedApplication.KeyWindow.WindowScene;

        if (scene is null)
        {
            //handle the scene being null here
            return;
        }

        SKStoreReviewController.RequestReview(scene);
    }
    else
    {
        SKStoreReviewController.RequestReview();
    }
}

Hope this helps.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!