### Install react_native_util and Convert Project Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/cocoapods.md Install the react_native_util tool using Homebrew and then run the 'rn react_pod' command to automatically convert your project to use the React pod. Commit the changes afterwards. ```bash brew install jdee/tap/react_native_util cd /path/to/app rn react_pod git add . git commit -m'Converted to use React pod' ``` -------------------------------- ### Install and Run react_native_util CLI Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Use the Homebrew package manager to install the react_native_util CLI, then navigate to your app's directory and execute the 'rn react_pod' command to perform the conversion. ```bash brew install jdee/tap/react_native_util cd /path/to/app rn react_pod ``` -------------------------------- ### Run CocoaPods Install Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Install CocoaPods dependencies for your iOS project. Use `--repo-update` for the initial install or when updating podspecs. ```bash bundle exec pod install --repo-update ``` -------------------------------- ### Branch SDK Configuration Example Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch.json.md This JSON object shows an example configuration for the Branch SDK. It includes settings for debug mode, live and test keys, test instance usage, and Facebook link checking. ```json { "debugMode": true, "liveKey": "key_live_xxxx", "testKey": "key_test_yyyy", "useTestInstance": true, "enableFacebookLinkCheck": true } ``` -------------------------------- ### Install CocoaPods using Bundler Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Install CocoaPods and its dependencies using Bundler. Prefix `pod` commands with `bundle exec` for consistency. ```bash bundle install ``` -------------------------------- ### Update Podspecs and Install Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Alternatively, update podspecs separately before running `pod install`. ```bash pod repo update pod install ``` -------------------------------- ### Install NPM Dependencies Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/branch-sdk-automation-testbed/README.md Install project dependencies using yarn or npm before building the application. ```bash yarn install ``` ```bash npm install ``` -------------------------------- ### Example Podfile for New CocoaPods Project Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/cocoapods.md This is an example Podfile for a new Xcode project using CocoaPods. Replace 'MyApp' with your app's name and adjust the platform versions as needed. Ensure the Branch pod version is correct. ```Ruby target 'MyApp' do # Use the actual deployment target for your iOS app target # or comment out the following line. platform :ios, '9.0' # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # iOS dependencies pod 'Branch', '0.27.0' target 'MyAppTests' do # Add any additional dependencies for the test target end end target 'MyApp-tvOS' do # Use the actual deployment target for your tvOS app target # or comment out the following line. platform :tvos, '9.2' # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # tvOS dependencies target 'MyApp-tvOSTests' do # Add any additional dependencies for the test target end end ``` -------------------------------- ### Setting Pre-Install Campaign and Partner Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Introduces methods `setPreInstallCampaign` and `setPreInstallPartner` for setting pre-install campaign and partner information. This is useful for tracking installs originating from pre-installed apps. ```javascript setPreInstallCampaign = (campaign) => RNBranch.setPreinstallCampaign(campaign); setPreInstallPartner = (partner) => RNBranch.setPreinstallPartner(partner); ``` -------------------------------- ### Add react-native-branch and Link Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/cocoapods.md Use these commands to add the SDK and link it to your project if you are already using the React pod. Ensure you run 'pod install' afterwards. ```bash yarn add react-native-branch react-native link react-native-branch ``` -------------------------------- ### Add branch.json using react-native link Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch.json.md This command sequence adds the react-native-branch package and copies an example branch.json file to your project root before linking the native module. Ensure you have the correct version of the package installed. ```bash yarn add react-native-branch@2.0.0-beta.7 cp node_modules/react-native-branch/branch.example.json branch.json react-native link react-native-branch ``` -------------------------------- ### Configure Metro Packager Start Script Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md This script is used in Xcode's Build Phases to ensure the Metro packager is running when the app is built. It checks if the packager is already running on the specified port and launches it if necessary. ```bash export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}" echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${SRCROOT}/../node_modules/react-native/scripts/.packager.env" if [ -z "${RCT_NO_LAUNCH_PACKAGER+xxx}" ] ; then if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly" exit 2 fi else open "$SRCROOT/../node_modules/react-native/scripts/launchPackager.command" || echo "Can't start packager automatically" fi fi ``` -------------------------------- ### Add Branch Live and Test Keys to Android Manifest Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Define both live and test Branch keys in your AndroidManifest.xml within the tag. This is a one-time setup for your project. ```xml ``` -------------------------------- ### Subscribe to Branch Events with Callbacks Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Subscribe to Branch events, handling link opening start and completion. The onOpenComplete callback receives error, params, and uri. ```javascript import branch from "react-native-branch"; branch.subscribe({ onOpenStart: ({ uri }) => { console.log("Branch will open " + uri); }, onOpenComplete: ({ error, params, uri }) => { if (error) { console.log("Error from Branch opening " + uri + ": " + error); return; } console.log("Branch opened " + uri); // handle params }, }); ``` -------------------------------- ### Update Branch Pod Version Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md If you already have a Podfile, update the Branch pod to the specified version. Run `pod install` afterwards. Consider `pod install --repo-update` if your local podspec repo is old. ```ruby pod 'Branch', '0.26.0' ``` -------------------------------- ### Update Podfile for Test Configurations Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Modify your Podfile to include custom configurations for 'Test-Debug' and 'Test-Release' to ensure pods are built correctly for these environments. This example targets iOS 8.0 and above. ```Ruby platform :ios, "8.0" pod "React", path: "../node_modules/react-native" pod "react-native-branch", path: "../node_modules/react-native-branch" pod "Branch-SDK", path: "../node_modules/react-native-branch/ios" target "ExampleProject" target "ExampleProjectTests" # Add this line project "ExampleProject", "Test-Debug" => :debug, "Test-Release" => :release ``` -------------------------------- ### Add Branch Pod to Podfile (Pure RN App) Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md For pure React Native apps using `react-native link`, add the Branch pod to your Podfile. Ensure you have CocoaPods installed and run `pod install`. ```ruby platform :ios, "9.0" use_frameworks! pod "Branch", "0.26.0" target "MyApp" ``` -------------------------------- ### Re-link branch.json using react-native link Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch.json.md If react-native-branch is already integrated, unlink it first, then copy the example branch.json and re-link. This ensures the configuration file is correctly processed. ```bash react-native unlink react-native-branch cp node_modules/react-native-branch/branch.example.json branch.json react-native link react-native-branch ``` -------------------------------- ### Deferring Native Layer Initialization Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Enable deferred initialization of the native iOS/Android layer until signaled by the plugin. This addresses a race condition where apps might not receive Branch parameters on cold starts. Place the `branch.json` file in `src/main/assets` for Android or add it to your Xcode project for iOS. ```json { "deferInitForPluginRuntime": true } ``` -------------------------------- ### Remove Branch-SDK Pod (Native iOS App) Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md For native iOS apps integrating react-native-branch, remove the existing `Branch-SDK` pod from your Podfile and run `pod install`. ```ruby pod 'Branch-SDK' ``` -------------------------------- ### Handle URL Opening in Swift Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Implement the application(_:open:options:) method to handle incoming URLs for Branch deep linking in Swift projects. ```Swift func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { return RNBranch.application(app, open: url, options: options) } ``` -------------------------------- ### Using Frameworks in Podfile Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Enable building dependencies as frameworks by adding `use_frameworks!`. This may require changes to import statements in native code. ```ruby platform :ios, '9.0' use_frameworks! target 'MyApp' do pod 'React', path: '../node_modules/react-native', subspecs: [ 'Core' # ... ] end ``` -------------------------------- ### Handle URL Opening in Obj-C Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Implement the application:openURL:options: method to handle incoming URLs for Branch deep linking in Objective-C projects. ```Objective-C - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(nonnull NSDictionary *)options { return [RNBranch application:application openURL:url options:options]; } ``` -------------------------------- ### Add react-native-branch and Link Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/carthage.md Use these commands to add the react-native-branch package and link it to your project. ```bash yarn add react-native-branch@^3.0.1 react-native link react-native-branch ``` -------------------------------- ### Enable Test Instance for Debug Builds in iOS (Swift) Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Use a preprocessor macro to conditionally call `RNBranch.useTestInstance()` before initializing the session in your AppDelegate.swift file for debug builds. ```swift #if DEBUG RNBranch.useTestInstance() #endif RNBranch.initSession(launchOptions: launchOptions, isReferrable: true) ``` -------------------------------- ### Run Android App Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/branch-sdk-automation-testbed/README.md Build and run the Android application using yarn or npm. ```bash yarn android ``` ```bash npm run android ``` -------------------------------- ### Configure Android Manifest for Product Flavors Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Add a custom `AndroidManifest.xml` file for each product flavor that requires specific settings, such as enabling Branch Test Mode. This file should be placed in `android/app/src//AndroidManifest.xml`. ```xml <!– Set to true to use Branch_Test_Key –> ``` -------------------------------- ### Enable Test Instance for Debug Builds in iOS (Objective-C) Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Use a preprocessor macro to conditionally call `RNBranch.useTestInstance()` before initializing the session in your AppDelegate.m file for debug builds. ```objective-c #ifdef DEBUG [RNBranch useTestInstance]; #endif [RNBranch initSessionWithLaunchOptions:launchOptions isReferrable:YES]; ``` -------------------------------- ### Implement openURL Method Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Adds an `openURL` method for programmatic deep linking from any part of an app, such as a QR code reader. ```javascript openURL ``` -------------------------------- ### Configure Cartfile for Carthage Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/carthage.md Add this line to your Cartfile to specify the Branch SDK version for Carthage. The required version may differ; the SDK will inform you at runtime if an incorrect version is specified. ```bash github "BranchMetrics/ios-branch-deep-linking" "0.27.1" ``` -------------------------------- ### Build Release APK Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/branch-sdk-automation-testbed/README.md Run this command to create a release APK for your React Native application. ```bash yarn android-release ``` -------------------------------- ### Continue User Activity in Swift Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Implement the application(_:continue:restorationHandler:) method to continue user activities for Branch deep linking in Swift projects. ```Swift func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { return RNBranch.continue(userActivity) } ``` -------------------------------- ### Set ANDROID_HOME for Android Tests Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/CONTRIBUTING.md Configure the ANDROID_HOME environment variable to point to your Android SDK location before running Android tests. If not set, it defaults to '~/Library/Android/sdk' on macOS. ```bash export ANDROID_HOME=/path/to/android/sdk bundle exec fastlane test_android ``` ```bash ANDROID_HOME=/path/to/android/sdk bundle exec fastlane test_android ``` -------------------------------- ### iOS Podfile Configuration Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Configure your Podfile to include React Native and its dependencies. Replace 'MyApp' with your application's target name. Adjust subspecs as needed. ```ruby platform :ios, '9.0' target 'MyApp' do pod 'React', path: '../node_modules/react-native', subspecs: [ 'Core', 'CxxBridge', 'DevSupport', 'RCTActionSheet', 'RCTAnimation', 'RCTBlob', 'RCTGeolocation', 'RCTImage', 'RCTLinkingIOS', 'RCTNetwork', 'RCTSettings', 'RCTText', 'RCTVibration', 'RCTWebSocket' ] pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga' pod 'Folly', podspec: '../node_modules/react-native/third-party-podspecs/Folly.podspec' end target 'MyAppTests' do pod 'React', path: '../node_modules/react-native', subspecs: %w[Core CxxBridge] pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga' pod 'Folly', podspec: '../node_modules/react-native/third-party-podspecs/Folly.podspec' end ``` -------------------------------- ### Build Debug APK Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/branch-sdk-automation-testbed/README.md Run this command to create a debug APK for your React Native application. ```bash yarn android-build ``` -------------------------------- ### Creating Branch QR Code Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Provides a `getBranchQRCode` method for generating Branch QR codes. This function takes settings, Branch Universal Object options, link properties, and control parameters to generate a QR code string. ```javascript getBranchQRCode: ( settings: BranchQRCodeSettings, branchUniversalObject: BranchUniversalObjectOptions, linkProperties: BranchLinkProperties, controlParams: BranchLinkControlParams, ) => Promise; ``` -------------------------------- ### Conditional Branch SDK Initialization (Objective-C) Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Use this Objective-C code in your AppDelegate to conditionally initialize the Branch SDK with a test instance based on the USE_BRANCH_TEST_INSTANCE preprocessor macro. ```Objective-C #ifdef USE_BRANCH_TEST_INSTANCE [RNBranch useTestInstance]; #endif [RNBranch initSessionWithLaunchOptions:launchOptions isReferrable:YES]; ``` -------------------------------- ### Handle New Intent on Android Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md This Java code snippet shows how to integrate RNBranchModule.onNewIntent for Android to handle incoming intents, replacing older methods like setIntent. ```java @Override public void onNewIntent(Intent intent) { super.onNewIntent(intent); RNBranchModule.onNewIntent(intent); } ``` -------------------------------- ### Continue User Activity in Obj-C Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Implement the application:continueUserActivity:restorationHandler: method to continue user activities for Branch deep linking in Objective-C projects. ```Objective-C - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> *restorableObjects))restorationHandler { return [RNBranch continueUserActivity:userActivity]; } ``` -------------------------------- ### Adding Snapchat Partner Parameters Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Introduces the `addSnapPartnerParameter()` method to support setting Snapchat partner parameters. This is useful for tracking campaign performance on Snapchat. ```javascript addSnapPartnerParameter: (key, value) => RNBranch.addSnapPartnerParameter(key, value) ``` -------------------------------- ### Fixing Creation Source Type Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Addressed an issue with the `~creation_source` type, ensuring it is correctly handled. ```javascript fixCreationSourceType: (data) => { // ... implementation details ... } ``` -------------------------------- ### Conditional Branch SDK Initialization (Swift) Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md This Swift code for your AppDelegate conditionally initializes the Branch SDK with a test instance if the USE_BRANCH_TEST_INSTANCE compiler flag is defined. ```Swift #if USE_BRANCH_TEST_INSTANCE RNBranch.useTestInstance() #endif RNBranch.initSession(launchOptions: launchOptions, isReferrable: true) ``` -------------------------------- ### Configure Test Key for Debug Builds in Android Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Create a debug-specific AndroidManifest.xml to enable the test Branch key for debug builds. Ensure the package name matches your main manifest. ```xml ``` -------------------------------- ### Set Branch Keys in branch.json Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md This version adds support for setting Branch keys directly within a `branch.json` file. ```json { // Branch keys configuration } ``` -------------------------------- ### Run Native Unit Tests Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/CONTRIBUTING.md Execute native unit tests for Android and iOS using Fastlane. Ensure Ruby 2.4.0 or a compatible version is used. The ANDROID_HOME environment variable must be set for Android tests. ```bash yarn bundle install bundle exec fastlane test_android bundle exec fastlane test_ios ``` -------------------------------- ### Setting DMA Compliance Parameters Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Introduces the `setDMAParamsForEEA()` method to support DMA (Digital Markets Act) compliance for users in the EEA. This helps manage user consent and data privacy. ```javascript setDMAParamsForEEA: (params) => RNBranch.setDMAParamsForEEA(params) ``` -------------------------------- ### Define Android Product Flavors in build.gradle Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch-environments.md Configure custom `productFlavors` in your `android/app/build.gradle` file to manage different app versions or environments. This allows for distinct application IDs and version names. ```gradle android { ... defaultConfig { ... } buildTypes { ... } productFlavors { stage { applicationIdSuffix ".stage" versionNameSuffix "-stage" } } } ``` -------------------------------- ### Setting ODM Info Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Exposes a new method `setODMInfo` to set ODM (Online Data Management) information. This can be used for custom data management within the SDK. ```javascript setODMInfo: (odminfo) => RNBranch.setODMInfo(odminfo) ``` -------------------------------- ### Gemfile for CocoaPods Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Specify the CocoaPods version to use with a Gemfile for reproducible builds. Commit both Gemfile and Gemfile.lock to SCM. ```ruby source 'https://rubygems.org' # Install any 1.x >= 1.6 gem 'cocoapods', '~> 1.6' ``` -------------------------------- ### Setting SDK Wait Time for Third-Party APIs Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Exposes a new method `setSDKWaitTimeForThirdPartyAPIs` to configure the SDK's wait time for third-party API responses. This can help manage asynchronous operations. ```javascript setSDKWaitTimeForThirdPartyAPIs: (waitTime) => RNBranch.setSDKWaitTimeForThirdPartyAPIs(waitTime) ``` -------------------------------- ### Clear Partner Parameters Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Clears all previously set partner parameters. ```javascript branch.clearPartnerParameters(); ``` -------------------------------- ### Add BranchEvent Class and BUO API Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Introduces the `BranchEvent` class and a new Branch Universal Object (BUO) API. Requires `requiresMainQueueSetup` for RN versions v0.49+. ```javascript requiresMainQueueSetup: true ``` -------------------------------- ### Add Branch Pod to Existing Podfile Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/cocoapods.md Add this line to your Podfile if you are already using CocoaPods. The required Branch SDK version may differ and will be indicated by an error at runtime if incorrect. ```Ruby pod 'Branch', '0.27.0' ``` -------------------------------- ### Add Facebook Partner Parameter Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Use this method to add Facebook partner parameters for tracking. Refer to Facebook documentation for parameter details. ```javascript branch.addFacebookPartnerParameter( "em", "11234e56af071e9c79927651156bd7a10bca8ac34672aba121056e2698ee7088" ); ``` -------------------------------- ### Add sendCommerceEvent Method Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Introduces the `sendCommerceEvent` method for tracking e-commerce related events. ```javascript sendCommerceEvent ``` -------------------------------- ### Objective-C Import Statements Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/convert-to-react-pod.md Use these import statements in your Objective-C code depending on whether you are using frameworks. ```objectivec @import react_native_branch; ``` ```objectivec #import ``` -------------------------------- ### Add setRequestMetadata Support Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Adds `setRequestMetadata` support to the RNBranch module for setting custom metadata on requests. ```javascript setRequestMetadata ``` -------------------------------- ### Fixing Clear Partner Parameters Call Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Resolved a bug in the `clearPartnerParameters` call to ensure it functions correctly. ```javascript clearPartnerParameters: () => RNBranch.clearPartnerParameters() ``` -------------------------------- ### Setting Consumer Protection Attribution Level Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Exposes a new method `setConsumerProtectionAttributionLevel` to set the Consumer Protection Platform (CPP) level. This is relevant for privacy-related compliance. ```javascript setConsumerProtectionAttributionLevel: (level) => RNBranch.setConsumerProtectionAttributionLevel(level) ``` -------------------------------- ### Setting Branch Base API URL Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Added support for changing the Branch base API URL through the `branch.json` file. This allows for custom API endpoints or regional configurations. ```json { "branch_api_url": "https://your-custom-branch-api.com" } ``` -------------------------------- ### Setting Identity Asynchronously Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Introduces a new function `setIdentityAsync` which provides a callback for setting the user identity. This is an asynchronous operation. ```javascript setIdentityAsync: (userId, customData, callback) => RNBranch.setIdentity(userId, customData, callback) ``` -------------------------------- ### Exporting Success and Error Events Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Added exports for success and error events, allowing developers to better handle and track the outcomes of Branch SDK operations. ```javascript export { successEvent, errorEvent }; ``` -------------------------------- ### Branch Configuration Keys Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/docs/branch.json.md These keys can be used within the branch.json file to configure the Branch SDK. Note that branchKey overrides other key settings. Support for Android branchKey requires version 3.x of react-native-branch. ```json { "branchKey": "YOUR_BRANCH_KEY", "liveKey": "YOUR_LIVE_KEY", "testKey": "YOUR_TEST_KEY", "useTestInstance": false, "debugMode": true, "enableFacebookLinkCheck": true } ``` -------------------------------- ### Fixing Return Type for showShareSheet Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Corrected the return type definition for the `BranchUniversalObject.showShareSheet()` method. ```javascript showShareSheet: (shareOptions) => Promise ``` -------------------------------- ### Update Android Branch Instance Call Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md In Android applications, update the call to `Branch.getAutoInstance` in `Application.onCreate` to `RNBranchModule.getAutoInstance`. ```java RNBranchModule.getAutoInstance ``` -------------------------------- ### Add Android Branch SDK Dependency Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md For Android projects, add the Branch SDK library dependency to your `app/build.gradle` file. ```gradle implementation 'io.branch.sdk.android:library:3.+' ``` -------------------------------- ### Retrieve Last Attributed Touch Data Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Fetches the last attributed touch data for a given attribution window. The callback receives an object containing the data. ```javascript const attributionWindow = 365; branch.lastAttributedTouchData(attributionWindow, (latData) => { // latData is an Object }); ``` -------------------------------- ### Fixing LATD on iOS and setIdentityAsync on Android Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Fixed bugs related to returning LATD (Link Attribution Data) on iOS and the `setIdentityAsync` method on Android. ```javascript fixLATDAndSetIdentityAsync: () => { // ... implementation details ... } ``` -------------------------------- ### Updating React Native to 0.63.0 Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Updated the project's React Native dependency to version 0.63.0. ```javascript react-native: 0.63.0 ``` -------------------------------- ### Setting Meta Anonymous ID Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Exposes a new method `setAnonID` to set the Meta anonymous ID. This is useful for integrating with Meta's advertising platforms. ```javascript setAnonID: (anonID) => RNBranch.setAnonID(anonID) ``` -------------------------------- ### Fixing Typing for isTrackingDisabled Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Corrected the typing for the `isTrackingDisabled` method to accurately return a `Promise`. ```typescript isTrackingDisabled: () => Promise ``` -------------------------------- ### Changing Custom Data Type Definition Source: https://github.com/branchmetrics/react-native-branch-deep-linking-attribution/blob/master/ChangeLog.md Modified the type definition for `customData` to be a `String String dictionary`, providing more flexibility for custom data payloads. ```javascript changeCustomDataType: (data) => { // ... implementation details ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.