F02 Present No-Codes screen - #16
Merged
Merged
Conversation
Add sync show_screen(context_key) that fire-and-presents via JNI / Swift host. Context key is always an app parameter; finished events stay F03. Co-authored-by: Cursor <cursoragent@cursor.com>
Improve readability by formatting the JNI thread attachment and environment enum value retrieval in a more concise manner. This change enhances code clarity while maintaining functionality.
Use attach_current_thread closures, jni_str/jni_sig macros, and Env instead of the 0.21 AttachGuard style so the crate compiles for Android targets. Co-authored-by: Cursor <cursoragent@cursor.com>
showScreen and initialize were running on the Rust/JNI worker thread, so the paywall Activity never appeared. Post work via Handler on the main looper (DefineClass NativeRunnable) and load SDK classes through the Activity ClassLoader when FindClass fails off the UI thread. Co-authored-by: Cursor <cursoragent@cursor.com>
Mirror the iOS Swift host: apps compile DioxusQonversionHost.kt and Rust only JNI-calls initialize/showScreen. Co-authored-by: Cursor <cursoragent@cursor.com>
Package DioxusQonversionHost in an android/ library module and emit AndroidArtifact metadata so apps get the Kotlin host without copy/paste. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
show_screen(context_key)(sync, fire-and-present) requiring priorinitializeNoCodes.getSharedInstance().showScreen; iOS Swift host hops to main and callsNoCodes.shared.showScreen(withContextKey:)Closes #5
Test plan
cargo test(6 tests, including new show_screen cases)show_screen("your_context_key")and confirm the No-Codes screen presentsInvalidConfiginitializereturnsNotInitializedMade with Cursor