-
Notifications
You must be signed in to change notification settings - Fork 0
✨ feat: prevent click action #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Uniform everything into `sendClickEvent` method and handles prevented prop.
Now dynamically exctract notification name from message.
Handling all click events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a “prevent default” mechanism for several paywall click events (currently iOS-focused), allowing JS handlers to optionally block the native SDK’s default click behavior.
Changes:
- Extend click events with
_messageId/preventedand add JS-sideprevent()handlers for click events. - Add iOS bridging to correlate click events with a JS response and conditionally invoke the native
prevent()callback. - Update example app and iOS dependency versions to exercise the new behavior.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/specs/PaywallViewNativeComponent.ts | Extends ClickEvent payload to support preventable click actions. |
| src/Paywall/index.tsx | Adds JS handler signatures that expose prevent() and sends resolve/reject messages back to native. |
| ios/PaywallView.mm | Adds iOS-side observer wiring to call the SDK’s prevent() based on JS response. |
| ios/NativePaywallModule.mm | Changes notification routing to be derived from the emitted JS event name. |
| RNAccessIOS.podspec | Updates pinned AccessIOS dependency version. |
| example/src/App.tsx | Demonstrates new click handlers and prevent calls. |
| example/ios/Podfile.lock | Updates example iOS pods (including AccessIOS version and CocoaPods metadata). |
| example/Gemfile.lock | Updates Ruby/Bundler/CocoaPods lock metadata for the example app. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds prevent methods for click events :
onSubscribeClick,onLoginClick,onDataPolicyClick&
onDiscoveryLinkClick.Working only for iOS so far.
current iOS SDK version, it would probably be a good idea to wait until Access IOS
v2.10.1isavailable before releasing this (This PR fixes that specific issue).
To test this (if the fix has not been released) :
paywall-iosrepofix/escaping-events-preventbranch./script/build.sh./build/AccessIOS.xcframeworkinto this projectios/directory.s.vendored_frameworksline inRNAccessIOS.podspecand comment the
s.dependencyone.cd example/ios && pod installyarn example ios.