Unexpected Behaviour -> iOS.Device.RequestStoreReview()

Hello!

I’m seeing some unexpected behaviour with RequestStoreReview() on iOS and I’m not sure if it’s a Unity or Apple issue.

The code in question is…

if (!UnityEngine.iOS.Device.RequestStoreReview())
  Application.OpenURL(<AppStoreUrl>);

The idea being that if the native rate dialog cannot be invoked (as per the documentation reasons) then the traditional app store URL is used (which is how it’s worked until this change)

What actually happens (on a device) is that the rate dialog is not shown, yet the function returns true (meaning the fallback of opening the app store URL doesn’t trigger either)

In-effect, nothing happens.

I’m guessing the rate dialog didn’t open because the app is currently in TestFlight (and the first submission has yet to be submitted) but surely the function should return false in this case?

Is anyone able to share their experiences with this function please?

https://docs.unity3d.com/2022.3/Documentation/ScriptReference/iOS.Device.RequestStoreReview.html

So it looks like Apple have deprecated this…

https://developer.apple.com/documentation/storekit/skstorereviewcontroller/requestreview()

It also states the following with regards to TestFlight…

However, this method has no effect when you call it in an app that you distribute using TestFlight.

So you would imagine false is returned, but maybe for some strange reason they decided to return true

I’ll revert to the traditional rate url…

To automatically open a page on which users can write a review in the App Store, append the query parameter action=write-review to your product URL.

So…

https://apps.apple.com/app/id<id>?action=write-review

RequestStoreReview doesn’t return the status of dialog shown or not. It just returns true if the api of opening store review dialog exists (which is true always currently)

bool UnityRequestStoreReview()
{
    Class classSKStoreReviewController = NSClassFromString(@"SKStoreReviewController");
    if (!classSKStoreReviewController || ![classSKStoreReviewController respondsToSelector: @selector(requestReview)])
        return false;

    [classSKStoreReviewController performSelector: @selector(requestReview)];
    return true;
}

As SKStoreReviewController was introduced in iOS 10.3, may be they have added returning bool value.
However, currently it always returns true as min deployment is always above 10.3.

Also, it’s currently too buggy to handle the case of fallback when store review dialog doesn’t turn up.
Just make sure you don’t attach any UI to this call and trigger from code as required. If it shows up, anyways unity gets paused. If not just you proceed with your game.

1 Like

Thanks for the feedback @Voxel-Busters

Yes that API call does appear a little unreliable.

The action=write-review approach appears to work well.

Ultimately it invokes the iOS App Store and displays the rate\review dialog, which is the exact behaviour I was looking for.

If you actually linked rating to any UI element, I see thats the only way. But appsrore review dialog has better UX in general.

Anyways, glad you got this sorted!

1 Like