Forward UIApplication.shouldShowPermissionRationale(_:) from SkipUI - #133
Open
vincentborko wants to merge 1 commit into
Open
Forward UIApplication.shouldShowPermissionRationale(_:) from SkipUI#133vincentborko wants to merge 1 commit into
vincentborko wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Companion to skiptools/skip-ui#498, which adds a bridgeable
UIApplication.shouldShowPermissionRationale(_:). A natively-compiled SkipFuse appsees
SkipSwiftUI.UIApplication, notSkipUI.UIApplication, so the new accessor isunreachable until this wrapper forwards it — the same way
requestPermission(_:)anddynamicAndroidActivity(options:)already do.Without it the alternative is reaching the Activity through
AnyDynamicObjectreflection, which additionally has to be kept on the main actor by hand or SwiftJNI
aborts the process.
Change
Inside the existing
#if os(Android)block, directly afterrequestPermission(_:),matching that method's shape and doc-comment style.
Testing
swift teston this repo, plus an end-to-end check in a natively-compiled SkipFuse app:the app's own JNI reflection was replaced with this call and the permission
deny → re-request path was exercised on an Android emulator.
Depends on skiptools/skip-ui#498 — this does not compile until that lands.