Fix Expo user attribute removal docs#214
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f74474d606
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| :::expo | ||
| <Note> | ||
| If a paywall uses the **Set user attributes** action, the merged attributes are sent back to your app via the `onUserAttributesChange` callback in `useSuperwallEvents`. |
There was a problem hiding this comment.
Document a real Expo attribute-change hook
For Expo users trying to react to a paywall Set user attributes action, this points them to onUserAttributesChange, but the current expo-superwall event surface does not define or dispatch that callback: I checked upstream src/SuperwallEventCallbacks.ts and src/internal/superwallEventBridge.ts, and the callback list/switch only includes the existing paywall, subscription, log, purchase, and custom-callback events. Following this quickstart would therefore compile against a nonexistent callback (or never fire if forced through types); please document the supported Expo path or add the bridge before referencing it here.
Useful? React with 👍 / 👎.
Summary
Clarifies the shared Setting User Attributes docs so each SDK sees platform-specific callback and attribute removal guidance.
The Expo page now tells users to unset attributes with
null, explains thatundefinedkeys are ignored, and notes that nullable attributes requireexpo-superwall1.0.5 or later.The Flutter page no longer shows a non-compiling
nullremoval example because its SDK currently accepts non-nullObjectvalues.Validation
bun run build:cfbun test/Users/dcrawbuck/.agents/skills/autoreview/scripts/autoreview --mode localNote
Low Risk
Documentation-only edits with no runtime, auth, or data-path changes.
Overview
Updates Setting User Attributes so callback notes, intro wording, and attribute removal guidance are split per SDK instead of one shared iOS-style block.
Expo now documents paywall-driven attribute updates via
onUserAttributesChangeinuseSuperwallEvents, removal withnull(withundefinedkeys ignored on the bridge), aupdate({ profilePic: null })example, and a 1.0.5+ requirement for nullable attributes.Flutter explicitly states the SDK only accepts non-null values and does not support deletion via
null, removing misleading removal examples.iOS/Android retain
nil/nullunset examples under platform tabs; the generic intro now refers to a dictionary or object rather than only[String: Any?].Reviewed by Cursor Bugbot for commit f74474d. Bugbot is set up for automated code reviews on this repo. Configure here.