Skip to content

Add errorDialogFactory to checkpoints - #2090

Draft
vegaro wants to merge 2 commits into
mainfrom
cesar/checkpoint-error-dialog-callback
Draft

vegaro wants to merge 2 commits into
mainfrom
cesar/checkpoint-error-dialog-callback

Conversation

@vegaro

@vegaro vegaro commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Apps can choose custom native dialog content, the SDK's default dialog, or no dialog through CheckpointParams.errorDialogFactory. The factory receives the actual error (kind, code, message) and returns a CheckpointErrorDialogOutcome, directly or through a promise:

  • { type: "show", dialog: { message, buttonTitle } }
  • { type: "useDefault" }
  • { type: "suppress" }

Both native modules forward the outcome to PHC. The SDK handles presentation and acknowledgement. Thrown errors, rejected promises, and invalid outcomes use the default dialog. The SDK waits for pending promises; there is no five-second timeout. Removing the checkpoint callback detaches the factory and resolves pending requests with the default dialog.

This depends on RevenueCat/purchases-ios#8134, RevenueCat/purchases-android#4537, and RevenueCat/purchases-hybrid-common#2043. The dependency pins still point at released versions and need updating when those changes ship.

Validated locally against the updated native branches: 353 JS tests (283 core, 70 UI), TypeScript/UI builds, type and API checks, Android UI bridge compilation, and an iOS simulator app build. The full UI lint command still reports existing customVariables.ts errors and a no-shadowed-variable rule crash with the installed TypeScript version. The changed checkpoint file passes the other lint rules. No device error flow was exercised.

@vegaro vegaro added the pr:other A code change that improves performance label Oct 28, 2026
Lets apps customize the native checkpoint error dialog through a callback.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:other A code change that improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant