Skip to content

[APPHUD-890] Add setScreenPresentationStyle for iOS Rules screens - #95

Open
vlr-code wants to merge 1 commit into
release/5.1.0from
feature/APPHUD-890-screen-presentation-style
Open

[APPHUD-890] Add setScreenPresentationStyle for iOS Rules screens#95
vlr-code wants to merge 1 commit into
release/5.1.0from
feature/APPHUD-890-screen-presentation-style

Conversation

@vlr-code

Copy link
Copy Markdown
Collaborator

Adds ApphudSdk.setScreenPresentationStyle(ApphudScreenPresentationStyle.fullScreen | pageSheet) to control how Rules screens (including Figma rule paywalls) are presented on iOS.

Why a separate method: the native ApphudUIDelegate.apphudScreenPresentationStyle returns synchronously and cannot be bridged to async JS. The style is stored in the events module (same pattern as setApphudProductIdentifiers) and returned by the existing UI delegate proxy.

Behavior details:

  • While the method was never called, the proxy hides the optional selector via responds(to:) — SDK default behavior preserved byte-for-byte.
  • The write happens on the main thread (same thread the delegate reads from), so a set → show sequence can't race; the returned Promise resolves after the write.
  • Android: safe no-op (codegen-required stub resolves immediately).
  • New Turbo Module spec method setScreenPresentationStyle(style: string): Promise<void> on NativeApphudSdkEvents; TS enum ApphudScreenPresentationStyle in types.ts.

Verified: tsc + eslint clean, codegen regenerated, example built and smoke-tested on iOS simulator (both styles visually confirmed via a temporary local trigger, not committed) and Android emulator (no-op path). Example app intentionally untouched.

Adds ApphudSdk.setScreenPresentationStyle(ApphudScreenPresentationStyle)
to control how Rules screens (including Figma rule paywalls) are
presented on iOS: fullScreen or pageSheet.

The native ApphudUIDelegate.apphudScreenPresentationStyle delegate
method returns synchronously and cannot be bridged to async JS, so the
chosen style is stored in the events module (same pattern as
setApphudProductIdentifiers) and returned by the existing UI delegate
proxy. While no style is set, the proxy hides the optional selector via
responds(to:), keeping the SDK default behavior byte-for-byte.

On Android the method is a safe no-op (the concept is iOS-only).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant