-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SKStoreReviewController is deprecated in iOS 18, and replacement is not accesible in MAUI. #21410
Comments
AppStore.RequestReview looks like a really simple API, so we might be able to bind it manually. I'll see what I can do. |
The existing Objective-C class to request an App Store review (SKStoreReviewController) is deprecated in Xcode 16+, and it doesn't even work on the corresponding OS versions. The replacement API is Swift-only, but luckily it's a very simple API (just a static method), so it's possible to bind it manually. This required a few other changes/improvements: * Add support for Swift code in our runtime. * Just to keep the changes to a minimum, bump the min OS version for legacy code to match the .NET min OS versions. This is because our build logic uses the legacy min versions when compiling native code (a more involved fix would be to update all the build logic to build native code to use the .NET min OS versions, but that's not the point of this PR, so I took the easy route). I've tested the method locally, and it seems to work fine, but I've still marked it as experimental for now. There are no unit tests because calling the method will put up a dialog, which won't work correctly in unit tests. Fixes #21410.
We're binding this as an experimental API named |
@rolfbjarne @PureWeen @rolfbjarne thanks for this extremely swift binding of new API! |
This will be in an update to the iOS workload, most likely when we add support for Xcode 16.1 (which will probably happen soon after .NET 9 has been released, although this depends a bit on when exactly Apple makes Xcode 16.1 stable). |
Can the same be considered for the reloadAllTimelines() method? |
I filed a suggestion for this: #21466 |
The existing Objective-C class to request an App Store review (SKStoreReviewController) is deprecated in Xcode 16+, and it doesn't even work on the corresponding OS versions. The replacement API is Swift-only, but luckily it's a very simple API (just a static method), so it's possible to bind it manually. This required a few other changes/improvements: * Add support for Swift code in our runtime. * Just to keep the changes to a minimum, bump the min OS version for legacy code to match the .NET min OS versions. This is because our build logic uses the legacy min versions when compiling native code (a more involved fix would be to update all the build logic to build native code to use the .NET min OS versions, but that's not the point of this PR, so I took the easy route). Fixes #10659. I've tested the method locally, and it seems to work fine, but I've still marked it as experimental for now. There are no unit tests because calling the method will put up a dialog, which won't work correctly in unit tests. Fixes #21410. Fixes #10659.
@rolfbjarne I tried the new API and it doesn't seem to work for me. It is documented that the review dialog is shown always in development mode, but when I call the method, nothing happens at all: no dialog, no crash, no logged error (that I could see) - both on macOS and iOS. I then tried binding the method myself - using the same approach that is explained here:
And in my C# code:
And using that code, the rating dialog shows reliably. |
@tipa that's strange, this code works for me: var scene = UIApplication.SharedApplication.ConnectedScenes.ToArray()
.FirstOrDefault (x => x.ActivationState == UISceneActivationState.ForegroundActive);
if (scene is UIWindowScene windowScene) {
StoreKit.AppStore.RequestReview (windowScene);
} Complete test project: ios-plain-80b52c1.zip |
@rolfbjarne I tested your project and it works. It now also works when I call the API from my iOS apps. I can't say yet, why this wasn't the case when I tested it last week. However, I can still reproduce the problem on macOS. Can you have a look at my test project? |
OK, I see what's happening. Adding this to the csproj should work around it: <ItemGroup>
<ReferenceNativeSymbol Include="XamarinSwiftFunctions" SymbolType="ObjectiveCClass" />
</ItemGroup> |
…iftFunctions type if it's used. Fixes #21410 (comment).
…iftFunctions type if it's used. Fixes #21410 (comment).
…iftFunctions type if it's used. (#21750) Fixes #21410 (comment).
I've merged a fix for this, which will be included when we ship support for Xcode 16.2. |
Moved from dotnet/maui#25169
Description
Hello,
with iOS 18 it seems that Apple deprecated SKStoreReviewController. Now every plugin and call made from SKStoreReviewController are not working. There is a replacement with AppStore.requestReview(in: scene). But from MAUI it is inaccessible.
https://developer.apple.com/documentation/storekit/appstore/3954432-requestreview/
Steps to Reproduce
Create an application
on ios18 invoke
see that application hangs.
same code on iOS 17.5 works, create a review popup or just passes quietly.
Link to public reproduction project repository
No response
Version with bug
8.0.91 SR9.1
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 18+
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: