diff --git a/content/docs/expo/changelog.mdx b/content/docs/expo/changelog.mdx index 968669dc..a8ada994 100644 --- a/content/docs/expo/changelog.mdx +++ b/content/docs/expo/changelog.mdx @@ -5,6 +5,12 @@ description: "Release notes for the Superwall Expo SDK" # Changelog +## 1.2.0 + +### Minor Changes + +- 694c1b1: Update native SDKs (iOS 4.16.1, Android 2.7.20) and add `eventTrackingBehavior` (deprecates `isExternalDataCollectionEnabled`), the `singularDeviceId` integration attribute, a runtime `setEventTrackingBehavior`, and `getStoreFrontCountryCode()`. + ## 1.1.6 ### Patch Changes diff --git a/content/docs/expo/index.mdx b/content/docs/expo/index.mdx index c4b7265b..33ed9008 100644 --- a/content/docs/expo/index.mdx +++ b/content/docs/expo/index.mdx @@ -47,4 +47,4 @@ If you have feedback on any of our docs, please leave a rating and message at th If you have any issues please [open an issue on GitHub](https://github.com/superwall/expo-superwall/issues). - + diff --git a/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx b/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx index 6eed9b57..30cf91de 100644 --- a/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx +++ b/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx @@ -90,6 +90,10 @@ The hook returns an object representing the Superwall store. If a `selector` fun type: "(level: string) => Promise", description: "Sets the SDK log level (debug, info, warn, error, none).", }, + setEventTrackingBehavior: { + type: "(behavior: EventTrackingBehavior) => Promise", + description: "Sets which events Superwall tracks at runtime (\"all\", \"superwallOnly\", or \"none\"), for GDPR/data-collection control.", + }, setIntegrationAttributes: { type: "(attributes: IntegrationAttributes) => Promise", description: "Sets third-party integration identifiers, including `appstackId` for Appstack.", @@ -106,6 +110,10 @@ The hook returns an object representing the Superwall store. If a `selector` fun type: "() => Promise>", description: "Returns device attributes from the native SDK.", }, + getStoreFrontCountryCode: { + type: "() => Promise", + description: "Retrieves the App Store / Play Store storefront country code for the current device.", + }, getEntitlements: { type: "() => Promise", description: "Fetches the user's entitlement snapshot, including active and inactive entitlements, plus all known entitlements when exposed by the native bridge.", diff --git a/content/docs/expo/sdk-reference/index.mdx b/content/docs/expo/sdk-reference/index.mdx index cad91ee6..8af30d8e 100644 --- a/content/docs/expo/sdk-reference/index.mdx +++ b/content/docs/expo/sdk-reference/index.mdx @@ -15,4 +15,4 @@ If you have feedback on any of our docs, please leave a rating and message at th If you have any issues with the SDK, please [open an issue on GitHub](https://github.com/superwall/expo-superwall/issues). - + diff --git a/content/docs/integrations/singular.mdx b/content/docs/integrations/singular.mdx index 86eab1b2..1589c509 100644 --- a/content/docs/integrations/singular.mdx +++ b/content/docs/integrations/singular.mdx @@ -60,6 +60,25 @@ Superwall.instance.setIntegrationAttributes( ) ``` +### Expo + +On Expo SDK `1.2.0` and later, `singularDeviceId` is available as a typed integration attribute on the hooks API. + +```tsx +import { useSuperwall } from "expo-superwall" + +function SingularAttribution({ sdid }: { sdid: string }) { + const setIntegrationAttributes = useSuperwall((state) => state.setIntegrationAttributes) + + const linkSingular = async () => { + // After Singular returns an SDID + await setIntegrationAttributes({ singularDeviceId: sdid }) + } + + // Call linkSingular() once you have the SDID. +} +``` + ### Other SDKs If your Superwall SDK does not yet expose a typed Singular integration attribute, set `singularDeviceId` as a user attribute instead. diff --git a/content/shared/configuring/using-superwalloptions.mdx b/content/shared/configuring/using-superwalloptions.mdx index 4ec23c1b..9d8738e6 100644 --- a/content/shared/configuring/using-superwalloptions.mdx +++ b/content/shared/configuring/using-superwalloptions.mdx @@ -411,18 +411,51 @@ Superwall.configure( :::expo -Expo currently uses `isExternalDataCollectionEnabled`. Setting it to `false` suppresses user-initiated tracking, trigger-fire events, and user-attribute updates while keeping internal Superwall event collection enabled. +On Expo SDK `1.2.0` and later, use the `eventTrackingBehavior` option on the hooks/provider API (`expo-superwall`). It is a string-union field — pass one of the following string values: -```typescript -const options = SuperwallOptions() -options.isExternalDataCollectionEnabled = false +| Behavior | What Superwall sends | +| --- | --- | +| `"all"` | All SDK event collection is enabled. This is the default. | +| `"superwallOnly"` | Internal Superwall events continue to be sent, but user-initiated `Superwall.track(...)` calls, trigger-fire events, and user-attribute updates are suppressed. | +| `"none"` | No SDK events are sent to Superwall. Paywalls still work because paywall logic runs on device, but dashboard analytics, attribution matching, and audience rules that depend on `acquisition_*` attributes will not receive this event data. | + +Set the initial behavior by passing it in `options` to `SuperwallProvider`: + +```tsx +import { SuperwallProvider } from "expo-superwall" + +export default function App() { + return ( + + + + ) +} +``` -Superwall.configure( - "MY_API_KEY", - options: options -); +You can also change the behavior at runtime after the SDK is configured. This is useful when a user changes a privacy or consent setting in your app. + +```tsx +import { useSuperwall } from "expo-superwall" + +function PrivacySettings() { + const setEventTrackingBehavior = useSuperwall((state) => state.setEventTrackingBehavior) + + const disableTracking = async () => { + await setEventTrackingBehavior("none") + } + + // Call disableTracking() from your consent UI. +} ``` +`isExternalDataCollectionEnabled` is deprecated on Expo SDK `1.2.0` and later. If older code sets it to `false`, the SDK maps that to `"superwallOnly"`, not `"none"`. Use `"none"` when your app needs to stop SDK event collection entirely. + +The compat API (`expo-superwall/compat`) also adds `eventTrackingBehavior` in `1.2.0`, but its `EventTrackingBehavior` enum is not yet exported from that entry point. Use the hooks/provider API shown above until a later SDK release exports it. + ::: ### Automatically Dismissing the Paywall