### Add justtrack SDK Registry to Unity Manifest Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/README.md This snippet shows how to add the justtrack SDK registry to your Unity project's manifest.json file. This is a prerequisite for installing the SDK and allows Unity's package manager to find and install the justtrack SDK. ```json { "dependencies": { "io.justtrack.justtrack-unity-sdk": "5.0.0" }, "scopedRegistries": [ { "name": "JustTrack Registry", "url": "https://registry.npmjs.org", "scopes": [ "io.justtrack" ] } ] } ``` -------------------------------- ### Get Install Instance ID Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieve the unique identifier for this app installation instance. This endpoint is available on Android, React Native. ```APIDOC ## Get Install Instance ID ### Description Retrieve the unique identifier for this app installation instance. ### Method GET (Implicit) ### Endpoint N/A (SDK method) ### Parameters None ### Request Example ```java // Android (Java) sdk.getInstallInstanceId().registerCallback(new Callback() { @Override public void resolve(String installId) { Log.d("justtrack", "Install ID: " + installId); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) CoroutineScope(Dispatchers.Main).launch { try { val installInstanceId = sdk.installInstanceId.await() Log.d("justtrack", "Install ID: $installInstanceId") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```typescript // React Native const installId = await JustTrackSdk.getInstallInstanceId(); console.log('Install ID:', installId); ``` ### Response #### Success Response - **installId** (string) - The unique identifier for the app installation instance. #### Response Example ```json { "installId": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` -------------------------------- ### Get Install Instance ID Across Platforms Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieves the unique identifier for the current app installation instance. This is supported on Android (Java/Kotlin) and React Native. The function returns a string representing the install ID. ```java // Android (Java) - Get install instance ID sdk.getInstallInstanceId().registerCallback(new Callback() { @Override public void resolve(String installId) { Log.d("justtrack", "Install ID: " + installId); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) - Get install instance ID with coroutines CoroutineScope(Dispatchers.Main).launch { try { val installInstanceId = sdk.installInstanceId.await() Log.d("justtrack", "Install ID: $installInstanceId") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```typescript // React Native - Get install instance ID const installId = await JustTrackSdk.getInstallInstanceId(); console.log('Install ID:', installId); ``` -------------------------------- ### Install EDM4U via OpenUPM Command Line Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This shell command installs the External Dependency Manager for Unity (EDM4U) using the OpenUPM command-line interface. OpenUPM is a popular registry for Unity packages, providing an alternative to the default Unity Package Manager. ```shell openupm add com.google.external-dependency-manager ``` -------------------------------- ### Initialize justtrack SDK Source: https://context7.com/justtrackio/sdk-demo/llms.txt Initializes the justtrack SDK with your API token. Supports manual start mode and custom user IDs. Ensure the API token is obtained from the justtrack dashboard. ```java // Android (Java) - Initialize SDK in Activity onCreate import io.justtrack.JustTrackSdk; import io.justtrack.JustTrackSdkBuilder; public class MainActivity extends Activity { private JustTrackSdk sdk; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Your API token from justtrack dashboard String TOKEN = "your_api_token"; JustTrackSdkBuilder builder = new JustTrackSdkBuilder(this, TOKEN); builder.setManualStart(true); // Optional: require explicit start() call builder.setUserId("custom_user_id"); // Optional: set custom user ID sdk = builder.build(); } @Override protected void onDestroy() { sdk.shutdown(); super.onDestroy(); } } ``` ```kotlin // Android (Kotlin) - Initialize SDK import io.justtrack.JustTrackSdk import io.justtrack.JustTrackSdkBuilder class MainActivity : Activity() { private lateinit var sdk: JustTrackSdk override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val builder = JustTrackSdkBuilder(this, "your_api_token") builder.setManualStart(true) builder.setUserId("custom_user_id") sdk = builder.build() } override fun onDestroy() { sdk.shutdown() super.onDestroy() } } ``` ```swift // iOS (Swift) - Initialize SDK import JustTrackSDK let sdk = try! JustTrackSdkBuilder(apiToken: "your_api_token") .set(manualStart: true) .build() ``` ```typescript // React Native - Initialize SDK import * as JustTrackSdk from 'react-native-justtrack-sdk'; const initializeSDK = async () => { const builder = new JustTrackSdk.JusttrackSdkBuilder('your_api_token'); builder.withManualStart(true); builder.withUserId('custom_user_id'); builder.initialize(); }; ``` ```csharp // Unity - SDK initializes automatically via JustTrackSDKBehaviour // Configure in Unity Editor with API token // Check SDK status: bool isRunning = JustTrackSDK.IsRunning(); ``` -------------------------------- ### Start and Stop justtrack SDK Tracking Source: https://context7.com/justtrackio/sdk-demo/llms.txt Controls the start and stop of user activity tracking by the justtrack SDK. When manual start is enabled, tracking requires an explicit call to start(). ```java // Android (Java) - Start/Stop tracking // Start tracking - user IDs, installs, and events will be tracked sdk.start(); // Stop tracking - no IDs or events will be tracked/reported sdk.stop(); ``` ```kotlin // Android (Kotlin) - Start/Stop tracking sdk.start() sdk.stop() ``` ```swift // iOS (Swift) - Start/Stop tracking sdk.start() sdk.stop() ``` ```typescript // React Native - Start/Stop tracking await JustTrackSdk.start(); await JustTrackSdk.stop(); ``` ```csharp // Unity - Start/Stop tracking JustTrackSDK.Start(); JustTrackSDK.Stop(); // Check if SDK is running if (JustTrackSDK.IsRunning()) { JustTrackSDK.Stop(); } ``` -------------------------------- ### Install justtrack SDK for React Native via npm Source: https://github.com/justtrackio/sdk-demo/blob/main/react-native/README.md Installs the justtrack SDK for React Native using npm. This is the standard package manager for Node.js projects. ```shell npm install react-native-justtrack-sdk --save ``` -------------------------------- ### Install justtrack SDK using CocoaPods Source: https://github.com/justtrackio/sdk-demo/blob/main/swift/README.md This snippet shows how to add the justtrack SDK to an iOS project using CocoaPods. It specifies the SDK version to be installed. Ensure you have CocoaPods installed and run 'pod install' in your project directory after adding this line to your Podfile. ```ruby pod 'JustTrackSDK', '5.0.0' ``` -------------------------------- ### Install justtrack SDK for React Native via yarn Source: https://github.com/justtrackio/sdk-demo/blob/main/react-native/README.md Installs the justtrack SDK for React Native using yarn. Yarn is an alternative package manager for Node.js projects. ```shell yarn add react-native-justtrack-sdk ``` -------------------------------- ### Publish Predefined Login Events (Java, Swift, C#) Source: https://context7.com/justtrackio/sdk-demo/llms.txt Utilize predefined event types for common scenarios like user login. These events simplify tracking standard user actions. Examples are provided for Java, Swift, and C#. ```java import io.justtrack.JtLoginEvent; // Android (Java) - Predefined login event sdk.publishEvent( new JtLoginEvent("success", "facebook") .addDimension("id", "user_123") .addDimension("first_login", "true") ).registerCallback(new Callback() { @Override public void resolve(Void unused) { Log.d("justtrack", "Login event sent"); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```swift import JustTrackSDK // iOS (Swift) - Predefined login event let event = JtLoginEvent(jtAction: "login") sdk.publish(event: event).observe { result in switch result { case .success: print("Login event published") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```csharp using JustTrack; // Unity - Predefined login event JustTrackSDK.PublishEvent(new JtLoginEvent("login")); ``` -------------------------------- ### Configure Maven Repository for justtrack SDK (Gradle) Source: https://github.com/justtrackio/sdk-demo/blob/main/java/README.md This snippet shows how to add the justtrack SDK's Maven repository to your project's build configuration. This allows Gradle to find and download the SDK artifacts. ```groovy allprojects { repositories { maven { url = uri("https://sdk.justtrack.io/maven") } } } ``` -------------------------------- ### Get Attribution Data Across Platforms Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieve attribution information, including campaign details and user identifiers. This functionality is demonstrated in Java, Kotlin, Swift, TypeScript, and C#. ```java // Android (Java) - Get attribution import io.justtrack.Attribution; import io.justtrack.Callback; sdk.getAttribution().registerCallback(new Callback() { @Override public void resolve(Attribution response) { String campaignName = response.getCampaign().getName(); Log.d("justtrack", "Campaign: " + campaignName); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) - Get attribution with coroutines import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch CoroutineScope(Dispatchers.Main).launch { try { val response = sdk.attribution.await() val campaignName = response.campaign.name Log.d("justtrack", "Campaign: $campaignName") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```swift // iOS (Swift) - Get attribution import JustTrackSDK sdk.attribution.observe { result in switch result { case let .success(attributionResponse): let userId = attributionResponse.justtrackUserId let campaign = attributionResponse.campaign print("User ID: (userId), Campaign: (campaign)") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```typescript // React Native - Get attribution import * as JustTrackSdk from 'react-native-justtrack-sdk'; const attributionData: JustTrackSdk.AttributionData = await JustTrackSdk.getAttribution(); console.log('User ID:', attributionData.justtrackUserId); console.log('Campaign:', attributionData.campaign.name); ``` ```csharp // Unity - Get attribution using JustTrack; JustTrackSDKBehaviour.GetAttribution( (attribution) => { Debug.Log("Attribution: " + attribution); }, (error) => { Debug.LogError("Error: " + error); } ); ``` -------------------------------- ### Add justtrack SDK Dependency (Gradle) Source: https://github.com/justtrackio/sdk-demo/blob/main/java/README.md This snippet demonstrates how to declare the justtrack Android SDK as a dependency in your application's module-level build.gradle file. This ensures the SDK is included in your project. ```groovy dependencies { implementation("io.justtrack:justtrack-android-sdk:5.0.0") } ``` -------------------------------- ### Get Advertiser ID Information Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieve the device's advertising identifier and limited ad tracking status. This endpoint is available on Android, iOS, React Native, and Unity. ```APIDOC ## Get Advertiser ID Information ### Description Retrieve the device's advertising identifier and limited ad tracking status. ### Method GET (Implicit) ### Endpoint N/A (SDK method) ### Parameters None ### Request Example ```java // Android (Java) sdk.getAdvertiserIdInfo().registerCallback(new Callback() { @Override public void resolve(AdvertiserIdInfo info) { String advertiserId = info.getAdvertiserId(); boolean isLimitedAdTracking = info.isLimitedAdTracking(); Log.d("justtrack", "Advertiser ID: " + advertiserId); Log.d("justtrack", "Limited tracking: " + isLimitedAdTracking); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) CoroutineScope(Dispatchers.Main).launch { try { val advertiserIdInfo = sdk.advertiserIdInfo.await() val advertiserId = advertiserIdInfo.advertiserId val isLimitedAdTracking = advertiserIdInfo.isLimitedAdTracking Log.d("justtrack", "Advertiser ID: $advertiserId") Log.d("justtrack", "Limited tracking: $isLimitedAdTracking") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```swift // iOS (Swift) sdk.getAdvertiserIdInfo().observe { result in switch result { case let .success(info): let advertiserId = info.advertiserId let limitedAdTracking = info.limitedAdTracking print("Advertiser ID: (advertiserId ?? "nil")") print("Limited tracking: (limitedAdTracking)") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```typescript // React Native const advertiserInfo: JustTrackSdk.AdvertiserIdInfo = await JustTrackSdk.getAdvertiserIdInfo(); console.log('Advertiser ID:', advertiserInfo.advertiserId); console.log('Limited tracking:', advertiserInfo.isLimitedAdTracking); ``` ```csharp // Unity JustTrackSDK.GetAdvertiserIdInfo( (advertiserIdInfo) => { Debug.Log("Advertiser Info: " + advertiserIdInfo); }, (error) => { Debug.LogError("Error: " + error); } ); ``` ### Response #### Success Response - **advertiserId** (string) - The advertising identifier. - **isLimitedAdTracking** (boolean) - Indicates if limited ad tracking is enabled. #### Response Example ```json { "advertiserId": "00000000-0000-0000-0000-000000000000", "isLimitedAdTracking": false } ``` ``` -------------------------------- ### Get Test Group ID Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieve the A/B test group identifier assigned to the current user. This endpoint is available on Android, iOS, React Native, and Unity. ```APIDOC ## Get Test Group ID ### Description Retrieve the A/B test group identifier assigned to the current user (values 1, 2, or 3). ### Method GET (Implicit) ### Endpoint N/A (SDK method) ### Parameters None ### Request Example ```java // Android (Java) sdk.getTestGroupId().registerCallback(new Callback() { @Override public void resolve(Integer testGroupId) { if (testGroupId != null) { Log.d("justtrack", "Test Group ID: " + testGroupId); } } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) CoroutineScope(Dispatchers.Main).launch { try { val testGroupId: Int? = sdk.testGroupId.await() Log.d("justtrack", "Test Group ID: $testGroupId") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```swift // iOS (Swift) if let testGroupId = sdk.testGroupId { print("Test Group ID: (testGroupId)") } else { print("Test group ID not available") } ``` ```typescript // React Native const testGroupId: JustTrackSdk.TestGroupId | null = await JustTrackSdk.getTestGroupId(); console.log('Test Group ID:', testGroupId); ``` ```csharp // Unity JustTrackSDK.GetTestGroupId( (id) => { Debug.Log("Test Group ID: " + id); }, (error) => { Debug.LogError("Error: " + error); } ); ``` ### Response #### Success Response - **testGroupId** (integer) - The A/B test group identifier (1, 2, or 3). #### Response Example ```json { "testGroupId": 2 } ``` ``` -------------------------------- ### Add EDM4U as a Package Dependency in Unity Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This JSON snippet demonstrates how to declare EDM4U as a dependency in a Unity project's `package.json` file. This ensures that EDM4U is automatically installed and managed by Unity's Package Manager when the project is built or shared. ```json { "dependencies": { "com.google.external-dependency-manager": "1.2.178" } } ``` -------------------------------- ### Publish Predefined Ad Events (TypeScript) Source: https://context7.com/justtrackio/sdk-demo/llms.txt Send predefined ad interaction events using the JustTrack SDK in React Native. This example demonstrates publishing an ad click event with various parameters including duration and time unit. ```typescript import { JtAdEvent, TimeUnitGroup } from 'react-native-justtrack-sdk'; // React Native - Predefined ad event await JustTrackSdk.publishEvent(new JtAdEvent( 'clicked', // action 'bundle_id', // bundle ID 'instance_name', // instance name 'ad_network', // ad network 'ad_placement', // placement 'sdk_name', // SDK name 'ad_segment', // segment 'ad_unit', // ad unit 'testgroup', // test group 3.0, // duration TimeUnitGroup.Seconds )); ``` -------------------------------- ### Add Google Play Games Library Dependency (XML) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Specifies the Google Play Games library as an Android dependency using XML. This configuration ensures the dependency is managed by the Android Resolver and installed via the Android SDK manager if not found. It supports specific versions and partial matches. ```xml extra-google-m2repository ``` -------------------------------- ### Get Advertiser ID Information Across Platforms Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieves the device's advertising identifier and limited ad tracking status. This functionality is available on Android (Java/Kotlin), iOS (Swift), React Native, and Unity (C#). The output includes the advertiser ID and a boolean indicating if ad tracking is limited. ```java // Android (Java) - Get advertiser ID info import io.justtrack.AdvertiserIdInfo; import io.justtrack.Callback; sdk.getAdvertiserIdInfo().registerCallback(new Callback() { @Override public void resolve(AdvertiserIdInfo info) { String advertiserId = info.getAdvertiserId(); boolean isLimitedAdTracking = info.isLimitedAdTracking(); Log.d("justtrack", "Advertiser ID: " + advertiserId); Log.d("justtrack", "Limited tracking: " + isLimitedAdTracking); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) - Get advertiser ID info with coroutines CoroutineScope(Dispatchers.Main).launch { try { val advertiserIdInfo = sdk.advertiserIdInfo.await() val advertiserId = advertiserIdInfo.advertiserId val isLimitedAdTracking = advertiserIdInfo.isLimitedAdTracking Log.d("justtrack", "Advertiser ID: $advertiserId") Log.d("justtrack", "Limited tracking: $isLimitedAdTracking") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```swift // iOS (Swift) - Get advertiser ID info import JustTrackSDK sdk.getAdvertiserIdInfo().observe { result in switch result { case let .success(info): let advertiserId = info.advertiserId let limitedAdTracking = info.limitedAdTracking print("Advertiser ID: (advertiserId ?? "nil")") print("Limited tracking: (limitedAdTracking)") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```typescript // React Native - Get advertiser ID info import * as JustTrackSdk from 'react-native-justtrack-sdk'; const advertiserInfo: JustTrackSdk.AdvertiserIdInfo = await JustTrackSdk.getAdvertiserIdInfo(); console.log('Advertiser ID:', advertiserInfo.advertiserId); console.log('Limited tracking:', advertiserInfo.isLimitedAdTracking); ``` ```csharp // Unity - Get advertiser ID info using JustTrack; JustTrackSDK.GetAdvertiserIdInfo( (advertiserIdInfo) => { Debug.Log("Advertiser Info: " + advertiserIdInfo); }, (error) => { Debug.LogError("Error: " + error); } ); ``` -------------------------------- ### Get Test Group ID Across Platforms Source: https://context7.com/justtrackio/sdk-demo/llms.txt Retrieves the A/B test group identifier assigned to the current user, which can be 1, 2, or 3. This feature is available on Android (Java/Kotlin), iOS (Swift), React Native, and Unity (C#). The output is an integer representing the test group ID or null/not available. ```java // Android (Java) - Get test group ID sdk.getTestGroupId().registerCallback(new Callback() { @Override public void resolve(Integer testGroupId) { if (testGroupId != null) { Log.d("justtrack", "Test Group ID: " + testGroupId); } } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Error: " + throwable.getMessage()); } }); ``` ```kotlin // Android (Kotlin) - Get test group ID with coroutines CoroutineScope(Dispatchers.Main).launch { try { val testGroupId: Int? = sdk.testGroupId.await() Log.d("justtrack", "Test Group ID: $testGroupId") } catch (throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } } ``` ```swift // iOS (Swift) - Get test group ID if let testGroupId = sdk.testGroupId { print("Test Group ID: (testGroupId)") } else { print("Test group ID not available") } ``` ```typescript // React Native - Get test group ID const testGroupId: JustTrackSdk.TestGroupId | null = await JustTrackSdk.getTestGroupId(); console.log('Test Group ID:', testGroupId); ``` ```csharp // Unity - Get test group ID using JustTrack; JustTrackSDK.GetTestGroupId( (id) => { Debug.Log("Test Group ID: " + id); }, (error) => { Debug.LogError("Error: " + error); } ); ``` -------------------------------- ### Building Unity Plugin from Source (Gradle) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Commands to build the Unity plugin from source using Gradle. It includes options for specifying the Java home directory if Java 11 is not the default. ```shell ./gradlew build ``` ```shell ./gradlew.bat build ``` ```shell ./gradlew build -Dorg.gradle.java.home= ``` -------------------------------- ### Run Gradle Tests (Shell) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Execute all tests using Gradle. This command is compatible with Linux and macOS environments. For Windows, a different script is used. ```shell ./gradlew test ``` -------------------------------- ### Build Release with Gradle Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Initiate the release process using the Gradle build script. This command triggers tasks to update the Unity package, copy the plugin, and modify metadata files. ```shell ./gradlew release ``` -------------------------------- ### Run Gradle Tests (Windows Batch) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Execute all tests using Gradle on Windows. This command utilizes the Windows batch script for running tests. ```batch ./gradlew.bat test ``` -------------------------------- ### Add Registry to Unity Package Manager (XML) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This XML configuration snippet demonstrates how to define a custom registry for the Unity Package Manager (UPM) using the Package Manager Resolver (PMR). It specifies the registry's name, URL, and links to its terms of service and privacy policy, along with defining the scopes it covers. This allows for easier distribution and management of UPM packages. ```xml com.coolstuff ``` -------------------------------- ### Create Git Release Commit Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Generate a Git commit for the release. This command automatically creates an annotated commit using the description from CHANGELOG.md. ```shell ./gradlew gitCreateReleaseCommit ``` -------------------------------- ### Tag Git Release Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Tag the current release in Git. This command creates an annotated tag using the plugin version and pushes the tag to the remote repository. ```shell ./gradlew gitTagRelease ``` -------------------------------- ### Configure Gradle Test Execution Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Customize test runs by setting Gradle properties. Options include enabling interactive mode, including/excluding test types and modules, and excluding specific tests. The CONTINUE_ON_FAIL_FOR_TESTS_ENABLED property controls test execution flow upon failure. ```shell ./gradlew test \ -PINTERACTIVE_MODE_TESTS_ENABLED=0 \ -PINCLUDE_TEST_TYPES="Integration" \ -PEXCLUDE_TEST_MODULES="AndroidResolver,iOSResolver" ``` -------------------------------- ### Download Artifacts with Gradle Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This Gradle script is responsible for resolving Android dependencies, handling conflicts, and downloading necessary AAR and JAR files. It also processes these artifacts for Unity's build system, patching `AndroidManifest.xml` with the project's bundle ID. ```gradle apply plugin: 'com.android.application' android { // ... } dependencies { // ... } // Android Resolver Repos Start // Android Resolver Repos End // Android Resolver Dependencies Start // Android Resolver Dependencies End // Android Resolver Exclusions Start // Android Resolver Exclusions End ``` -------------------------------- ### Append Text to Podfile in Unity (C#) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This C# script for Unity allows appending custom text to the generated Podfile during the iOS build process. It uses the PostProcessBuildAttribute to hook into the build pipeline and modify the Podfile, enabling the addition of new targets or pods. Ensure the PostProcessBuildAttribute value is between 40 and 50 to avoid conflicts. ```csharp using System.IO; using UnityEditor; using UnityEditor.Callbacks; using UnityEngine; public class PostProcessIOS : MonoBehaviour { // Must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and // that it's added before "pod install" (50). [PostProcessBuildAttribute(45)] private static void PostProcessBuild_iOS(BuildTarget target, string buildPath) { if (target == BuildTarget.iOS) { using (StreamWriter sw = File.AppendText(buildPath + "/Podfile")) { // E.g. add an app extension sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend"); } } } } ``` -------------------------------- ### Exporting Unity Plugin with Version Handler Disabled Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This command demonstrates how to import a Unity package and export a plugin, ensuring the Version Handler is disabled using the -gvh_disable flag. This is crucial for correct integration when redistributing plugins that depend on EDM4U. ```shell Unity -gvh_disable \ -batchmode \ -importPackage external-dependency-manager-1.2.46.0.unitypackage \ -projectPath MyPluginProject \ -exportPackage Assets MyPlugin.unitypackage \ -quit ``` -------------------------------- ### Configure iOS Dependencies with CocoaPods Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md This XML snippet demonstrates how to declare iOS dependencies using CocoaPods within the project's dependency configuration. It specifies the pod name, version, and other relevant settings like bitcode enablement and target SDK. ```xml ``` -------------------------------- ### Publish Custom Events with Dimensions (Java, Kotlin, Swift, TypeScript, C#) Source: https://context7.com/justtrackio/sdk-demo/llms.txt Send custom app events with key-value dimensions to track user behavior. Events can include up to 10 dimension pairs. This functionality is available across multiple platforms. ```java import io.justtrack.AppEvent; import io.justtrack.Callback; // Android (Java) - Custom event with dimensions sdk.publishEvent(new AppEvent("screen_view_event") .addDimension("stage", "1") .addDimension("character", "fighter") .addDimension("level", "5") ).registerCallback(new Callback() { @Override public void resolve(Void unused) { Log.d("justtrack", "Custom event sent successfully"); } @Override public void reject(@NonNull Throwable throwable) { Log.e("justtrack", "Failed to send event: " + throwable.getMessage()); } }); ``` ```kotlin import io.justtrack.AppEvent // Android (Kotlin) - Custom event with dimensions sdk.publishEvent( AppEvent("screen_view_event") .addDimension("stage", "1") .addDimension("character", "fighter") .addDimension("level", "5") ).registerCallback(object : Callback { override fun resolve(unused: Void?) { Log.d("justtrack", "Custom event sent") } override fun reject(throwable: Throwable) { Log.e("justtrack", "Error: ${throwable.message}") } }) ``` ```swift import JustTrackSDK // iOS (Swift) - Custom event with dimensions let event = AppEvent(name: "screen_view_event") .add(dimension: "stage", value: "1") .add(dimension: "character", value: "fighter") // Optional: validate event before publishing try event.validate() sdk.publish(event: event).observe { result in switch result { case .success: print("Event published successfully") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```typescript import { AppEvent } from 'react-native-justtrack-sdk'; // React Native - Custom event with dimensions const customEvent = new AppEvent('screen_view_event'); customEvent.addDimension('stage', '1'); customEvent.addDimension('character', 'fighter'); await JustTrackSdk.publishEvent(customEvent); ``` ```csharp using JustTrack; // Unity - Custom event with dimensions JustTrackSDK.PublishEvent( new AppEvent("screen_view_event") .AddDimension("stage", "1") .AddDimension("character", "fighter") ); // Event with value and unit JustTrackSDK.PublishEvent(new AppEvent("score_event", 100, Unit.Count)); // Event with money value JustTrackSDK.PublishEvent(new AppEvent("purchase_event", new Money(9.99, "USD"))); ``` -------------------------------- ### Handle Android Deep Links with JustTrack SDK Source: https://context7.com/justtrackio/sdk-demo/llms.txt Forwards new intents to the JustTrack SDK to handle deep links and attribution on Android devices. This can be done by setting the intent on the activity or forwarding it directly to the SDK. Supports both Java and Kotlin. ```java @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); // Option 1: Set intent on activity (SDK handles automatically) setIntent(intent); // Option 2: Forward intent directly to SDK sdk.onNewIntent(intent); } ``` ```kotlin override fun onNewIntent(intent: Intent?) { super.onNewIntent(intent) // Option 1: Set intent on activity setIntent(intent) // Option 2: Forward intent directly to SDK sdk.onNewIntent(intent) } ``` -------------------------------- ### Add Maven Central Dependency (XML) Source: https://github.com/justtrackio/sdk-demo/blob/main/unity/Assets/ExternalDependencyManager/Editor/README.md Specifies a dependency located on Maven Central using the `androidPackage` element. This is a simpler way to declare dependencies available on Maven Central, relying on the Android Resolver to fetch them. ```xml ``` -------------------------------- ### Forward Ad Impressions Across Platforms Source: https://context7.com/justtrackio/sdk-demo/llms.txt Send ad impression events to JustTrack for revenue tracking and attribution. This function is available in Java, Kotlin, Swift, TypeScript, and C#. ```java // Android (Java) - Forward ad impression import io.justtrack.AdImpression; import io.justtrack.AdUnit; import io.justtrack.Money; sdk.forwardAdImpression(new AdImpression(AdUnit.Banner, "ironSource") .setNetwork("admob") .setPlacement("home_screen_banner") .setTestGroup("control") .setSegmentName("high_value_users") .setInstanceName("banner_001") .setBundleId("com.example.app") .setRevenue(new Money(0.05, "USD")) ); ``` ```kotlin // Android (Kotlin) - Forward ad impression import io.justtrack.AdImpression import io.justtrack.AdUnit import io.justtrack.Money sdk.forwardAdImpression( AdImpression(AdUnit.Banner, "ironSource") .setNetwork("admob") .setPlacement("home_screen_banner") .setTestGroup("control") .setSegmentName("high_value_users") .setInstanceName("banner_001") .setBundleId("com.example.app") .setRevenue(Money(0.05, "USD")) ) ``` ```swift // iOS (Swift) - Forward ad impression import JustTrackSDK let adImpression = AdImpression(unit: "banner", sdkName: "ironSource") .set(bundleId: "com.example.app") .set(instanceName: "banner_001") .set(network: "admob") .set(placement: "home_screen_banner") .set(revenue: Money(value: 0.05, currency: "USD")) .set(segmentName: "high_value_users") .set(testGroup: "control") switch sdk.forward(adImpression: adImpression) { case .success: print("Ad impression forwarded successfully") case let .failure(error): print("Error: (error.localizedDescription)") } ``` ```typescript // React Native - Forward ad impression import * as JustTrackSdk from 'react-native-justtrack-sdk'; const success = await JustTrackSdk.forwardAdImpression( new JustTrackSdk.AdImpression(JustTrackSdk.AdUnit.Banner, 'ironSource') .withAdNetwork('admob') .withPlacement('home_screen_banner') .withTestGroup('control') .withSegmentName('high_value_users') .withInstanceName('banner_001') .withRevenue({ value: 0.05, currency: 'USD' }) ); console.log('Ad impression forwarded:', success); ``` ```csharp // Unity - Forward ad impression using JustTrack; JustTrackSDK.ForwardAdImpression( new AdImpression(AdUnit.Banner, "ironSource") .SetBundleId("com.example.app") .SetInstanceName("banner_001") .SetNetwork("admob") .SetPlacement("home_screen_banner") .SetSegmentName("high_value_users") .SetRevenue(new Money(0.05f, "USD")) .SetTestGroup("control") ); ``` -------------------------------- ### Anonymize User Data with JustTrack SDK Source: https://context7.com/justtrackio/sdk-demo/llms.txt Requests the deletion of identifying user information from JustTrack servers. This is crucial for user privacy compliance. Supported on iOS (Swift) and Unity (C#). ```swift import JustTrackSDK sdk.anonymize().observe { result in switch result { case .success: print("User data anonymized successfully") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```csharp using JustTrack; JustTrackSDK.Anonymize( () => { Debug.Log("Anonymization successful"); }, (message) => { Debug.LogError("Anonymization failed: " + message); } ); ``` -------------------------------- ### Set Custom User ID for JustTrack SDK Source: https://context7.com/justtrackio/sdk-demo/llms.txt Associates a custom identifier with tracking data. This function is available for iOS (Swift) and Unity (C#). It allows for persistent user tracking across sessions. ```swift import JustTrackSDK sdk.set(userId: "custom_user_id").observe { result in switch result { case .success: print("User ID set successfully") case let .failure(error): print("Error: (error.localizedDescription)") } } ``` ```csharp using JustTrack; JustTrackSDK.SetUserId("custom_user_id"); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.