Skip to content

Forward UIApplication.shouldShowPermissionRationale(_:) from SkipUI - #133

Open
vincentborko wants to merge 1 commit into
skiptools:mainfrom
vincentborko:pr/permission-rationale
Open

Forward UIApplication.shouldShowPermissionRationale(_:) from SkipUI#133
vincentborko wants to merge 1 commit into
skiptools:mainfrom
vincentborko:pr/permission-rationale

Conversation

@vincentborko

Copy link
Copy Markdown
Contributor

Motivation

Companion to skiptools/skip-ui#498, which adds a bridgeable
UIApplication.shouldShowPermissionRationale(_:). A natively-compiled SkipFuse app
sees SkipSwiftUI.UIApplication, not SkipUI.UIApplication, so the new accessor is
unreachable until this wrapper forwards it — the same way requestPermission(_:) and
dynamicAndroidActivity(options:) already do.

Without it the alternative is reaching the Activity through AnyDynamicObject
reflection, which additionally has to be kept on the main actor by hand or SwiftJNI
aborts the process.

Change

public func shouldShowPermissionRationale(_ permission: String) -> Bool {
    return application.shouldShowPermissionRationale(permission)
}

Inside the existing #if os(Android) block, directly after requestPermission(_:),
matching that method's shape and doc-comment style.

Testing

swift test on 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.

@cla-bot cla-bot Bot added the cla-signed label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant