### Run pod install for iOS Source: https://paywallo.com.br/docs/install Enter the ios folder and run pod install. Autolinking handles the rest. No action needed for Android. ```bash cd ios && pod install ``` -------------------------------- ### Install Paywallo SDK with npm Source: https://paywallo.com.br/docs/install Run in the project root to install the Paywallo SDK package. Works with yarn add or pnpm add as well. ```bash npm install @virex-tech/paywallo-sdk ``` -------------------------------- ### Verify SDK initialization log Source: https://paywallo.com.br/docs/install With debug: __DEV__ enabled, this log appears in the console when the app runs, confirming the SDK started. ```text [Paywallo] initialized successfully ``` -------------------------------- ### Wait for SDK readiness before identify/track Source: https://paywallo.com.br/docs/install Use waitUntilReady() before identify/track on cold start. Without it, the SDK may not be ready and will throw "SDK not initialized". The properties.userId is required to link the device to the user. ```tsx // No boot (useEffect ou equivalente): await PaywalloClient.waitUntilReady(); await PaywalloClient.identify({ email: user.email, properties: { userId: user.id }, // obrigatório pra linkar o device ao usuário }); ``` -------------------------------- ### Rebuild development build after SDK install Source: https://paywallo.com.br/docs/install If you already have a development build installed, rebuild it after installing the SDK. New native modules do not appear with just a JS reload. ```bash npx expo run:ios # ou npx expo run:android ``` -------------------------------- ### Install required Expo peer dependencies Source: https://paywallo.com.br/docs/install expo-application, expo-device, and expo-localization are mandatory peer dependencies. The SDK imports them statically; without them the build breaks with no fallback. ```bash npx expo install expo-application expo-device expo-localization ``` -------------------------------- ### Request ATT permission before mounting Provider (iOS) Source: https://paywallo.com.br/docs/install On iOS, request App Tracking Transparency permission and wait for the user's response before rendering PaywalloProvider. If the Provider mounts first, the SDK initializes with attStatus=undetermined, no IDFA, and no madid in CAPI, degrading install attribution. Requires NSUserTrackingUsageDescription in Info.plist. ```tsx import * as TrackingTransparency from "expo-tracking-transparency"; import { Platform } from "react-native"; async function bootstrap() { if (Platform.OS === "ios") { await TrackingTransparency.requestTrackingPermissionsAsync(); } // só agora renderiza } ``` -------------------------------- ### Chamar complete() para finalizar o onboarding Source: https://paywallo.com.br/docs/onboarding-dropout Use este snippet quando o usuário chega ao fim do onboarding (última tela, paywall, home). Sem complete(), a taxa de conclusão fica em 0%. Em teste A/B, passe o mesmo variantKey usado nos steps. ```typescript import { onboardingManager } from "@virex-tech/paywallo-sdk"; // quando o usuário termina o fluxo (chegou na última tela ou no paywall) await onboardingManager.complete(); // Em teste A/B, passe o mesmo variantKey usado nos steps await onboardingManager.complete({ variantKey: "variant_b" }); ``` -------------------------------- ### Mark onboarding steps with onboardingManager.step() Source: https://paywallo.com.br/docs/onboarding-dropout Use this snippet to mark each onboarding screen with a unique name and its order in the funnel. The order argument is required; without it the backend cannot build the funnel sequence. Call it on screen mount, e.g., inside a useEffect, and call it again for the same step if the user returns; the backend keeps the most advanced progress. ```typescript import { onboardingManager } from "@virex-tech/paywallo-sdk"; // chama em cada tela do seu onboarding, passando o order da tela await onboardingManager.step("welcome", 0); await onboardingManager.step("age_selection", 1); await onboardingManager.step("goal", 2); ``` -------------------------------- ### Track onboarding steps across three screens with onboardingManager Source: https://paywallo.com.br/docs/onboarding-dropout Use this snippet to track user progress through a three-screen onboarding flow (welcome, age, goal). Call onboardingManager.step() in each screen's useEffect with a step name and index, and call onboardingManager.complete() when the user finishes. This is the core integration for the Paywallo SDK. ```typescript import { useEffect } from "react"; import { onboardingManager } from "@virex-tech/paywallo-sdk"; function WelcomeScreen({ navigation }) { useEffect(() => { onboardingManager.step("welcome", 0); }, []); return ( Bem-vindo!