### Configuration Options Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Example of how to configure the Adjust SDK. ```APIDOC ## Configuration Options All configuration options are set on the `AdjustConfig` object: ```javascript const config = new AdjustConfig(appToken, environment); // Common config.setLogLevel(AdjustConfig.LogLevelDebug); config.setExternalDeviceId('user-id'); config.enableSendingInBackground(); // iOS config.disableIdfaReading(); // Android config.enablePlayStoreKidsCompliance(); Adjust.initSdk(config); ``` See [configuration.md](configuration.md) for all 30+ options. ``` -------------------------------- ### Complete Adjust SDK Initialization Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/configuration.md A comprehensive example demonstrating how to initialize the Adjust SDK with various configurations, including basic settings, features, store info, and callbacks. ```javascript import { Adjust, AdjustConfig, AdjustStoreInfo } from 'react-native-adjust'; import { Platform } from 'react-native'; function initializeAdjust() { // Create config const config = new AdjustConfig( 'abc123token', AdjustConfig.EnvironmentProduction ); // Basic settings config.setLogLevel(AdjustConfig.LogLevelDebug); config.setExternalDeviceId('user-123'); config.setDefaultTracker('default-tracker'); // Features config.enableSendingInBackground(); config.enableCostDataInAttribution(); config.enableFirstSessionDelay(); config.setAttConsentWaitingInterval(3000); // Store info (Android) if (Platform.OS === 'android') { const storeInfo = new AdjustStoreInfo('google_play'); storeInfo.setStoreAppId('com.example.app'); config.setStoreInfo(storeInfo); } // Callbacks config.setAttributionCallback((attribution) => { console.log('Attribution:', attribution.network, attribution.campaign); }); config.setEventTrackingSucceededCallback((success) => { console.log('Event tracked:', success.eventToken); }); config.setDeferredDeeplinkCallback((deeplink) => { console.log('Deferred deeplink:', deeplink.deeplink); }); // Initialize Adjust.initSdk(config); } ``` -------------------------------- ### Complete App Store Subscription Tracking Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-app-store-subscription.md A comprehensive example demonstrating how to create, configure, and track an App Store subscription using the Adjust SDK. This includes setting transaction details and adding callback/partner parameters. ```javascript import { Adjust, AdjustAppStoreSubscription } from 'react-native-adjust'; // Track App Store subscription function trackAppStoreSubscription(productId, price, currency, transactionId) { const subscription = new AdjustAppStoreSubscription( price.toString(), currency, transactionId ); // Add transaction details const now = new Date(); subscription.setTransactionDate(now.toISOString()); subscription.setSalesRegion('US'); // Add parameters for server callback subscription.addCallbackParameter('product_id', productId); subscription.addCallbackParameter('user_premium', 'true'); subscription.addPartnerParameter('attribution_source', 'direct'); Adjust.trackAppStoreSubscription(subscription); } // Usage - after successful subscription purchase function handleSubscriptionPurchase(transactionId, productId, priceInUSD) { trackAppStoreSubscription( productId, priceInUSD, 'USD', transactionId ); } ``` -------------------------------- ### Set Up Consent (Granular Control) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Enable granular control over third-party sharing by adding specific partner settings. This example enables Facebook install referrer sharing. ```javascript const sharing2 = new AdjustThirdPartySharing(true); sharing2.addPartnerSharingSetting('Facebook', 'install_referrer', true); Adjust.trackThirdPartySharing(sharing2); ``` -------------------------------- ### Install React Native Adjust SDK Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Install the Adjust React Native SDK using npm or yarn. ```bash npm install react-native-adjust # or yarn add react-native-adjust ``` -------------------------------- ### Complete Example: Handle App Store Purchase Completion Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-app-store-purchase.md A comprehensive example demonstrating how to handle the completion of an App Store purchase, including creating the purchase object, setting up an event, and verifying/tracking the transaction. This is typically used within an In-App Purchase completion handler. ```javascript import { Adjust, AdjustEvent, AdjustAppStorePurchase } from 'react-native-adjust'; // In your In-App Purchase completion handler async function handlePurchaseCompletion(transactionData) { const { productId, transactionId, price, currency, } = transactionData; // Create purchase object const purchase = new AdjustAppStorePurchase( productId, transactionId ); // Create event for tracking const event = new AdjustEvent('purchase_event_token'); event.setProductId(productId); event.setRevenue(price, currency); event.setDeduplicationId(transactionId); event.addCallbackParameter('product_name', productId); // Verify and track Adjust.verifyAndTrackAppStorePurchase(event, (result) => { if (result.code === 0) { // Verification successful console.log('Purchase verified:', transactionId); // Unlock premium features unlockPremiumAccess(); } else { // Verification failed console.error('Purchase verification failed:', result.message); // Handle verification failure showErrorMessage('Payment verification failed. Please try again.'); } }); } ``` -------------------------------- ### Adjust SDK Configuration Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md A comprehensive example demonstrating how to create and configure the Adjust SDK for a React Native application. It includes initialization, setting basic options, enabling features, and registering common callbacks. ```javascript import { Adjust, AdjustConfig } from 'react-native-adjust'; // Create config const config = new AdjustConfig( 'abc123token', AdjustConfig.EnvironmentProduction ); // Basic settings config.setLogLevel(AdjustConfig.LogLevelDebug); config.setExternalDeviceId('my-device-123'); config.setDefaultTracker('abc123tracker'); // Features config.enableSendingInBackground(); config.enableCostDataInAttribution(); // Callbacks config.setAttributionCallback((attribution) => { console.log('Attribution:', attribution); }); config.setEventTrackingSucceededCallback((success) => { console.log('Event succeeded'); }); // Initialize Adjust.initSdk(config); ``` -------------------------------- ### Complete AdjustDeeplink Handling Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-deeplink.md A comprehensive example demonstrating how to initialize AdjustDeeplink, set a referrer, and process/resolve the deeplink using Adjust SDK methods. It also includes setting up a listener for incoming deeplinks. ```javascript import { Adjust, AdjustDeeplink } from 'react-native-adjust'; import { Linking } from 'react-native'; // In your deeplink handling code function handleDeeplink(url) { const deeplink = new AdjustDeeplink(url); // Optional: set referrer if available if (isFromEmail) { deeplink.setReferrer('email_campaign_id'); } // Process and resolve the deeplink Adjust.processAndResolveDeeplink(deeplink, (resolvedLink) => { if (resolvedLink) { // Navigate to the resolved destination navigateToScreen(resolvedLink); } else { // Handle fallback console.log('Could not resolve deeplink'); } }); } // Listen for deeplinks Linking.addEventListener('url', ({ url }) => { handleDeeplink(url); }); ``` -------------------------------- ### Get Attribution Information Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Retrieve attribution details, such as the network and campaign that drove the install, using a callback. ```javascript Adjust.getAttribution((attribution) => { console.log('Network:', attribution.network); console.log('Campaign:', attribution.campaign); }); ``` -------------------------------- ### Complete Play Store Subscription Tracking Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-play-store-subscription.md A comprehensive example demonstrating how to track a Google Play Store subscription purchase using the Adjust SDK. It includes setting purchase time, adding callback and partner parameters, and initiating the tracking. ```javascript import { Adjust, AdjustPlayStoreSubscription } from 'react-native-adjust'; import { InAppPurchase } from 'react-native-iap'; // Track Google Play subscription function trackPlayStoreSubscription(purchaseData) { const { productId, // SKU orderId, purchaseToken, purchaseTime, signatureData } = purchaseData; // Get price from your product catalog const price = 9.99; const currency = 'USD'; const subscription = new AdjustPlayStoreSubscription( price, currency, productId, // SKU orderId, signatureData, purchaseToken ); subscription.setPurchaseTime(purchaseTime); subscription.addCallbackParameter('product_id', productId); subscription.addCallbackParameter('billing_period', 'monthly'); subscription.addPartnerParameter('marketing_source', 'google_play'); Adjust.trackPlayStoreSubscription(subscription); } // Usage - after successful subscription purchase async function handleSubscriptionPurchase(purchaseData) { // Verify with Google Play first const isValid = await verifyWithGooglePlay(purchaseData); if (isValid) { // Track in Adjust trackPlayStoreSubscription(purchaseData); // Unlock subscription benefits activateSubscription(purchaseData.productId); } } ``` -------------------------------- ### Complete Adjust Event Tracking Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-event.md This example demonstrates various ways to track events using the Adjust SDK, including basic tracking, events with revenue and product IDs, events with custom parameters, and events with callback matching. ```javascript import { Adjust, AdjustEvent } from 'react-native-adjust'; // Basic event tracking const event1 = new AdjustEvent('event_token'); Adjust.trackEvent(event1); // Event with revenue const event2 = new AdjustEvent('purchase_token'); event2.setRevenue(99.99, 'EUR'); event2.setProductId('product_123'); event2.setDeduplicationId('txn_' + Date.now()); Adjust.trackEvent(event2); // Event with parameters const event3 = new AdjustEvent('custom_event'); event3.addCallbackParameter('user_segment', 'vip'); event3.addCallbackParameter('referral_code', 'REF123'); event3.addPartnerParameter('network_id', 'net_001'); Adjust.trackEvent(event3); // Event with callback matching const event4 = new AdjustEvent('signup_event'); event4.setCallbackId('signup_cb_001'); event4.addCallbackParameter('signup_method', 'email'); Adjust.trackEvent(event4); ``` -------------------------------- ### Complete Play Store Purchase Verification and Tracking Example Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-play-store-purchase.md A comprehensive example demonstrating how to handle purchase completion, create an Adjust event with purchase details, verify and track the purchase, and acknowledge it with Google Play. Includes error handling for verification failures. ```javascript import { Adjust, AdjustEvent, AdjustPlayStorePurchase } from 'react-native-adjust'; import RNIap from 'react-native-iap'; // In your In-App Purchase completion handler async function handlePurchaseCompletion(purchase) { const { productId, // e.g., 'com.example.premium_app' purchaseToken, // Token from Google Play } = purchase; // Get price from your product catalog const priceInUSD = getPriceForProduct(productId); // Create purchase object const playStorePurchase = new AdjustPlayStorePurchase( productId, purchaseToken ); // Create event for tracking const event = new AdjustEvent('purchase_event_token'); event.setProductId(productId); event.setRevenue(priceInUSD, 'USD'); event.setPurchaseToken(purchaseToken); event.setDeduplicationId(purchase.transactionId); event.addCallbackParameter('product_name', productId); // Verify and track Adjust.verifyAndTrackPlayStorePurchase(event, (result) => { if (result.code === 0) { // Verification successful console.log('Purchase verified:', productId); // Unlock premium features unlockPremiumAccess(productId); // Acknowledge purchase (required by Google Play) RNIap.acknowledgePurchaseAndroid(purchaseToken); } else { // Verification failed console.error('Purchase verification failed:', result.message); // Handle verification failure showErrorMessage('Payment verification failed. Please try again.'); } }); } // Listener for purchase updates const purchaseUpdateSubscription = RNIap.purchaseUpdatedListener((purchase) => { if (purchase.purchaseStateAndroid === 1) { // PurchaseState.PURCHASED handlePurchaseCompletion(purchase); } }); // When done, remove listener purchaseUpdateSubscription.remove(); ``` -------------------------------- ### Initialize SDK with Attribution Callback Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/types.md Example of initializing the Adjust SDK and setting up a callback to receive attribution information. ```typescript import { Adjust, AdjustConfig, AdjustAttribution } from 'react-native-adjust'; const config = new AdjustConfig('token', AdjustConfig.EnvironmentSandbox); config.setAttributionCallback((attribution: AdjustAttribution) => { console.log(`Campaign: ${attribution.campaign}`); console.log(`Network: ${attribution.network}`); }); Adjust.initSdk(config); ``` -------------------------------- ### Install react-native-adjust-oaid Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-oaid.md Install the react-native-adjust-oaid package using npm or yarn. ```bash npm install react-native-adjust-oaid # or yarn add react-native-adjust-oaid ``` ```bash npx react-native link react-native-adjust-oaid ``` -------------------------------- ### Start Metro Server Source: https://github.com/adjust/react_native_sdk/blob/master/example/README.md Start Metro, the JavaScript bundler for React Native. This command should be run from the root of your React Native project. ```bash # using npm npm start # OR using Yarn yarn start ``` -------------------------------- ### Set Default Tracker for Organic Installs Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/configuration.md Assign a default tracker token for organic installs that do not have click tracking. This helps attribute installs without specific campaign data. ```javascript config.setDefaultTracker('abc123tracker'); ``` -------------------------------- ### Start iOS Application Source: https://github.com/adjust/react_native_sdk/blob/master/example/README.md Run your iOS application after starting the Metro bundler. This command is executed from the root of your React Native project. ```bash # using npm npm run ios # OR using Yarn yarn ios ``` -------------------------------- ### Complete Adjust SDK Initialization for Multi-Store Deployment Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-store-info.md This comprehensive example demonstrates how to initialize the Adjust SDK for applications deployed across multiple app stores. It includes logic to detect the store type and set the appropriate store application ID. ```javascript import { Adjust, AdjustConfig, AdjustStoreInfo } from 'react-native-adjust'; // Multi-store deployment function initializeAdjustForStore(storeType) { const config = new AdjustConfig( 'abc123token', AdjustConfig.EnvironmentProduction ); const storeInfo = new AdjustStoreInfo(storeType); switch(storeType) { case 'google_play': storeInfo.setStoreAppId('com.mycompany.myapp'); break; case 'amazon': storeInfo.setStoreAppId('com.mycompany.myapp.amazon'); break; case 'samsung': storeInfo.setStoreAppId('com.mycompany.myapp.samsung'); break; } config.setStoreInfo(storeInfo); config.setLogLevel(AdjustConfig.LogLevelDebug); Adjust.initSdk(config); } // Detect store and initialize import { Platform } from 'react-native'; const store = Platform.OS === 'android' ? 'google_play' : null; if (store) { initializeAdjustForStore(store); } ``` -------------------------------- ### Start Android Application Source: https://github.com/adjust/react_native_sdk/blob/master/example/README.md Run your Android application after starting the Metro bundler. This command is executed from the root of your React Native project. ```bash # using npm npm run android # OR using Yarn yarn android ``` -------------------------------- ### Initialize Adjust SDK with Store Info Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-store-info.md Configure the Adjust SDK by passing an AdjustStoreInfo object to AdjustConfig.setStoreInfo() during initialization. This example shows configuration for the Amazon Appstore. ```javascript import { AdjustConfig, AdjustStoreInfo } from 'react-native-adjust'; const config = new AdjustConfig('token123', AdjustConfig.EnvironmentProduction); // Configure for Amazon Appstore const storeInfo = new AdjustStoreInfo('amazon'); storeInfo.setStoreAppId('com.example.app'); config.setStoreInfo(storeInfo); Adjust.initSdk(config); ``` -------------------------------- ### enable Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Enables the Adjust SDK. Once enabled, the SDK will start tracking sessions and events. ```APIDOC ## enable ### Description Enable the SDK. ### Method ```javascript Adjust.enable(): void ``` ### Request Example ```javascript Adjust.enable(); ``` ``` -------------------------------- ### E-commerce Deeplink Examples Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-deeplink.md Examples of deeplink formats commonly used in e-commerce applications for navigating to products or checkout pages. ```text https://store.example.com/product/shoes?sku=SKU123 https://store.example.com/checkout?cart=items ``` -------------------------------- ### Initialize Adjust SDK with OAID Configuration Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-oaid.md Example of initializing the Adjust SDK and configuring OAID reading for Android devices during app startup. Ensure to call readOaid() early for best results. ```javascript import { Adjust, AdjustConfig } from 'react-native-adjust'; import { AdjustOaid } from 'react-native-adjust-oaid'; import { Platform } from 'react-native'; // During app initialization function initializeAdjust() { const config = new AdjustConfig( 'abc123token', AdjustConfig.EnvironmentProduction ); Adjust.initSdk(config); // Android: Configure OAID reading if (Platform.OS === 'android') { // Enable OAID reading for devices that support it AdjustOaid.readOaid(); } } ``` -------------------------------- ### gdprForgetMe Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Initiates the GDPR right-to-be-forgotten request. This action removes all user data associated with the current installation. ```APIDOC ## gdprForgetMe ### Description Initiates GDPR right-to-be-forgotten request. ### Method ```javascript Adjust.gdprForgetMe(): void ``` ### Request Example ```javascript Adjust.gdprForgetMe(); ``` ``` -------------------------------- ### Adjust.getAttribution Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Retrieves attribution information, which indicates which campaign or network drove an install. ```APIDOC ## Adjust.getAttribution() ### Description Retrieves attribution information, which indicates which campaign or network drove an install. The attribution details are provided via a callback function. ### Method `Adjust.getAttribution(callback: (attribution: Attribution) => void)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript Adjust.getAttribution((attribution) => { console.log('Network:', attribution.network); console.log('Campaign:', attribution.campaign); }); ``` ### Response #### Success Response - **attribution** (Attribution) - An object containing attribution details like network, campaign, etc. #### Response Example ```json { "network": "Adjust Network", "campaign": "Summer Sale", "adgroup": "Ad Group Name", "creative": "Creative Name", "clickLabel": "click_label_value", "tracker": "tracker_name", "trackerName": "Tracker Name", "cost": 0.5, "currency": "USD" } ``` ``` -------------------------------- ### setDefaultTracker Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Sets a default tracker token. This token is used for organic installs when no other tracker information is available. ```APIDOC ## setDefaultTracker ### Description Sets a default tracker token. This token is used for organic installs when no other tracker information is available. ### Method ```javascript AdjustConfig.prototype.setDefaultTracker(defaultTracker: string): void ``` ### Parameters #### Path Parameters - **defaultTracker** (string) - Required - Tracker token ### Request Example ```javascript config.setDefaultTracker('abc123tracker'); ``` ``` -------------------------------- ### App-Specific Deep Linking Patterns Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-deeplink.md Examples of custom deeplink schemes and paths used for deep linking into specific app features or content. ```text myapp://product/123?referrer=campaign-id myapp://promo/save10 myapp://user/account ``` -------------------------------- ### Get SDK Version Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieve the current SDK version. The callback function will be provided with the SDK version string or null. ```javascript Adjust.getSdkVersion((version) => { console.log('SDK version:', version); }); ``` -------------------------------- ### Listen for and Request Play Store Purchases in React Native Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-play-store-purchase.md Use this snippet to listen for purchase updates from `react-native-iap` and request a new purchase. Ensure you have `react-native-iap` installed and configured. ```javascript import RNIap, { purchaseUpdatedListener, PurchaseState } from 'react-native-iap'; // Listen for purchase updates const subscription = purchaseUpdatedListener((purchase) => { console.log('Purchase details:', { productId: purchase.productId, // SKU purchaseToken: purchase.purchaseToken, // Token for verification transactionId: purchase.transactionId, // Transaction ID purchaseTime: purchase.purchaseTime, // Timestamp purchaseStateAndroid: purchase.purchaseStateAndroid, // Purchase state }); // Process purchase if (purchase.purchaseStateAndroid === PurchaseState.PURCHASED) { handlePurchaseCompletion(purchase); } }); // Request purchase try { await RNIap.requestPurchase({ sku: 'com.example.premium_app', }); } catch (err) { console.error('Purchase request failed:', err); } ``` -------------------------------- ### Initialize SDK with Environment Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/types.md Demonstrates how to initialize the Adjust SDK with a specific environment (e.g., Production). ```typescript import { AdjustConfig, Environment } from 'react-native-adjust'; function initWithEnvironment(env: Environment) { const config = new AdjustConfig('token', env); // ... } // Usage initWithEnvironment(AdjustConfig.EnvironmentProduction); ``` -------------------------------- ### AdjustDeferredDeeplink Interface Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/types.md Represents a deferred deeplink received after app installation. This is provided by AdjustConfig.setDeferredDeeplinkCallback() when a user clicks a tracking link, installs the app, and launches it. ```typescript interface AdjustDeferredDeeplink { deeplink: string; } ``` -------------------------------- ### Initialize Adjust SDK with App Token and Environment Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/configuration.md Use this snippet to initialize the Adjust SDK with your app token and specify the environment (sandbox or production). ```javascript const config = new AdjustConfig('abc123token', AdjustConfig.EnvironmentSandbox); ``` -------------------------------- ### Enable Preinstall Tracking (Android) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Enables preinstall tracking on Android devices. Requires setting the preinstall file path using `setPreinstallFilePath()`. ```javascript config.enablePreinstallTracking(); config.setPreinstallFilePath('/path/to/preinstall.json'); ``` -------------------------------- ### AdjustStoreInfo Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-store-info.md Initializes a new AdjustStoreInfo object with the name of the app store. ```APIDOC ## Constructor AdjustStoreInfo ### Description Initializes a new AdjustStoreInfo object with the name of the app store. ### Parameters #### Path Parameters - **storeName** (string) - Required - Name of the app store ### Request Example ```javascript // Google Play Store const storeInfo1 = new AdjustStoreInfo('google_play'); // Amazon Appstore const storeInfo2 = new AdjustStoreInfo('amazon'); ``` ``` -------------------------------- ### Instantiate AdjustStoreInfo Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-store-info.md Create an AdjustStoreInfo object by providing the name of the app store. This is the first step in configuring store-specific information. ```javascript const storeInfo1 = new AdjustStoreInfo('google_play'); const storeInfo2 = new AdjustStoreInfo('amazon'); ``` -------------------------------- ### Initialize Adjust SDK and Track Event Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Basic usage for initializing the Adjust SDK with a configuration and tracking a simple event. ```javascript import { Adjust, AdjustConfig, AdjustEvent } from 'react-native-adjust'; // Initialize const config = new AdjustConfig('abc123token', AdjustConfig.EnvironmentSandbox); config.setLogLevel(AdjustConfig.LogLevelDebug); Adjust.initSdk(config); // Track event const event = new AdjustEvent('event_token'); Adjust.trackEvent(event); ``` -------------------------------- ### AdjustAppStoreSubscription Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-app-store-subscription.md Instantiate AdjustAppStoreSubscription with price, currency, and transaction ID. Use this to begin tracking an App Store subscription. ```javascript new AdjustAppStoreSubscription( '9.99', 'USD', 'transaction-id-123' ); ``` -------------------------------- ### setDeferredDeeplinkCallback Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Registers a callback function that is executed when a deferred deeplink is received. This is typically after the app install is completed. ```APIDOC ## setDeferredDeeplinkCallback ### Description Sets a callback function that is invoked when a deferred deeplink is received. Deferred deeplinks are typically available after the app installation process is complete. ### Method `AdjustConfig.prototype.setDeferredDeeplinkCallback(callback: (deeplink: AdjustDeferredDeeplink) => void): void` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **callback** (function) - Required - Called with deferred deeplink ### Request Example ```javascript config.setDeferredDeeplinkCallback((deeplink) => { console.log('Deferred deeplink:', deeplink.deeplink); // Navigate based on deeplink }); ``` ### Response #### Success Response None (void) #### Response Example None ``` -------------------------------- ### Set Preinstall File Path (Android) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Sets the path to the preinstall configuration file for Android. This is used in conjunction with `enablePreinstallTracking()`. ```javascript config.setPreinstallFilePath('/data/preinstall.json'); ``` -------------------------------- ### Adjust SDK Initialization Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Initializes the Adjust SDK with the provided configuration. This must be called once per app launch. ```APIDOC ## Adjust.initSdk() ### Description Initializes the Adjust SDK with the provided configuration. ### Method `Adjust.initSdk(config: AdjustConfig)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **config** (AdjustConfig) - Required - The configuration object for the SDK. ### Request Example ```javascript const config = new AdjustConfig('abc123token', AdjustConfig.EnvironmentSandbox); Adjust.initSdk(config); ``` ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Import OAID Plugin Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Import the AdjustOaid module from the separate react-native-adjust-oaid package. This requires separate installation. ```javascript import { AdjustOaid } from 'react-native-adjust-oaid'; ``` -------------------------------- ### Enable Preinstall Tracking Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/configuration.md Enable preinstall tracking to monitor apps preinstalled by device manufacturers. You can also specify a path to a preinstall configuration file. ```javascript config.enablePreinstallTracking(); config.setPreinstallFilePath('/data/preinstall.json'); ``` -------------------------------- ### AdjustDeferredDeeplink Interface Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/types.md Represents a deferred deeplink received after app installation, containing the original deeplink URL. ```APIDOC ## AdjustDeferredDeeplink Interface ### Description Deferred deeplink received after app installation. ### Interface Definition ```typescript interface AdjustDeferredDeeplink { deeplink: string; } ``` ### Fields - **deeplink** (string) - The deeplink URL ### Provided By `AdjustConfig.setDeferredDeeplinkCallback()` ### Usage Notes A deferred deeplink is received when: 1. User clicks an Adjust tracking link 2. They are redirected to install the app 3. After installation and first launch, Adjust provides the original deeplink ``` -------------------------------- ### Add Partner Sharing Setting Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-third-party-sharing.md Set boolean sharing settings for a partner. Use this for keys like 'install_referrer' or 'skan_enabled'. ```javascript const sharing = new AdjustThirdPartySharing(true); sharing.addPartnerSharingSetting('Facebook', 'install_referrer', true); sharing.addPartnerSharingSetting('Apple', 'skan_enabled', false); Adjust.trackThirdPartySharing(sharing); ``` -------------------------------- ### Initialize Adjust SDK with Configuration Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Initializes the Adjust SDK with common, iOS-specific, and Android-specific configuration options. Ensure you have the AdjustConfig object set up before calling this. ```javascript const config = new AdjustConfig(appToken, environment); // Common config.setLogLevel(AdjustConfig.LogLevelDebug); config.setExternalDeviceId('user-id'); config.enableSendingInBackground(); // iOS config.disableIdfaReading(); // Android config.enablePlayStoreKidsCompliance(); Adjust.initSdk(config); ``` -------------------------------- ### AdjustAttribution Interface Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/types.md Represents attribution data returned by the SDK, detailing campaign and network information that led to an install. ```APIDOC ## AdjustAttribution Interface ### Description Attribution data returned by the SDK tracking campaigns and campaigns. ### Interface Definition ```typescript interface AdjustAttribution { trackerToken: string; trackerName: string; network: string; campaign: string; adgroup: string; creative: string; clickLabel: string; costType: string; costAmount: number; costCurrency: string; jsonResponse: string; fbInstallReferrer: string; } ``` ### Fields - **trackerToken** (string) - Token of the tracker that initiated the install - **trackerName** (string) - Name of the tracker that initiated the install - **network** (string) - Network name (e.g., 'Facebook', 'Google') - **campaign** (string) - Campaign identifier - **adgroup** (string) - Ad group identifier - **creative** (string) - Creative identifier - **clickLabel** (string) - Click label - **costType** (string) - Type of cost (e.g., 'cpi', 'cpc') - **costAmount** (number) - Cost amount - **costCurrency** (string) - Cost currency code - **jsonResponse** (string) - Raw JSON response from Adjust - **fbInstallReferrer** (string) - Facebook install referrer (if available) ### Provided By - `Adjust.getAttribution()` - `AdjustConfig.setAttributionCallback()` ``` -------------------------------- ### AdjustAppStoreSubscription Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-app-store-subscription.md Initializes a new AdjustAppStoreSubscription object with essential subscription details. This object is then used to track App Store purchases. ```APIDOC ## Constructor AdjustAppStoreSubscription ### Description Initializes a new AdjustAppStoreSubscription object with the subscription's price, currency, and transaction ID. ### Parameters #### Path Parameters - **price** (string) - Required - Subscription price as string. - **currency** (string) - Required - ISO 4217 currency code (e.g., 'USD'). - **transactionId** (string) - Required - App Store transaction ID. ### Request Example ```javascript const subscription = new AdjustAppStoreSubscription( '9.99', 'USD', 'transaction-id-123' ); ``` ``` -------------------------------- ### Get IDFV (iOS) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieves the IDFV (Identifier For Vendor) on iOS. The callback receives the IDFV string or null. ```javascript Adjust.getIdfv((idfv) => { if (idfv) { console.log('IDFV:', idfv); } }); ``` -------------------------------- ### Get IDFA (iOS) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieves the IDFA (Identifier For Advertisers) on iOS. The callback receives the IDFA string or null. ```javascript Adjust.getIdfa((idfa) => { if (idfa) { console.log('IDFA:', idfa); } }); ``` -------------------------------- ### Initialize AdjustThirdPartySharing Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-third-party-sharing.md Instantiate AdjustThirdPartySharing to manage sharing settings. Pass true to enable, false to disable, or null to leave unchanged. ```javascript const sharing1 = new AdjustThirdPartySharing(false); const sharing2 = new AdjustThirdPartySharing(true); ``` -------------------------------- ### Get Google Ad ID (Android) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Retrieve the Google Advertising ID on Android. This snippet should only be executed on Android platforms. ```javascript import { Platform } from 'react-native'; if (Platform.OS !== 'ios') { Adjust.getGoogleAdId((adid) => { console.log('Google Ad ID:', adid); }); } ``` -------------------------------- ### enablePreinstallTracking Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Enables preinstall tracking for Android applications. This feature requires the preinstall file path to be set using `setPreinstallFilePath()`. ```APIDOC ## enablePreinstallTracking ### Description Enable preinstall tracking (Android only). Must also set preinstall file path with `setPreinstallFilePath()`. ### Method ```javascript AdjustConfig.prototype.enablePreinstallTracking(): void ``` ### Example ```javascript config.enablePreinstallTracking(); config.setPreinstallFilePath('/path/to/preinstall.json'); ``` ``` -------------------------------- ### Adjust Tracking Links Format Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-deeplink.md Examples of deeplink formats generated or shortened by Adjust, typically using adjust.com or a custom subdomain. ```text https://adjust.com/abc123 https://your-campaign.adjust.com/xyz789 ``` -------------------------------- ### Get Last Deeplink Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieve the last processed deeplink. The callback function will be called with the deeplink string or null if no deeplink was processed. ```javascript Adjust.getLastDeeplink((deeplink) => { if (deeplink) { console.log('Last deeplink:', deeplink); } }); ``` -------------------------------- ### Environment Type Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/types.md Specifies the Adjust environment for the SDK. Use 'sandbox' for testing and 'production' for live environments. ```APIDOC ## Environment Type ### Description Specifies the Adjust environment for the SDK. ### Type Definition ```typescript type Environment = 'sandbox' | 'production' ``` ### Values - `'sandbox'`: Testing environment (no data sent to production) - `'production'`: Live environment (data sent to Adjust servers) ### Used By `AdjustConfig` constructor ``` -------------------------------- ### Enable SDK Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Enable the Adjust SDK. Use this to resume tracking after disabling. ```javascript Adjust.enable(); ``` -------------------------------- ### getAppTrackingAuthorizationStatus Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Gets the current App Tracking Transparency authorization status on iOS. This method is iOS-specific and returns the status code via a callback. ```APIDOC ## getAppTrackingAuthorizationStatus ### Description Gets the current App Tracking Transparency authorization status on iOS. This method is iOS-specific and returns the status code via a callback. ### Method ```javascript Adjust.getAppTrackingAuthorizationStatus(callback: (status: number) => void): void ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **callback** (function) - Required - Called with status code (0-3) ### Request Example ```javascript Adjust.getAppTrackingAuthorizationStatus((status) => { console.log('ATT authorization status:', status); }); ``` ### Response #### Success Response (200) * **status** (number) - Authorization status: 0=not determined, 1=denied, 2=authorized, 3=restricted. #### Response Example ```javascript { "status": 2 } ``` ``` -------------------------------- ### AdjustPlayStoreSubscription Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-play-store-subscription.md Instantiate AdjustPlayStoreSubscription with essential purchase details. Ensure all parameters are correctly provided from the Google Play purchase data. ```javascript new AdjustPlayStoreSubscription( price: number, currency: string, sku: string, orderId: string, signature: string, purchaseToken: string ) ``` ```javascript const subscription = new AdjustPlayStoreSubscription( 9.99, 'USD', 'monthly_subscription', 'order-id-123', 'signature-data', 'purchase-token-abc' ); ``` -------------------------------- ### Get ADID with Timeout Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieve the Adjust ID (ADID) with a specified timeout in milliseconds. The callback will receive the ADID or null if the timeout occurs. ```javascript Adjust.getAdidWithTimeout(2000, (adid) => { console.log('ADID:', adid); }); ``` -------------------------------- ### Get Adjust ID (ADID) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieve the Adjust ID (ADID). The callback function will be invoked with the ADID string or null if it's not available. ```javascript Adjust.getAdid((adid) => { if (adid) { console.log('ADID:', adid); } }); ``` -------------------------------- ### Get Amazon Ad ID Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieves the Amazon Advertising ID for Android devices. The callback function receives the ADID or null if it's not available. ```javascript Adjust.getAmazonAdId((adid) => { if (adid) { console.log('Amazon Ad ID:', adid); } }); ``` -------------------------------- ### Core SDK Interface Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/MANIFEST.md The Adjust class serves as the main SDK singleton, providing access to over 40 public methods for core functionalities. ```APIDOC ## Adjust Class ### Description The primary SDK singleton class that exposes the main interface for interacting with the Adjust SDK. ### Methods - **40+ public methods** for core SDK functionalities. ### Platform Specific Methods - Includes methods specific to iOS and Android platforms. ### Further Details Refer to `api-reference/adjust.md` for a complete list of methods, parameters, and examples. ``` -------------------------------- ### Get Google Ad ID Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieves the Google Advertising ID for Android devices. The callback function receives the ADID or null if it's not available. ```javascript Adjust.getGoogleAdId((adid) => { if (adid) { console.log('Google Ad ID:', adid); } }); ``` -------------------------------- ### setPreinstallFilePath Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Sets the path to the preinstall configuration file for Android. This method is used in conjunction with `enablePreinstallTracking()` to enable preinstall tracking. ```APIDOC ## setPreinstallFilePath ### Description Set path to preinstall configuration file (Android only). Validates input is a string. Used with `enablePreinstallTracking()`. ### Method ```javascript AdjustConfig.prototype.setPreinstallFilePath(preinstallFilePath: string): void ``` ### Parameters #### Path Parameters - **preinstallFilePath** (string) - Required - Path to preinstall file ### Example ```javascript config.setPreinstallFilePath('/data/preinstall.json'); ``` ``` -------------------------------- ### Get Attribution Data with Timeout Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Retrieve attribution data with a specified timeout in milliseconds. The callback will receive the attribution object or null if the timeout is reached. ```javascript Adjust.getAttributionWithTimeout(1000, (attribution) => { if (attribution) { console.log('Attribution:', attribution); } else { console.log('Attribution retrieval timed out'); } }); ``` -------------------------------- ### AdjustConfig.EnvironmentSandbox Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Constant representing the sandbox environment for Adjust SDK configuration. ```APIDOC ## AdjustConfig.EnvironmentSandbox ### Description Constant representing the sandbox environment for Adjust SDK configuration. Use this for testing purposes. ### Value ```javascript "sandbox" ``` ``` -------------------------------- ### Get App Tracking Authorization Status (iOS) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust.md Fetches the current App Tracking Transparency authorization status on iOS. The callback receives a status code. ```javascript Adjust.getAppTrackingAuthorizationStatus((status) => { console.log('ATT authorization status:', status); }); ``` -------------------------------- ### AdjustAppStorePurchase Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-app-store-purchase.md Initializes a new instance of AdjustAppStorePurchase with the product identifier and transaction ID. ```APIDOC ## Constructor ```javascript new AdjustAppStorePurchase( productId: string, transactionId: string ) ``` ### Parameters * **productId** (string) - Required - App Store product/SKU identifier * **transactionId** (string) - Required - App Store transaction ID ### Example ```javascript const purchase = new AdjustAppStorePurchase( 'com.example.premium_app', 'transaction-id-123' ); ``` ``` -------------------------------- ### AdjustPlayStorePurchase Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-play-store-purchase.md Instantiate AdjustPlayStorePurchase with the product ID and purchase token obtained from Google Play. ```javascript const purchase = new AdjustPlayStorePurchase( 'com.example.premium_app', 'purchase-token-abc123' ); ``` -------------------------------- ### Handle User Opt-out of OAID Reading Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-oaid.md Example of disabling OAID reading based on user privacy choices. This function should be called if the user has explicitly opted out of advertising tracking. ```javascript function handleUserPrivacyChoice(allowTracking) { if (!allowTracking && Platform.OS === 'android') { AdjustOaid.doNotReadOaid(); } } ``` -------------------------------- ### AdjustConfig Environment Constants Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Constants for specifying the SDK environment. Use EnvironmentSandbox for testing and EnvironmentProduction for live applications. ```javascript AdjustConfig.EnvironmentSandbox = "sandbox" AdjustConfig.EnvironmentProduction = "production" ``` -------------------------------- ### Initialize AdjustAdRevenue Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-adrevenue.md Create an instance of AdjustAdRevenue with the ad source identifier. This is the first step before setting any revenue details. ```javascript const adRevenue = new AdjustAdRevenue('MoPub'); ``` -------------------------------- ### AdjustPlayStoreSubscription Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-play-store-subscription.md Initializes a new AdjustPlayStoreSubscription object with essential purchase details. This object is then used to track Google Play Store subscription events. ```APIDOC ## Constructor AdjustPlayStoreSubscription ### Description Initializes a new AdjustPlayStoreSubscription object with essential purchase details. This object is then used to track Google Play Store subscription events. ### Parameters #### Path Parameters - **price** (number) - Yes - Subscription price as number - **currency** (string) - Yes - ISO 4217 currency code (e.g., 'USD') - **sku** (string) - Yes - Google Play subscription SKU - **orderId** (string) - Yes - Order ID from purchase - **signature** (string) - Yes - Purchase signature from Google Play - **purchaseToken** (string) - Yes - Purchase token from Google Play ### Request Example ```javascript const subscription = new AdjustPlayStoreSubscription( 9.99, 'USD', 'monthly_subscription', 'order-id-123', 'signature-data', 'purchase-token-abc' ); ``` ``` -------------------------------- ### Ad Revenue Tracking with Parameters Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-adrevenue.md Shows how to track ad revenue and include custom callback and partner parameters. This allows for more detailed analysis in your backend. ```javascript // With parameters const adRevenue3 = new AdjustAdRevenue('AdMob'); adRevenue3.setRevenue(0.50, 'USD'); adRevenue3.setAdRevenueNetwork('Google'); adRevenue3.setAdRevenueUnit('rewarded'); adRevenue3.addCallbackParameter('reward_amount', '100'); adRevenue3.addPartnerParameter('mediation_network', 'max'); Adjust.trackAdRevenue(adRevenue3); ``` -------------------------------- ### Enable with Partner-Specific Controls Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-third-party-sharing.md Enable third-party sharing while configuring specific granular options and boolean settings for different partners. ```javascript const sharing = new AdjustThirdPartySharing(true); // Facebook: enable specific data processing sharing.addGranularOption('Facebook', 'data_processing', 'on'); // Google: disable analytics sharing.addGranularOption('Google', 'analytics', 'off'); // Apple: disable SKAN sharing.addPartnerSharingSetting('Apple', 'skan_enabled', false); Adjust.trackThirdPartySharing(sharing); ``` -------------------------------- ### AdjustConfig Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Initializes a new AdjustConfig object. This object is passed to Adjust.initSdk() to configure the SDK's behavior. ```APIDOC ## AdjustConfig Constructor ### Description Initializes a new AdjustConfig object. This object is passed to Adjust.initSdk() to configure the SDK's behavior. ### Method ```javascript new AdjustConfig(appToken: string, environment: string) ``` ### Parameters #### Path Parameters - **appToken** (string) - Required - Your Adjust app token - **environment** (string) - Required - Either `AdjustConfig.EnvironmentSandbox` or `AdjustConfig.EnvironmentProduction` ### Request Example ```javascript const config = new AdjustConfig('abc123token', AdjustConfig.EnvironmentSandbox); ``` ``` -------------------------------- ### Set URL Strategy Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Configure custom domains and subdomains for SDK communication, including data residency options. This allows for more control over network requests. ```javascript config.setUrlStrategy( ['example.com', 'example.eu'], true, true ); ``` -------------------------------- ### Basic and Detailed Ad Revenue Tracking Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-adrevenue.md Demonstrates how to track ad revenue with basic and full details using the Adjust SDK. Ensure you import Adjust and AdjustAdRevenue. ```javascript import { Adjust, AdjustAdRevenue } from 'react-native-adjust'; // Basic ad revenue tracking const adRevenue1 = new AdjustAdRevenue('MoPub'); adRevenue1.setRevenue(0.75, 'USD'); Adjust.trackAdRevenue(adRevenue1); // Ad revenue with full details const adRevenue2 = new AdjustAdRevenue('AppLovin'); adRevenue2.setRevenue(1.25, 'EUR'); adRevenue2.setAdImpressionsCount(1); adRevenue2.setAdRevenueNetwork('AppLovin'); adRevenue2.setAdRevenueUnit('interstitial'); adRevenue2.setAdRevenuePlacement('level_complete_interstitial'); Adjust.trackAdRevenue(adRevenue2); ``` -------------------------------- ### Initialize AdjustDeeplink Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-deeplink.md Create a new AdjustDeeplink instance with a deeplink URL. ```javascript const deeplink = new AdjustDeeplink('https://example.com/promo?code=SAVE10'); ``` -------------------------------- ### Configuration Builder Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/MANIFEST.md The AdjustConfig class is used to build and configure the SDK, offering over 30 options for customization. ```APIDOC ## AdjustConfig Class ### Description A builder class for configuring the Adjust SDK instance before initialization. ### Options - **30+ configuration options** covering logging, tracking, features, and platform-specific settings. - Each option includes type, default value, and usage examples. ### Further Details Refer to `api-reference/adjust-config.md` and `configuration.md` for a comprehensive catalog of configuration options. ``` -------------------------------- ### AdjustConfig.EnvironmentProduction Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-config.md Constant representing the production environment for Adjust SDK configuration. ```APIDOC ## AdjustConfig.EnvironmentProduction ### Description Constant representing the production environment for Adjust SDK configuration. Use this for live applications. ### Value ```javascript "production" ``` ``` -------------------------------- ### Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-adrevenue.md Initializes a new AdjustAdRevenue instance with a specified ad source. The source identifier is crucial for categorizing revenue from different ad networks or platforms. ```APIDOC ## Constructor AdjustAdRevenue ### Description Initializes a new AdjustAdRevenue instance with a specified ad source. The source identifier is crucial for categorizing revenue from different ad networks or platforms. ### Parameters #### Path Parameters - **source** (string) - Yes - Ad source identifier (e.g., 'MoPub', 'AppLovin', 'AdMob') ### Request Example ```javascript const adRevenue = new AdjustAdRevenue('MoPub'); ``` ``` -------------------------------- ### Track Event with Revenue and Parameters Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Track a user-defined event, setting its revenue and adding custom callback parameters for advanced tracking. ```javascript const event = new AdjustEvent('event_token'); event.setRevenue(9.99, 'USD'); event.addCallbackParameter('user_id', '123'); Adjust.trackEvent(event); ``` -------------------------------- ### AdjustAppStorePurchase Constructor Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-app-store-purchase.md Instantiate AdjustAppStorePurchase with the product ID and transaction ID. ```javascript new AdjustAppStorePurchase( productId: string, transactionId: string ) ``` ```javascript const purchase = new AdjustAppStorePurchase( 'com.example.premium_app', 'transaction-id-123' ); ``` -------------------------------- ### Set Up Consent (Disable Sharing) Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/README.md Disable all third-party sharing by creating an AdjustThirdPartySharing object with `false` and tracking it. ```javascript const sharing = new AdjustThirdPartySharing(false); Adjust.trackThirdPartySharing(sharing); ``` -------------------------------- ### Add Granular Sharing Option Source: https://github.com/adjust/react_native_sdk/blob/master/_autodocs/api-reference/adjust-third-party-sharing.md Configure specific sharing options for a partner. Use this to set values like 'on' or 'off' for keys such as 'data_processing'. ```javascript const sharing = new AdjustThirdPartySharing(true); sharing.addGranularOption('Facebook', 'data_processing', 'on'); sharing.addGranularOption('Google', 'analytics', 'off'); Adjust.trackThirdPartySharing(sharing); ```