diff --git a/CHANGELOG.md b/CHANGELOG.md
index 571bd11..caef132 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,19 @@
+### Version 5.0.0 (30th August 2024)
+
+We're excited to release our major new SDK version (v5). Among many internal improvements, our spoofing protection solution is now included out of the box, reinforcing our commitment to accurate, actionable, and fraud-free data.
+
+To try out SDK v5 in your app, you can follow our new v4 to v5 [migration guide](https://dev.adjust.com/en/sdk/flutter/migration/v4-to-v5).
+
+If you are a current Adjust client and have questions about SDK v5, please email [sdk-v5@adjust.com](mailto:sdk-v5@adjust.com).
+
+In case you were using beta version of the SDK v5, please switch to the official v5 release.
+
+#### Native SDKs
+- [iOS@v5.0.0][ios_sdk_v5.0.0]
+- [Android@v5.0.0][android_sdk_v5.0.0]
+
+---
+
### Version 4.38.2 (10th July 2024)
#### Fixed
- Fixed occasional crashes when processing resolved deep links.
@@ -451,6 +467,7 @@
[ios_sdk_v4.38.0]: https://github.com/adjust/ios_sdk/tree/v4.38.0
[ios_sdk_v4.38.2]: https://github.com/adjust/ios_sdk/tree/v4.38.2
[ios_sdk_v4.38.4]: https://github.com/adjust/ios_sdk/tree/v4.38.4
+[ios_sdk_v5.0.0]: https://github.com/adjust/ios_sdk/tree/v5.0.0
[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0
[android_sdk_v4.18.0]: https://github.com/adjust/android_sdk/tree/v4.18.0
@@ -474,4 +491,5 @@
[android_sdk_v4.38.0]: https://github.com/adjust/android_sdk/tree/v4.38.0
[android_sdk_v4.38.1]: https://github.com/adjust/android_sdk/tree/v4.38.1
[android_sdk_v4.38.3]: https://github.com/adjust/android_sdk/tree/v4.38.3
-[android_sdk_v4.38.5]: https://github.com/adjust/android_sdk/tree/v4.38.5
\ No newline at end of file
+[android_sdk_v4.38.5]: https://github.com/adjust/android_sdk/tree/v4.38.5
+[android_sdk_v5.0.0]: https://github.com/adjust/android_sdk/tree/v5.0.0
diff --git a/LICENSE b/LICENSE
index 50c6832..53259bf 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,20 +1,22 @@
The MIT License (MIT)
-Copyright (c) 2012-2021 Adjust GmbH
+Copyright (c) 2018-Present Adjust GmbH, http://www.adjust.com
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
index c721477..8f53f17 100644
--- a/README.md
+++ b/README.md
@@ -1,1295 +1,7 @@
-## Summary
+# Adjust SDK for Flutter
-This is the Flutter SDK of Adjust™. You can read more about Adjust™ at [adjust.com].
+This is the [Adjust](https://adjust.com)™ SDK for Flutter. Documentation is available on our [developer docs](https://dev.adjust.com/en/sdk/flutter/?version=v5).
-## Table of contents
+## License
-### Quick start
-
- * [Example apps](#qs-example-apps)
- * [Getting started](#qs-getting-started)
- * [Add the SDK to your project](#qs-add-sdk)
- * [[Android] Add Google Play Services](#qs-gps)
- * [[Android] Add permissions](#qs-permissions)
- * [[Android] Proguard settings](#qs-proguard)
- * [[Android] Install referrer](#qs-install-referrer)
- * [[Android] Google Play Referrer API](#qs-gpr-api)
- * [[Android] Google Play Store intent](#qs-gps-intent)
- * [[Android] Huawei Referrer API](#qs-hr-api)
- * [[iOS] Link additional frameworks](#qs-ios-frameworks)
- * [Integrate the SDK into your app](#qs-integrate-sdk)
- * [Basic setup](#qs-basic-setup)
- * [Session tracking](#qs-session-tracking)
- * [Session tracking in Android](#qs-session-tracking-android)
- * [SDK signature](#qs-sdk-signature)
- * [Adjust logging](#qs-adjust-logging)
- * [Build your app](#qs-build-the-app)
-
-### Deep linking
-
- * [Deep linking](#dl)
- * [Standard deep linking scenario](#dl-standard)
- * [Deferred deep linking scenario](#dl-deferred)
- * [Deep linking handling in Android app](#dl-app-android)
- * [Deep linking handling in iOS app](#dl-app-ios)
- * [Reattribution via deep links](#dl-reattribution)
-
-### Event tracking
-
- * [Track event](#et-tracking)
- * [Track revenue](#et-revenue)
- * [Revenue deduplication](#et-revenue-deduplication)
-
-### Custom parameters
-
- * [Event parameters](#cp-event-parameters)
- * [Event callback parameters](#cp-event-callback-parameters)
- * [Event partner parameters](#cp-event-partner-parameters)
- * [Event callback identifier](#cp-event-callback-id)
- * [Session parameters](#cp-session-parameters)
- * [Session callback parameters](#cp-session-callback-parameters)
- * [Session partner parameters](#cp-session-partner-parameters)
- * [Delay start](#cp-delay-start)
-
-### Additional features
-
- * [AppTrackingTransparency framework](#af-att-framework)
- * [App-tracking authorisation wrapper](#af-ata-wrapper)
- * [Get current authorisation status](#af-ata-getter)
- * [Check for ATT status change](#af-att-status-change)
- * [SKAdNetwork framework](#af-skadn-framework)
- * [Update SKAdNetwork conversion value](#af-skadn-update-conversion-value)
- * [Conversion value updated callback](#af-skadn-cv-updated-callback)
- * [Subscription tracking](#af-subscription-tracking)
- * [Push token (uninstall tracking)](#af-push-token)
- * [Attribution callback](#af-attribution-callback)
- * [Session and event callbacks](#af-session-event-callbacks)
- * [User attribution](#af-user-attribution)
- * [Device IDs](#af-device-ids)
- * [iOS advertising identifier](#af-idfa)
- * [Google Play Services advertising identifier](#af-gps-adid)
- * [Amazon advertising identifier](#af-amazon-adid)
- * [Adjust device identifier](#af-adid)
- * [Set external device ID](#set-external-device-id)
- * [Pre-installed trackers](#af-pre-installed-trackers)
- * [Offline mode](#af-offline-mode)
- * [Disable tracking](#af-disable-tracking)
- * [Event buffering](#af-event-buffering)
- * [Background tracking](#af-background-tracking)
- * [GDPR right to be forgotten](#af-gdpr-forget-me)
- * [Third-party sharing](#af-third-party-sharing)
- * [Disable third-party sharing](#af-disable-third-party-sharing)
- * [Enable third-party sharing](#af-enable-third-party-sharing)
- * [Measurement consent](#af-measurement-consent)
- * [Data residency](#af-data-residency)
- * [COPPA compliance](#af-coppa-compliance)
- * [Play Store Kids Apps](#af-play-store-kids-apps)
-
-### License
-
-
-## Quick start
-
-### Example apps
-
-There are example Flutter app inside the [`example` directory][example-app]. In there you can check how the Adjust SDK can be integrated.
-
-### Getting started
-
-These are the minimal steps required to integrate the Adjust SDK into your Flutter app.
-
-### Add the SDK to your project
-
-You can add Adjust SDK to your Flutter app by adding following to your `pubspec.yaml` file:
-
-```yaml
-dependencies:
- adjust_sdk: ^4.38.2
-```
-
-Then navigate to your project in the terminal and run:
-
-```
-flutter packages get
-```
-
-**Note**: If you are using Visual Studio Code to develop your app, upon editing `pubspec.yaml`, it will automatically run this command, so you don't need to run it manually.
-
-### [Android] Add Google Play Services
-
-Since the 1st of August of 2014, apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify devices. To allow the Adjust SDK to use the Google Advertising ID, you must integrate the [Google Play Services][google-play-services]. If you haven't done this yet, please add dependency to Google Play Services library by adding following dependecy to your `dependencies` block of app's `build.gradle` file for Android platform:
-
-```gradle
-implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
-```
-
-**Note**: The Adjust SDK is not tied to any specific version of the `play-services-ads-identifier` part of the Google Play Services library. You can use the latest version of the library, or any other version you need.
-
-### [Android] Add permissions
-
-Please add the following permissions, which the Adjust SDK needs, if they are not already present in your `AndroidManifest.xml` file for Android platform:
-
-```xml
-
-
-```
-
-#### Add permission to gather Google advertising ID
-
-If you are targeting Android 12 and above (API level 31), you need to add the `com.google.android.gms.AD_ID` permission to read the device's advertising ID. Add the following line to your `AndroidManifest.xml` to enable the permission.
-
-```xml
-
-```
-
-For more information, see [Google's `AdvertisingIdClient.Info` documentation](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid).
-
-### [Android] Proguard settings
-
-If you are using Proguard, add these lines to your Proguard file:
-
-```
--keep class com.adjust.sdk.** { *; }
--keep class com.google.android.gms.common.ConnectionResult {
- int SUCCESS;
-}
--keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
- com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
-}
--keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
- java.lang.String getId();
- boolean isLimitAdTrackingEnabled();
-}
--keep public class com.android.installreferrer.** { *; }
-```
-
-If you are **not publishing your app in the Google Play Store**, you can leave just `com.adjust.sdk` package rules:
-
-```
--keep public class com.adjust.sdk.** { *; }
-```
-
-### [Android] Install referrer
-
-In order to correctly attribute an install of your app to its source, Adjust needs information about the **install referrer**. This can be obtained by using the **Google Play Referrer API** or by catching the **Google Play Store intent** with a broadcast receiver.
-
-**Important**: The Google Play Referrer API is newly introduced by Google with the express purpose of providing a more reliable and secure way of obtaining install referrer information and to aid attribution providers in the fight against click injection. It is **strongly advised** that you support this in your application. The Google Play Store intent is a less secure way of obtaining install referrer information. It will continue to exist in parallel with the new Google Play Referrer API temporarily, but it is set to be deprecated in future.
-
-### [Android] Google Play Referrer API
-
-In order to support this in your app, please make sure to add following dependency to your app's `build.gradle` file for Android platform:
-
-```
-implementation 'com.android.installreferrer:installreferrer:2.2'
-```
-
-Also, make sure that you have paid attention to the [Proguard settings](#qs-proguard) chapter and that you have added all the rules mentioned in it, especially the one needed for this feature:
-
-```
--keep public class com.android.installreferrer.** { *; }
-```
-
-### [Android] Google Play Store intent
-
-The Google Play Store `INSTALL_REFERRER` intent should be captured with a broadcast receiver. If you are **not using your own broadcast receiver** to receive the `INSTALL_REFERRER` intent, add the following `receiver` tag inside the `application` tag in your `AndroidManifest.xml` file for Android platform.
-
-```xml
-
-
-
-
-
-```
-
-We use this broadcast receiver to retrieve the install referrer and pass it to our backend.
-
-If you are already using a different broadcast receiver for the `INSTALL_REFERRER` intent, follow [these instructions][multiple-receivers] to add the Adjust broadcast receiver.
-
-#### [Android] Huawei Referrer API
-
-As of v4.22.0, the Adjust SDK supports install tracking on Huawei devices with Huawei App Gallery version 10.4 and higher. No additional integration steps are needed to start using the Huawei Referrer API.
-
-#### [iOS] Link additional frameworks
-
-Make sure that following iOS frameworks are linked with your iOS app:
-
-* `AdServices.framework` - in case you are running Apple Search Ads campaigns
-* `AdSupport.framework` - for reading iOS Advertising Id (IDFA)
-* `StoreKit.framework` - for communication with SKAdNetwork framework
-* `AppTrackingTransparency.framework` - to ask for user's consent to be tracked and obtain status of that consent
-
-All of these frameworks are enabling certain SDK features, but they are not mandatory for SDK to work normally. With this in mind, you can set **Status** of each one of these frameworks to **Optional** in your **Project Settings → Build Phases → Link Binary With Libraries** section.
-
-### Integrate the SDK into your app
-
-To start with, we'll set up basic session tracking.
-
-### Basic setup
-
-Make sure to initialise Adjust SDK as soon as possible in your Flutter app (upon loading first widget in your app). You can initialise Adjust SDK like described below:
-
-```dart
-AdjustConfig config = new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
-Adjust.start(config);
-```
-
-Replace `{YourAppToken}` with your app token. You can find this in your [dashboard].
-
-Depending on whether you are building your app for testing or for production, you must set `environment` with one of these values:
-
-```dart
-AdjustEnvironment.sandbox;
-AdjustEnvironment.production;
-```
-
-**Important:** This value should be set to `AdjustEnvironment.sandbox` if and only if you or someone else is testing your app. Make sure to set the environment to `AdjustEnvironment.production` before you publish the app. Set it back to `AdjustEnvironment.sandbox` when you start developing and testing it again.
-
-We use this environment to distinguish between real traffic and test traffic from test devices. It is imperative that you keep this value meaningful at all times!
-
-### Session tracking
-
-**Note**: This step is **really important** and please **make sure that you implement it properly in your app**. By implementing it, you will enable proper session tracking by the Adjust SDK in your app.
-
-Session tracking for iOS platform is supported out of the box, but in order to perform it properly on Android platform, it requires a bit of additional work described in chapter below.
-
-### Session tracking in Android
-
-On Android platform, it is important for you to hook up into app activity lifecycle methods and make a call to `Adjust.onResume()` when ever app enters foreground and a call to `Adjust.onPause()` when ever app leaves foreground. You can do this globally or per widget (call these method upon each transition from one widget to another). For example:
-
-```dart
-class AdjustExampleApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return new MaterialApp(
- title: 'Adjust Flutter Example App',
- home: new MainScreen(),
- );
- }
-}
-
-class MainScreen extends StatefulWidget {
- @override
- State createState() => new MainScreenState();
-}
-
-class MainScreenState extends State with WidgetsBindingObserver {
- @override
- initState() {
- super.initState();
- WidgetsBinding.instance.addObserver(this);
- initPlatformState(); // <-- Initialise SDK in here.
- }
-
- @override
- void dispose() {
- WidgetsBinding.instance.removeObserver(this);
- super.dispose();
- }
-
- @override
- void didChangeAppLifecycleState(AppLifecycleState state) {
- switch (state) {
- case AppLifecycleState.inactive:
- break;
- case AppLifecycleState.resumed:
- Adjust.onResume();
- break;
- case AppLifecycleState.paused:
- Adjust.onPause();
- break;
- case AppLifecycleState.detached:
- break;
- }
- }
-}
-```
-
-### SDK signature
-
-When you set up the SDK Signature, each SDK communication package is "signed". This lets Adjust’s servers easily detect and reject any install activity that is not legitimate.
-
-There are just a few steps involved in setting up the SDK Signature. Please contact your Technical Account Manager or support@adjust.com to get started.
-
-### Adjust logging
-
-You can increase or decrease the amount of logs that you see during testing by setting `logLevel` member on your config instance with one of the following parameters:
-
-```java
-adjustConfig.logLevel = AdjustLogLevel.verbose; // enable all logs
-adjustConfig.logLevel = AdjustLogLevel.debug; // disable verbose logs
-adjustConfig.logLevel = AdjustLogLevel.info; // disable debug logs (default)
-adjustConfig.logLevel = AdjustLogLevel.warn; // disable info logs
-adjustConfig.logLevel = AdjustLogLevel.error; // disable warning logs
-adjustConfig.logLevel = AdjustLogLevel.suppress; // disable all logs
-```
-
-### Build your app
-
-Build and run your Flutter app. In your Android/iOS log you can check for logs coming from Adjust SDK and in there you should see message: `Install tracked`.
-
-## Deep linking
-
-### Deep linking
-
-If you are using an Adjust tracker URL with the option to deep link into your app, there is the possibility to get information about the deep link URL and its content. Hitting the URL can happen when the user has your app already installed (standard deep linking scenario) or if they don't have the app on their device (deferred deep linking scenario). In the standard deep linking scenario, the Android platform natively offers the possibility for you to get the information about the deep link content. The deferred deep linking scenario is something which the Android platform doesn't support out of the box, and, in this case, the Adjust SDK will offer you the mechanism you need to get the information about the deep link content.
-
-You need to set up deep linking handling in your app **on native level** - in your generated Xcode project (for iOS) and Android Studio (for Android).
-
-### Standard deep linking scenario
-
-Unfortunately, in this scenario the information about the deep link can not be delivered to you in your Dart code. Once you enable your app to handle deep linking, you will get information about the deep link on native level. For more information check our chapters below on how to enable deep linking for Android and iOS apps.
-
-### Deferred deep linking scenario
-
-In order to get information about the URL content in a deferred deep linking scenario, you should set a callback method on the config object which will receive one `string` parameter where the content of the URL will be delivered. You should set this method on the config object by assigning the `deferredDeeplinkCallback` member:
-
-```dart
-AdjustConfig adjustConfig = new AdjustConfig(yourAppToken, environment);
-adjustConfig.deferredDeeplinkCallback = (String uri) {
- print('[Adjust]: Received deferred deeplink: ' + uri);
-};
-Adjust.start(adjustConfig);
-```
-
-In deferred deep linking scenario, there is one additional setting which can be set on the config object. Once the Adjust SDK gets the deferred deep link information, we offer you the possibility to choose whether our SDK should open this URL or not. You can choose to set this option by assigning the `launchDeferredDeeplink` member of the config instance:
-
-```dart
-AdjustConfig adjustConfig = new AdjustConfig(yourAppToken, environment);
-adjustConfig.launchDeferredDeeplink = true;
-adjustConfig.deferredDeeplinkCallback = (String uri) {
- print('[Adjust]: Received deferred deeplink: ' + uri);
-};
-Adjust.start(adjustConfig);
-```
-
-If nothing is set, **the Adjust SDK will always try to launch the URL by default**.
-
-To enable your apps to support deep linking, you should set up schemes for each supported platform.
-
-### Deep linking handling in Android app
-
-**This should be done in native Android Studio / Eclipse project.**
-
-To set up your Android app to handle deep linking on native level, please follow our [guide][android-deeplinking] in the official Android SDK README.
-
-### Deep linking handling in iOS app
-
-**This should be done in native Xcode project.**
-
-To set up your iOS app (`Runner` project) to handle deep linking on native level, please follow our [guide][ios-deeplinking] in the official iOS SDK README.
-
-### Reattribution via deep links
-
-Adjust enables you to run re-engagement campaigns through deep links. For more information on how to do that, please check our [official docs][reattribution-with-deeplinks].
-
-If you are using this feature, in order for your user to be properly reattributed, you need to make one additional call to the Adjust SDK in your app.
-
-Once you have received deep link content information in your app, add a call to the `appWillOpenUrl` method. By making this call, the Adjust SDK will try to find if there is any new attribution information inside of the deep link. If there is any, it will be sent to the Adjust backend. If your user should be reattributed due to a click on the adjust tracker URL with deep link content, you will see the [attribution callback](#af-attribution-callback) in your app being triggered with new attribution info for this user.
-
-Once everything set up, inside of your native Android activity make a call to `appWillOpenUrl` method in following way:
-
-```java
-import com.adjust.sdk.flutter.AdjustSdk;
-import io.flutter.embedding.android.FlutterActivity; // Used for post flutter 1.12 Android projects
-//import io.flutter.app.FlutterActivity; // Used for pre flutter 1.12 Android projects
-
-public class MainActivity extends FlutterActivity {
- // Either call make the call in onCreate.
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // GeneratedPluginRegistrant.registerWith(this); Used only for pre flutter 1.12 Android projects
-
- Intent intent = getIntent();
- Uri data = intent.getData();
- AdjustSdk.appWillOpenUrl(data, this);
- }
-
- // Or make the cakll in onNewIntent.
- @Override
- protected void onNewIntent(Intent intent) {
- super.onNewIntent(intent);
- Uri data = intent.getData();
- AdjustSdk.appWillOpenUrl(data, this);
- }
-}
-```
-
-Depending on the `android:launchMode` setting of your Activity in the `AndroidManifest.xml` file, information about the `deep_link` parameter content will be delivered to the appropriate place in the Activity file. For more information about the possible values of the `android:launchMode` property, check [the official Android documentation][android-launch-modes].
-
-There are two places within your desired Activity where information about the deep link content will be delivered via the `Intent` object - either in the Activity's `onCreate` or `onNewIntent` methods. Once your app has launched and one of these methods has been triggered, you will be able to get the actual deep link passed in the `deep_link` parameter in the click URL.
-
-Once everything set up, inside of your native iOS app delegate make a call to `appWillOpenUrl` method in following way:
-
-```objc
-#import "Adjust.h"
-
-@implementation AppDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [GeneratedPluginRegistrant registerWithRegistry:self];
- // Override point for customization after application launch.
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
-}
-
-- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
- [Adjust appWillOpenUrl:url];
- return YES;
-}
-
-- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> *restorableObjects))restorationHandler {
- if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) {
- [Adjust appWillOpenUrl:[userActivity webpageURL]];
- }
- return YES;
-}
-
-@end
-```
-
-## Event tracking
-
-### Track event
-
-You can use adjust to track any event in your app. Suppose you want to track every tap on a button. You would have to create a new event token in your [dashboard]. Let's say that event token is `abc123`. In your button's click handler method you could then add the following lines to track the click:
-
-```dart
-AdjustEvent adjustEvent = new AdjustEvent('abc123');
-Adjust.trackEvent(adjustEvent);
-```
-
-### Track revenue
-
-If your users can generate revenue by tapping on advertisements or making in-app purchases you can track those revenues with events. Lets say a tap is worth one Euro cent. You could then track the revenue event like this:
-
-```dart
-AdjustEvent adjustEvent = new AdjustEvent('abc123');
-adjustEvent.setRevenue(6, 'EUR');
-Adjust.trackEvent(adjustEvent);
-```
-
-This can be combined with callback parameters of course.
-
-When you set a currency token, Adjust will automatically convert the incoming revenues into a reporting revenue of your choice. Read more about [currency conversion here][currency-conversion].
-
-You can read more about revenue and event tracking in the [event tracking guide][event-tracking].
-
-### Revenue deduplication
-
-You can also add an optional transaction ID to avoid tracking duplicated revenues. The last ten transaction IDs are remembered, and revenue events with duplicated transaction IDs are skipped. This is especially useful for In-App Purchase tracking. You can see an example below.
-
-If you want to track in-app purchases, please make sure to call the `trackEvent` only if the transaction is finished and item is purchased. That way you can avoid tracking revenue that is not actually being generated.
-
-```dart
-AdjustEvent adjustEvent = new AdjustEvent('abc123');
-adjustEvent.transactionId = '{TransactionId}';
-Adjust.trackEvent(adjustEvent);
-```
-
-## Custom parameters
-
-### Custom parameters
-
-In addition to the data points that Adjust SDK collects by default, you can use the Adjust SDK to track and add to the event/session as many custom values as you need (user IDs, product IDs, etc.). Custom parameters are only available as raw data (i.e., they won't appear in the Adjust dashboard).
-
-You should use **callback parameters** for the values that you collect for your own internal use, and **partner parameters** for those that you wish to share with external partners. If a value (e.g. product ID) is tracked both for internal use and to forward it to external partners, the best practice would be to track it both as callback and partner parameters.
-
-
-### Event parameters
-
-### Event callback parameters
-
-You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the event is tracked. You can add callback parameters to that event by calling `addCallbackParameter` to the event instance before tracking it. We will then append these parameters to your callback URL.
-
-For example, suppose you have registered the URL `https://www.adjust.com/callback` then track an event like this:
-
-```dart
-AdjustEvent adjustEvent = new AdjustEvent('abc123');
-adjustEvent.addCallbackParameter('key', 'value');
-adjustEvent.addCallbackParameter('foo', 'bar');
-Adjust.trackEvent(adjustEvent);
-```
-
-In that case we would track the event and send a request to:
-
-```
-https://www.adjust.com/callback?key=value&foo=bar
-```
-
-It should be mentioned that we support a variety of placeholders like `{gps_adid}` that can be used as parameter values. In the resulting callback this placeholder would be replaced with the Google Play Services ID of the current device. Also note that we don't store any of your custom parameters, but only append them to your callbacks. If you haven't registered a callback for an event, these parameters won't even be read.
-
-You can read more about using URL callbacks, including a full list of available values, in our [callbacks guide][callbacks-guide].
-
-### Event partner parameters
-
-You can also add parameters to be transmitted to network partners, which have been activated in your Adjust dashboard.
-
-This works similarly to the callback parameters mentioned above, but can be added by calling the `addPartnerParameter` method on your event instance.
-
-```dart
-AdjustEvent adjustEvent = new AdjustEvent('abc123');
-adjustEvent.addPartnerParameter('key', 'value');
-adjustEvent.addPartnerParameter('foo', 'bar');
-Adjust.trackEvent(adjustEvent);
-```
-
-You can read more about special partners and these integrations in our [guide to special partners][special-partners].
-
-### Event callback identifier
-
-You can also add custom string identifier to each event you want to track. This identifier will later be reported in event success and/or event failure callbacks to enable you to keep track on which event was successfully tracked or not. You can set this identifier by assigning the `callbackId` member of your event instance:
-
-```dart
-AdjustEvent adjustEvent = new AdjustEvent('abc123');
-adjustEvent.callbackId = '{CallbackId}';
-Adjust.trackEvent(adjustEvent);
-```
-
-### Session parameters
-
-Some parameters are saved to be sent in every **event** and **session** of the Adjust SDK. Once you have added any of these parameters, you don't need to add them every time, since they will be saved locally. If you add the same parameter twice, there will be no effect.
-
-These session parameters can be called before the Adjust SDK is launched to make sure they are sent even on install. If you need to send them with an install, but can only obtain the needed values after launch, it's possible to [delay](#delay-start) the first launch of the Adjust SDK to allow this behaviour.
-
-### Session callback parameters
-
-The same callback parameters that are registered for [events](#event-callback-parameters) can be also saved to be sent in every event or session of the Adjust SDK.
-
-The session callback parameters have a similar interface to the event callback parameters. Instead of adding the key and it's value to an event, it's added through a call to `Adjust.addSessionCallbackParameter(String key, String value)`:
-
-```dart
-Adjust.addSessionCallbackParameter('foo', 'bar');
-```
-
-The session callback parameters will be merged with the callback parameters added to an event. The callback parameters added to an event have precedence over the session callback parameters. Meaning that, when adding a callback parameter to an event with the same key to one added from the session, the value that prevails is the callback parameter added to the event.
-
-It's possible to remove a specific session callback parameter by passing the desiring key to the method `Adjust.removeSessionCallbackParameter(String key)`.
-
-```dart
-Adjust.removeSessionCallbackParameter('foo');
-```
-
-If you wish to remove all keys and their corresponding values from the session callback parameters, you can reset it with the method `Adjust.resetSessionCallbackParameters()`.
-
-```dart
-Adjust.resetSessionCallbackParameters();
-```
-
-### Session partner parameters
-
-In the same way that there are [session callback parameters](#session-callback-parameters) sent in every event or session of the Adjust SDK, there is also session partner parameters.
-
-These will be transmitted to network partners, for the integrations that have been activated in your Adjust [dashboard].
-
-The session partner parameters have a similar interface to the event partner parameters. Instead of adding the key and it's value to an event, it's added through a call to `Adjust.addSessionPartnerParameter(String key, String value)`:
-
-```dart
-Adjust.addSessionPartnerParameter('foo', 'bar');
-```
-
-The session partner parameters will be merged with the partner parameters added to an event. The partner parameters added to an event have precedence over the session partner parameters. Meaning that, when adding a partner parameter to an event with the same key to one added from the session, the value that prevails is the partner parameter added to the event.
-
-It's possible to remove a specific session partner parameter by passing the desiring key to the method `Adjust.removeSessionPartnerParameter(String key)`.
-
-```dart
-Adjust.removeSessionPartnerParameter('foo');
-```
-
-If you wish to remove all keys and their corresponding values from the session partner parameters, you can reset it with the method `Adjust.resetSessionPartnerParameters()`.
-
-```dart
-Adjust.resetSessionPartnerParameters();
-```
-
-### Delay start
-
-Delaying the start of the Adjust SDK allows your app some time to obtain session parameters, such as unique identifiers, to be sent on install.
-
-Set the initial delay time in seconds with the `delayStart` member of the config instance:
-
-```dart
-adjustConfig.delayStart = 5.5;
-```
-
-In this case, this will make the Adjust SDK not send the initial install session and any event created for 5.5 seconds. After this time is expired or if you call `Adjust.sendFirstPackages()` in the meanwhile, every session parameter will be added to the delayed install session and events and the Adjust SDK will resume as usual.
-
-**The maximum delay start time of the adjust SDK is 10 seconds**.
-
-
-## Additional features
-
-### Additional features
-
-Once you have integrated the Adjust SDK into your project, you can take advantage of the following features.
-
-### AppTrackingTransparency framework
-
-**Note**: This feature exists only in iOS platform.
-
-For each package sent, the Adjust backend receives one of the following four (4) states of consent for access to app-related data that can be used for tracking the user or the device:
-
-- Authorized
-- Denied
-- Not Determined
-- Restricted
-
-After a device receives an authorization request to approve access to app-related data, which is used for user device tracking, the returned status will either be Authorized or Denied.
-
-Before a device receives an authorization request for access to app-related data, which is used for tracking the user or device, the returned status will be Not Determined.
-
-If authorization to use app tracking data is restricted, the returned status will be Restricted.
-
-The SDK has a built-in mechanism to receive an updated status after a user responds to the pop-up dialog, in case you don't want to customize your displayed dialog pop-up. To conveniently and efficiently communicate the new state of consent to the backend, Adjust SDK offers a wrapper around the app tracking authorization method described in the following chapter, App-tracking authorization wrapper.
-
-### App-tracking authorisation wrapper
-
-**Note**: This feature exists only in iOS platform.
-
-Adjust SDK offers the possibility to use it for requesting user authorization in accessing their app-related data. Adjust SDK has a wrapper built on top of the [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) method, where you can as well define the callback method to get information about a user's choice. Also, with the use of this wrapper, as soon as a user responds to the pop-up dialog, it's then communicated back using your callback method. The SDK will also inform the backend of the user's choice. Integer value will be delivered via your callback method with the following meaning:
-
-- 0: `ATTrackingManagerAuthorizationStatusNotDetermined`
-- 1: `ATTrackingManagerAuthorizationStatusRestricted`
-- 2: `ATTrackingManagerAuthorizationStatusDenied`
-- 3: `ATTrackingManagerAuthorizationStatusAuthorized`
-
-To use this wrapper, you can call it as such:
-
-```dart
-if (Platform.isIOS) {
- Adjust.requestTrackingAuthorizationWithCompletionHandler().then((status) {
- switch (status) {
- case 0:
- // ATTrackingManagerAuthorizationStatusNotDetermined case
- break;
- case 1:
- // ATTrackingManagerAuthorizationStatusRestricted case
- break;
- case 2:
- // ATTrackingManagerAuthorizationStatusDenied case
- break;
- case 3:
- // ATTrackingManagerAuthorizationStatusAuthorized case
- break;
- }
- });
-}
-```
-
-### Get current authorisation status
-
-**Note**: This feature exists only in iOS platform.
-
-To get the current app tracking authorization status you can call `getAppTrackingAuthorizationStatus` method of `Adjust` class that will return one of the following possibilities:
-
-* `0`: The user hasn't been asked yet
-* `1`: The user device is restricted
-* `2`: The user denied access to IDFA
-* `3`: The user authorized access to IDFA
-* `-1`: The status is not available
-
-### Check for ATT status change
-
-**Note**: This feature exists only in iOS platform.
-
-In cases where you are not using [Adjust app-tracking authorization wrapper](#af-ata-wrapper), Adjust SDK will not be able to know immediately upon answering the dialog what is the new value of app-tracking status. In situations like this, if you would want Adjust SDK to read the new app-tracking status value and communicate it to our backend, make sure to make a call to this method:
-
-```dart
-Adjust.checkForNewAttStatus();
-```
-
-### SKAdNetwork framework
-
-**Note**: This feature exists only in iOS platform.
-
-If you have implemented the Adjust SDK v4.23.0 or above and your app is running on iOS 14 and above, the communication with SKAdNetwork will be set on by default, although you can choose to turn it off. When set on, Adjust automatically registers for SKAdNetwork attribution when the SDK is initialized. If events are set up in the Adjust dashboard to receive conversion values, the Adjust backend sends the conversion value data to the SDK. The SDK then sets the conversion value. After Adjust receives the SKAdNetwork callback data, it is then displayed in the dashboard.
-
-In case you don't want the Adjust SDK to automatically communicate with SKAdNetwork, you can disable that by calling the following method on configuration object:
-
-```dart
-adjustConfig.deactivateSKAdNetworkHandling();
-```
-
-### Update SKAdNetwork conversion value
-
-**Note**: This feature exists only in iOS platform.
-
-You can use Adjust SDK wrapper method `updateConversionValue` to update SKAdNetwork conversion value for your user:
-
-```dart
-Adjust.updateConversionValue(6);
-```
-
-### Conversion value updated callback
-
-You can register callback to get notified each time when Adjust SDK updates conversion value for the user.
-
-```dart
-AdjustConfig adjustConfig = new AdjustConfig(yourAppToken, environment);
-config.conversionValueUpdatedCallback = (num? conversionValue) {
- print('[Adjust]: Received conversion value update: ' + conversionValue!.toString());
-};
-Adjust.start(adjustConfig);
-```
-
-### Subscription tracking
-
-**Note**: This feature is only available in the SDK v4.22.0 and above.
-
-You can track App Store and Play Store subscriptions and verify their validity with the Adjust SDK. After a subscription has been successfully purchased, make the following call to the Adjust SDK:
-
-**For App Store subscription:**
-
-```dart
-AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
- price,
- currency,
- transactionId,
- receipt);
-subscription.setTransactionDate(transactionDate);
-subscription.setSalesRegion(salesRegion);
-
-Adjust.trackAppStoreSubscription(subscription);
-```
-
-**For Play Store subscription:**
-
-```dart
-AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription(
- price,
- currency,
- sku,
- orderId,
- signature,
- purchaseToken);
-subscription.setPurchaseTime(purchaseTime);
-
-Adjust.trackPlayStoreSubscription(subscription);
-```
-
-Subscription tracking parameters for App Store subscription:
-
-- [price](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc)
-- currency (you need to pass [currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object)
-- [transactionId](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc)
-- [receipt](https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl)
-- [transactionDate](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate?language=objc)
-- salesRegion (you need to pass [countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object)
-
-Subscription tracking parameters for Play Store subscription:
-
-- [price](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros)
-- [currency](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode)
-- [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku)
-- [orderId](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid)
-- [signature](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsignature)
-- [purchaseToken](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetoken)
-- [purchaseTime](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetime)
-
-**Note:** Subscription tracking API offered by Adjust SDK expects all parameters to be passed as `string` values. Parameters described above are the ones which API exects you to pass to subscription object prior to tracking subscription. There are various libraries which are handling in app purchases in Flutter and each one of them should return information described above in some form upon successfully completed subscription purchase. You should locate where these parameters are placed in response you are getting from library you are using for in app purchases, extract those values and pass them to Adjust API as string values.
-
-Just like with event tracking, you can attach callback and partner parameters to the subscription object as well:
-
-**For App Store subscription:**
-
-```dart
-AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
- price,
- currency,
- transactionId,
- receipt);
-subscription.setTransactionDate(transactionDate);
-subscription.setSalesRegion(salesRegion);
-
-// add callback parameters
-subscription.addCallbackParameter('key', 'value');
-subscription.addCallbackParameter('foo', 'bar');
-
-// add partner parameters
-subscription.addPartnerParameter('key', 'value');
-subscription.addPartnerParameter('foo', 'bar');
-
-Adjust.trackAppStoreSubscription(subscription);
-```
-
-**For Play Store subscription:**
-
-```dart
-AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription(
- price,
- currency,
- sku,
- orderId,
- signature,
- purchaseToken);
-subscription.setPurchaseTime(purchaseTime);
-
-// add callback parameters
-subscription.addCallbackParameter('key', 'value');
-subscription.addCallbackParameter('foo', 'bar');
-
-// add partner parameters
-subscription.addPartnerParameter('key', 'value');
-subscription.addPartnerParameter('foo', 'bar');
-
-Adjust.trackPlayStoreSubscription(subscription);
-```
-
-### Push token (uninstall tracking)
-
-Push tokens are used for Audience Builder and client callbacks, and they are required for uninstall and reinstall tracking.
-
-To send us the push notification token, add the following call to Adjust once you have obtained your token or when ever it's value is changed:
-
-```dart
-Adjust.setPushToken('{PushNotificationsToken}');
-```
-
-### Attribution callback
-
-You can register a callback to be notified of tracker attribution changes. Due to the different sources considered for attribution, this information can not be provided synchronously.
-
-Please make sure to consider our [applicable attribution data policies][attribution-data].
-
-With the config instance, before starting the SDK, add the attribution callback:
-
-```dart
-AdjustConfig adjustConfig = new AdjustConfig(yourAppToken, environment);
-config.attributionCallback = (AdjustAttribution attributionChangedData) {
- print('[Adjust]: Attribution changed!');
-
- if (attributionChangedData.trackerToken != null) {
- print('[Adjust]: Tracker token: ' + attributionChangedData.trackerToken);
- }
- if (attributionChangedData.trackerName != null) {
- print('[Adjust]: Tracker name: ' + attributionChangedData.trackerName);
- }
- if (attributionChangedData.campaign != null) {
- print('[Adjust]: Campaign: ' + attributionChangedData.campaign);
- }
- if (attributionChangedData.network != null) {
- print('[Adjust]: Network: ' + attributionChangedData.network);
- }
- if (attributionChangedData.creative != null) {
- print('[Adjust]: Creative: ' + attributionChangedData.creative);
- }
- if (attributionChangedData.adgroup != null) {
- print('[Adjust]: Adgroup: ' + attributionChangedData.adgroup);
- }
- if (attributionChangedData.clickLabel != null) {
- print('[Adjust]: Click label: ' + attributionChangedData.clickLabel);
- }
- if (attributionChangedData.adid != null) {
- print('[Adjust]: Adid: ' + attributionChangedData.adid);
- }
-};
-Adjust.start(adjustConfig);
-```
-
-The callback function will be called after the SDK receives the final attribution data. Within the callback function you have access to the `attribution` parameter. Here is a quick summary of its properties:
-
-- `trackerToken` the tracker token string of the current attribution.
-- `trackerName` the tracker name string of the current attribution.
-- `network` the network grouping level string of the current attribution.
-- `campaign` the campaign grouping level string of the current attribution.
-- `adgroup` the ad group grouping level string of the current attribution.
-- `creative` the creative grouping level string of the current attribution.
-- `clickLabel` the click label string of the current attribution.
-- `adid` the Adjust device identifier string.
-- `costType` the cost type string
-- `costAmount` the cost amount
-- `costCurrency` the cost currency string
-- `fbInstallReferrer` the Facebook install referrer information
-
-**Note**: The cost data - `costType`, `costAmount` & `costCurrency` are only available when configured in `AdjustConfig` by setting `needsCost` member to `true`. If not configured or configured, but not being part of the attribution, these fields will have value `null`. This feature is available in SDK v4.26.0 and later.
-
-### Session and event callbacks
-
-You can register a callback to be notified when events or sessions are tracked. There are four callbacks: one for tracking successful events, one for tracking failed events, one for tracking successful sessions and one for tracking failed sessions. You can add any number of callbacks after creating the config object:
-
-```dart
-AdjustConfig adjustConfig = new AdjustConfig(yourAppToken, environment);
-
-// Set session success tracking delegate.
-config.sessionSuccessCallback = (AdjustSessionSuccess sessionSuccessData) {
- print('[Adjust]: Session tracking success!');
-
- if (sessionSuccessData.message != null) {
- print('[Adjust]: Message: ' + sessionSuccessData.message);
- }
- if (sessionSuccessData.timestamp != null) {
- print('[Adjust]: Timestamp: ' + sessionSuccessData.timestamp);
- }
- if (sessionSuccessData.adid != null) {
- print('[Adjust]: Adid: ' + sessionSuccessData.adid);
- }
- if (sessionSuccessData.jsonResponse != null) {
- print('[Adjust]: JSON response: ' + sessionSuccessData.jsonResponse);
- }
-};
-
-// Set session failure tracking delegate.
-config.sessionFailureCallback = (AdjustSessionFailure sessionFailureData) {
- print('[Adjust]: Session tracking failure!');
-
- if (sessionFailureData.message != null) {
- print('[Adjust]: Message: ' + sessionFailureData.message);
- }
- if (sessionFailureData.timestamp != null) {
- print('[Adjust]: Timestamp: ' + sessionFailureData.timestamp);
- }
- if (sessionFailureData.adid != null) {
- print('[Adjust]: Adid: ' + sessionFailureData.adid);
- }
- if (sessionFailureData.willRetry != null) {
- print('[Adjust]: Will retry: ' + sessionFailureData.willRetry.toString());
- }
- if (sessionFailureData.jsonResponse != null) {
- print('[Adjust]: JSON response: ' + sessionFailureData.jsonResponse);
- }
-};
-
-// Set event success tracking delegate.
-config.eventSuccessCallback = (AdjustEventSuccess eventSuccessData) {
- print('[Adjust]: Event tracking success!');
-
- if (eventSuccessData.eventToken != null) {
- print('[Adjust]: Event token: ' + eventSuccessData.eventToken);
- }
- if (eventSuccessData.message != null) {
- print('[Adjust]: Message: ' + eventSuccessData.message);
- }
- if (eventSuccessData.timestamp != null) {
- print('[Adjust]: Timestamp: ' + eventSuccessData.timestamp);
- }
- if (eventSuccessData.adid != null) {
- print('[Adjust]: Adid: ' + eventSuccessData.adid);
- }
- if (eventSuccessData.callbackId != null) {
- print('[Adjust]: Callback ID: ' + eventSuccessData.callbackId);
- }
- if (eventSuccessData.jsonResponse != null) {
- print('[Adjust]: JSON response: ' + eventSuccessData.jsonResponse);
- }
-};
-
-// Set event failure tracking delegate.
-config.eventFailureCallback = (AdjustEventFailure eventFailureData) {
- print('[Adjust]: Event tracking failure!');
-
- if (eventFailureData.eventToken != null) {
- print('[Adjust]: Event token: ' + eventFailureData.eventToken);
- }
- if (eventFailureData.message != null) {
- print('[Adjust]: Message: ' + eventFailureData.message);
- }
- if (eventFailureData.timestamp != null) {
- print('[Adjust]: Timestamp: ' + eventFailureData.timestamp);
- }
- if (eventFailureData.adid != null) {
- print('[Adjust]: Adid: ' + eventFailureData.adid);
- }
- if (eventFailureData.callbackId != null) {
- print('[Adjust]: Callback ID: ' + eventFailureData.callbackId);
- }
- if (eventFailureData.willRetry != null) {
- print('[Adjust]: Will retry: ' + eventFailureData.willRetry.toString());
- }
- if (eventFailureData.jsonResponse != null) {
- print('[Adjust]: JSON response: ' + eventFailureData.jsonResponse);
- }
-};
-
-Adjust.start(adjustConfig);
-```
-
-The callback function will be called after the SDK tries to send a package to the server. Within the callback function you have access to a response data object specifically for the callback. Here is a quick summary of the success session response data object fields:
-
-- `message` message string from the server or the error logged by the SDK.
-- `timestamp` timestamp string from the server.
-- `adid` a unique string device identifier provided by Adjust.
-- `jsonResponse` the JSON object with the reponse from the server.
-
-Both event response data objects contain:
-
-- `eventToken` the event token string, if the package tracked was an event.
-- `callbackId` the custom defined [callback ID](#cp-event-callback-id) string set on event object.
-
-And both event and session failed objects also contain:
-
-- `willRetry` boolean which indicates whether there will be an attempt to resend the package at a later time.
-
-### User attribution
-
-Like described in [attribution callback section](#af-attribution-callback), this callback get triggered providing you info about new attribution when ever it changes. In case you want to access info about your user's current attribution whenever you need it, you can make a call to following method of the `Adjust` instance:
-
-```dart
-AdjustAttribution attribution = Adjust.getAttribution();
-```
-
-**Note**: Information about current attribution is available after app installation has been tracked by the Adjust backend and attribution callback has been initially triggered. From that moment on, Adjust SDK has information about your user's attribution and you can access it with this method. So, **it is not possible** to access user's attribution value before the SDK has been initialized and attribution callback has been initially triggered.
-
-### Device IDs
-
-The Adjust SDK offers you possibility to obtain some of the device identifiers.
-
-### iOS Advertising Identifier
-
-To obtain the IDFA, call the `getIdfa` method of the `Adjust` instance:
-
-```dart
-Adjust.getIdfa().then((idfa) {
- // Use idfa string value.
-});
-```
-
-### Google Play Services advertising identifier
-
-The Google Play Services Advertising Identifier (Google advertising ID) is a unique identifier for a device. Users can opt out of sharing their Google advertising ID by toggling the "Opt out of Ads Personalization" setting on their device. When a user has enabled this setting, the Adjust SDK returns a string of zeros when trying to read the Google advertising ID.
-
-> **Important**: If you are targeting Android 12 and above (API level 31), you need to add the [`com.google.android.gms.AD_ID` permission](#gps-adid-permission) to your app. If you do not add this permission, you will not be able to read the Google advertising ID even if the user has not opted out of sharing their ID.
-
-Certain services (such as Google Analytics) require you to coordinate Device and Client IDs in order to prevent duplicate reporting.
-
-To obtain the device Google Advertising identifier, it's necessary to pass a callback function to `Adjust.getGoogleAdId` that will receive the Google Advertising ID in it's argument, like this:
-
-```dart
-Adjust.getGoogleAdId().then((googleAdId) {
- // Use googleAdId string value.
-});
-```
-
-### Amazon advertising identifier
-
-To obtain the Amazon advertising identifier, call the `getAmazonAdId` method of the `Adjust` instance:
-
-```dart
-Adjust.getAmazonAdId().then((amazonAdId) {
- // Use amazonAdId string value.
-});
-```
-
-### Adjust device identifier
-
-For each device with your app installed on it, Adjust backend generates unique **Adjust device identifier** (**adid**). In order to obtain this identifier, you can make a call the `getAdid` method of the `Adjust` instance:
-
-```dart
-Adjust.getAdid().then((adid) {
- // Use adid string value.
-});
-```
-
-**Note**: Information about **adid** is available after app installation has been tracked by the Adjust backend. From that moment on, Adjust SDK has information about your device **adid** and you can access it with this method. So, **it is not possible** to access **adid** value before the SDK has been initialised and installation of your app was tracked successfully.
-
-### Set external device ID
-
-> **Note** If you want to use external device IDs, please contact your Adjust representative. They will talk you through the best approach for your use case.
-
-An external device identifier is a custom value that you can assign to a device or user. They can help you to recognize users across sessions and platforms. They can also help you to deduplicate installs by user so that a user isn't counted as multiple new installs.
-
-You can also use an external device ID as a custom identifier for a device. This can be useful if you use these identifiers elsewhere and want to keep continuity.
-
-Check out our [external device identifiers article](https://help.adjust.com/en/article/external-device-identifiers) for more information.
-
-> **Note** This setting requires Adjust SDK v4.21.0 or later.
-
-To set an external device ID, assign the identifier to the `externalDeviceId` property of your config instance. Do this before you initialize the Adjust SDK.
-
-```dart
-adjustConfig.externalDeviceId = '{Your-External-Device-Id}';
-```
-
-> **Important**: You need to make sure this ID is **unique to the user or device** depending on your use-case. Using the same ID across different users or devices could lead to duplicated data. Talk to your Adjust representative for more information.
-
-If you want to use the external device ID in your business analytics, you can pass it as a session callback parameter. See the section on [session callback parameters](#cp-session-callback-parameters) for more information.
-
-You can import existing external device IDs into Adjust. This ensures that the backend matches future data to your existing device records. If you want to do this, please contact your Adjust representative.
-
-### Pre-installed trackers
-
-If you want to use the Adjust SDK to recognize users whose devices came with your app pre-installed, follow these steps.
-
-- Create a new tracker in your [dashboard].
-- Set the default tracker of your config object:
-
- ```dart
- adjustConfig.defaultTracker = '{TrackerToken}';
- ```
- Replace `{TrackerToken}` with the tracker token you created in step 1. Please note that the Dashboard displays a tracker URL (including `https://app.adjust.com/`). In your source code, you should specify only the six-character token and not the entire URL.
-
-- Build and run your app. You should see a line like the following in your LogCat:
-
- ```
- Default tracker: 'abc123'
- ```
-
-### Offline mode
-
-You can put the Adjust SDK in offline mode to suspend transmission to our servers, while retaining tracked data to be sent later. While in offline mode, all information is saved in a file, so be careful not to trigger too many events while in offline mode.
-
-You can activate offline mode by calling `setOfflineMode` with the parameter `true`.
-
-```dart
-Adjust.setOfflineMode(true);
-```
-
-Conversely, you can deactivate offline mode by calling `setOfflineMode` with `false`. When the Adjust SDK is put back in online mode, all saved information is sent to our servers with the correct time information.
-
-Unlike disabling tracking, this setting is **not remembered** between sessions. This means that the SDK is in online mode whenever it is started, even if the app was terminated in offline mode.
-
-### Disable tracking
-
-You can disable the Adjust SDK from tracking any activities of the current device by calling `setEnabled` with parameter `false`. **This setting is remembered between sessions**.
-
-```dart
-Adjust.setEnabled(false);
-```
-
-You can check if the Adjust SDK is currently enabled by calling the function `isEnabled`. It is always possible to activatе the Adjust SDK by invoking `setEnabled` with the enabled parameter as `true`.
-
-### Event buffering
-
-If your app makes heavy use of event tracking, you might want to delay some HTTP requests in order to send them in one batch every minute. You can enable event buffering with your config instance:
-
-```dart
-adjustConfig.eventBufferingEnabled = true;
-```
-
-### Background tracking
-
-The default behaviour of the Adjust SDK is to pause sending HTTP requests while the app is in the background. You can change this in your config instance:
-
-```dart
-adjustConfig.sendInBackground = true;
-```
-
-### GDPR right to be forgotten
-
-In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten. Calling the following method will instruct the Adjust SDK to communicate the user's choice to be forgotten to the Adjust backend:
-
-```dart
-Adjust.gdprForgetMe();
-```
-
-Upon receiving this information, Adjust will erase the user's data and the Adjust SDK will stop tracking the user. No requests from this device will be sent to Adjust in the future.
-
-## Third-party sharing for specific users
-
-You can notify Adjust when a user disables, enables, and re-enables data sharing with third-party partners.
-
-### Disable third-party sharing for specific users
-
-Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend:
-
-```dart
-AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false);
-Adjust.trackThirdPartySharing(adjustThirdPartySharing);
-```
-
-Upon receiving this information, Adjust will block the sharing of that specific user's data to partners and the Adjust SDK will continue to work as usual.
-
-### Enable or re-enable third-party sharing for specific users
-
-Call the following method to instruct the Adjust SDK to communicate the user's choice to share data or change data sharing, to the Adjust backend:
-
-```dart
-AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true);
-Adjust.trackThirdPartySharing(adjustThirdPartySharing);
-```
-
-Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected.
-
-Call the following method to instruct the Adjust SDK to send the granular options to the Adjust backend:
-
-```dart
-AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null);
-adjustThirdPartySharing.addGranularOption('PartnerA', 'foo', 'bar');
-Adjust.trackThirdPartySharing(adjustThirdPartySharing);
-```
-
-### Consent measurement for specific users
-
-You can notify Adjust when a user exercises their right to change data sharing with partners for marketing purposes, but they allow data sharing for statistical purposes.
-
-Call the following method to instruct the Adjust SDK to communicate the user's choice to change data sharing, to the Adjust backend:
-
-```dart
-Adjust.trackMeasurementConsent(true);
-```
-
-Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected.
-
-### Data residency
-
-In order to enable data residency feature, make sure to set `urlStrategy` member of the `AdjustConfig` instance with one of the following constants:
-
-```dart
-adjustConfig.urlStrategy = AdjustConfig.DataResidencyEU; // for EU data residency region
-adjustConfig.urlStrategy = AdjustConfig.DataResidencyTR; // for Turkey data residency region
-adjustConfig.urlStrategy = AdjustConfig.DataResidencyUS; // for US data residency region
-```
-
-### COPPA compliance
-
-By default Adjust SDK doesn't mark app as COPPA compliant. In order to mark your app as COPPA compliant, make sure to set `coppaCompliantEnabled` member of `AdjustConfig` instance to `true`:
-
-```dart
-adjustConfig.coppaCompliantEnabled = true;
-```
-
-**Note:** By enabling this feature, third-party sharing will be automatically disabled for the users. If later during the app lifetime you decide not to mark app as COPPA compliant anymore, third-party sharing **will not be automatically re-enabled**. Instead, next to not marking your app as COPPA compliant anymore, you will need to explicitly re-enable third-party sharing in case you want to do that.
-
-### Play Store Kids Apps
-
-**Note**: This feature exists only in Android platform.
-
-By default Adjust SDK doesn't mark Android app as Play Store Kids App. In order to mark your app as the app which is targetting kids in Play Store, make sure to set `playStoreKidsAppEnabled` member of `AdjustConfig` instance to `true`:
-
-```dart
-adjustConfig.playStoreKidsAppEnabled = true;
-```
-
-[dashboard]: https://adjust.com
-[adjust.com]: https://adjust.com
-
-[example-app]: example
-
-[multiple-receivers]: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md
-[google-ad-id]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en
-[event-tracking]: https://docs.adjust.com/en/event-tracking
-[callbacks-guide]: https://docs.adjust.com/en/callbacks
-[ios-deeplinking]: https://github.com/adjust/ios_sdk/#deep-linking
-[new-referrer-api]: https://developer.android.com/google/play/installreferrer/library.html
-[special-partners]: https://docs.adjust.com/en/special-partners
-[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md
-[currency-conversion]: https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies
-[android-deeplinking]: https://github.com/adjust/android_sdk#deep-linking
-[android-launch-modes]: https://developer.android.com/guide/topics/manifest/activity-element.html
-[google-play-services]: https://developer.android.com/google/play-services/setup.html
-[reattribution-with-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link
-
-## License
-
-The Adjust SDK is licensed under the MIT License.
-
-Copyright (c) 2018-Present Adjust GmbH, https://www.adjust.com
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+Distributed under the [`MIT license`](LICENSE).
diff --git a/VERSION b/VERSION
index c1a44ab..0062ac9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.38.2
+5.0.0
diff --git a/android/build.gradle b/android/build.gradle
index 6dc6b85..346b95d 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -7,7 +7,7 @@ buildscript {
}
dependencies {
- classpath('com.android.tools.build:gradle:7.1.3')
+ classpath('com.android.tools.build:gradle:8.1.4')
}
}
rootProject.allprojects {
@@ -37,5 +37,5 @@ android {
}
dependencies {
- api 'com.adjust.sdk:adjust-android:4.38.5'
+ implementation 'com.adjust.sdk:adjust-android:5.0.0'
}
diff --git a/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java b/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java
index b888c0a..7afd39b 100644
--- a/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java
+++ b/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java
@@ -22,41 +22,46 @@
import com.adjust.sdk.AdjustSessionFailure;
import com.adjust.sdk.AdjustSessionSuccess;
import com.adjust.sdk.AdjustPlayStoreSubscription;
-import com.adjust.sdk.AdjustPurchase;
import com.adjust.sdk.AdjustPurchaseVerificationResult;
import com.adjust.sdk.AdjustThirdPartySharing;
import com.adjust.sdk.AdjustTestOptions;
import com.adjust.sdk.LogLevel;
import com.adjust.sdk.OnAttributionChangedListener;
-import com.adjust.sdk.OnDeeplinkResponseListener;
-import com.adjust.sdk.OnDeviceIdsRead;
+import com.adjust.sdk.OnDeferredDeeplinkResponseListener;
+import com.adjust.sdk.OnGoogleAdIdReadListener;
import com.adjust.sdk.OnEventTrackingFailedListener;
import com.adjust.sdk.OnEventTrackingSucceededListener;
import com.adjust.sdk.OnSessionTrackingFailedListener;
import com.adjust.sdk.OnSessionTrackingSucceededListener;
import com.adjust.sdk.OnPurchaseVerificationFinishedListener;
+import com.adjust.sdk.OnLastDeeplinkReadListener;
import com.adjust.sdk.OnDeeplinkResolvedListener;
+import com.adjust.sdk.OnIsEnabledListener;
+import com.adjust.sdk.OnAdidReadListener;
+import com.adjust.sdk.OnAmazonAdIdReadListener;
+import com.adjust.sdk.OnAttributionReadListener;
+import com.adjust.sdk.OnSdkVersionReadListener;
+import com.adjust.sdk.AdjustPlayStorePurchase;
+import com.adjust.sdk.AdjustDeeplink;
+
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
-import io.flutter.embedding.engine.plugins.activity.ActivityAware;
-import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.MethodCall;
-import static com.adjust.sdk.flutter.AdjustUtils.*;
-
-public class AdjustSdk implements FlutterPlugin, ActivityAware, MethodCallHandler {
+public class AdjustSdk implements FlutterPlugin, MethodCallHandler {
private static String TAG = "AdjustBridge";
- private static boolean launchDeferredDeeplink = true;
+ private static boolean isDeferredDeeplinkOpeningEnabled = true;
private MethodChannel channel;
private Context applicationContext;
@@ -77,37 +82,11 @@ public void onDetachedFromEngine(FlutterPluginBinding binding) {
channel = null;
}
- // ActivityAware
- @Override
- public void onAttachedToActivity(ActivityPluginBinding binding) {
- Adjust.onResume();
- }
-
- @Override
- public void onDetachedFromActivityForConfigChanges() {
- }
-
- @Override
- public void onReattachedToActivityForConfigChanges(
- ActivityPluginBinding binding) {
- }
-
- @Override
- public void onDetachedFromActivity() {
- Adjust.onPause();
- }
-
@Override
public void onMethodCall(MethodCall call, final Result result) {
switch (call.method) {
- case "start":
- start(call, result);
- break;
- case "onPause":
- onPause(result);
- break;
- case "onResume":
- onResume(result);
+ case "initSdk":
+ initSdk(call, result);
break;
case "trackEvent":
trackEvent(call, result);
@@ -115,30 +94,30 @@ public void onMethodCall(MethodCall call, final Result result) {
case "isEnabled":
isEnabled(result);
break;
- case "setEnabled":
- setEnabled(call, result);
+ case "enable":
+ enable(result);
+ break;
+ case "disable":
+ disable(result);
break;
- case "setOfflineMode":
- setOfflineMode(call, result);
+ case "switchToOfflineMode":
+ switchToOfflineMode(result);
+ break;
+ case "switchBackToOnlineMode":
+ switchBackToOnlineMode(result);
break;
case "setPushToken":
setPushToken(call, result);
break;
- case "appWillOpenUrl":
- appWillOpenUrl(call, result);
+ case "processDeeplink":
+ processDeeplink(call, result);
break;
- case "sendFirstPackages":
- sendFirstPackages(result);
+ case "processAndResolveDeeplink":
+ processAndResolveDeeplink(call, result);
break;
case "getAdid":
getAdid(result);
break;
- case "getIdfa":
- getIdfa(result);
- break;
- case "getIdfv":
- getIdfv(result);
- break;
case "getGoogleAdId":
getGoogleAdId(result);
break;
@@ -151,74 +130,79 @@ public void onMethodCall(MethodCall call, final Result result) {
case "getSdkVersion":
getSdkVersion(result);
break;
- case "setReferrer":
- setReferrer(call, result);
- break;
case "gdprForgetMe":
gdprForgetMe(result);
break;
- case "disableThirdPartySharing":
- disableThirdPartySharing(result);
+ case "addGlobalCallbackParameter":
+ addGlobalCallbackParameter(call, result);
break;
- case "addSessionCallbackParameter":
- addSessionCallbackParameter(call, result);
+ case "addGlobalPartnerParameter":
+ addGlobalPartnerParameter(call, result);
break;
- case "addSessionPartnerParameter":
- addSessionPartnerParameter(call, result);
+ case "removeGlobalCallbackParameter":
+ removeGlobalCallbackParameter(call, result);
break;
- case "removeSessionCallbackParameter":
- removeSessionCallbackParameter(call, result);
+ case "removeGlobalPartnerParameter":
+ removeGlobalPartnerParameter(call, result);
break;
- case "removeSessionPartnerParameter":
- removeSessionPartnerParameter(call, result);
+ case "removeGlobalCallbackParameters":
+ removeGlobalCallbackParameters(result);
break;
- case "resetSessionCallbackParameters":
- resetSessionCallbackParameters(result);
- break;
- case "resetSessionPartnerParameters":
- resetSessionPartnerParameters(result);
+ case "removeGlobalPartnerParameters":
+ removeGlobalPartnerParameters(result);
break;
case "trackAdRevenue":
trackAdRevenue(call, result);
break;
- case "trackAdRevenueNew":
- trackAdRevenueNew(call, result);
- break;
- case "trackAppStoreSubscription":
- trackAppStoreSubscription(result);
- break;
case "trackPlayStoreSubscription":
trackPlayStoreSubscription(call, result);
break;
- case "requestTrackingAuthorizationWithCompletionHandler":
- requestTrackingAuthorizationWithCompletionHandler(result);
- break;
- case "updateConversionValue":
- updateConversionValue(result);
- break;
case "trackThirdPartySharing":
trackThirdPartySharing(call, result);
break;
case "trackMeasurementConsent":
trackMeasurementConsent(call, result);
break;
- case "checkForNewAttStatus":
- checkForNewAttStatus(call, result);
- break;
- case "getAppTrackingAuthorizationStatus":
- getAppTrackingAuthorizationStatus(call, result);
- break;
case "getLastDeeplink":
- getLastDeeplink(call, result);
+ getLastDeeplink(result);
break;
case "verifyPlayStorePurchase":
verifyPlayStorePurchase(call, result);
break;
+ case "verifyAndTrackPlayStorePurchase":
+ verifyAndTrackPlayStorePurchase(call, result);
+ break;
+ // ios only methods
+ case "getIdfa":
+ getIdfa(result);
+ break;
+ case "getIdfv":
+ getIdfv(result);
+ break;
+ case "trackAppStoreSubscription":
+ trackAppStoreSubscription(result);
+ break;
+ case "requestAppTrackingAuthorization":
+ requestAppTrackingAuthorization(result);
+ break;
+ case "updateSkanConversionValue":
+ updateSkanConversionValue(result);
+ break;
+ case "getAppTrackingAuthorizationStatus":
+ getAppTrackingAuthorizationStatus(call, result);
+ break;
case "verifyAppStorePurchase":
verifyAppStorePurchase(call, result);
break;
- case "processDeeplink":
- processDeeplink(call, result);
+ case "verifyAndTrackAppStorePurchase":
+ verifyAndTrackAppStorePurchase(call, result);
+ break;
+ // used for testing only
+ case "onPause":
+ onPause(result);
+ break;
+ case "onResume":
+ onResume(result);
break;
case "setTestOptions":
setTestOptions(call, result);
@@ -230,7 +214,7 @@ public void onMethodCall(MethodCall call, final Result result) {
}
}
- private void start(final MethodCall call, final Result result) {
+ private void initSdk(final MethodCall call, final Result result) {
Map configMap = (Map) call.arguments;
if (configMap == null) {
return;
@@ -241,17 +225,17 @@ private void start(final MethodCall call, final Result result) {
String logLevel = null;
boolean isLogLevelSuppress = false;
- // App token.
+ // app token
if (configMap.containsKey("appToken")) {
appToken = (String) configMap.get("appToken");
}
- // Environment.
+ // environment
if (configMap.containsKey("environment")) {
environment = (String) configMap.get("environment");
}
- // Suppress log level.
+ // suppress log level
if (configMap.containsKey("logLevel")) {
logLevel = (String) configMap.get("logLevel");
if (logLevel != null && logLevel.equals("suppress")) {
@@ -259,16 +243,16 @@ private void start(final MethodCall call, final Result result) {
}
}
- // Create configuration object.
+ // create configuration object
AdjustConfig adjustConfig = new AdjustConfig(applicationContext, appToken, environment, isLogLevelSuppress);
- // SDK prefix.
+ // SDK prefix
if (configMap.containsKey("sdkPrefix")) {
String sdkPrefix = (String) configMap.get("sdkPrefix");
adjustConfig.setSdkPrefix(sdkPrefix);
}
- // Log level.
+ // log level
if (configMap.containsKey("logLevel")) {
logLevel = (String) configMap.get("logLevel");
if (logLevel != null) {
@@ -299,162 +283,127 @@ private void start(final MethodCall call, final Result result) {
}
}
- // Event buffering.
- if (configMap.containsKey("eventBufferingEnabled")) {
- String strEventBufferingEnabled = (String) configMap.get("eventBufferingEnabled");
- boolean eventBufferingEnabled = Boolean.parseBoolean(strEventBufferingEnabled);
- adjustConfig.setEventBufferingEnabled(eventBufferingEnabled);
+ // COPPA compliance
+ if (configMap.containsKey("isCoppaComplianceEnabled")) {
+ String strIsCoppaComplianceEnabled = (String) configMap.get("isCoppaComplianceEnabled");
+ boolean isCoppaComplianceEnabled = Boolean.parseBoolean(strIsCoppaComplianceEnabled);
+ if (isCoppaComplianceEnabled) {
+ adjustConfig.enableCoppaCompliance();
+ }
}
- // COPPA compliance.
- if (configMap.containsKey("coppaCompliantEnabled")) {
- String strCoppaCompliantEnabled = (String) configMap.get("coppaCompliantEnabled");
- boolean coppaCompliantEnabled = Boolean.parseBoolean(strCoppaCompliantEnabled);
- adjustConfig.setCoppaCompliantEnabled(coppaCompliantEnabled);
+ // Google Play Store kids compliance
+ if (configMap.containsKey("isPlayStoreKidsComplianceEnabled")) {
+ String strIsPlayStoreKidsComplianceEnabled = (String) configMap.get("isPlayStoreKidsComplianceEnabled");
+ boolean isPlayStoreKidsComplianceEnabled = Boolean.parseBoolean(strIsPlayStoreKidsComplianceEnabled);
+ if (isPlayStoreKidsComplianceEnabled) {
+ adjustConfig.enablePlayStoreKidsCompliance();
+ }
}
- // Final attribution.
- if (configMap.containsKey("finalAndroidAttributionEnabled")) {
- String strFinalAndroidAttributionEnabled = (String) configMap.get("finalAndroidAttributionEnabled");
- boolean finalAndroidAttributionEnabled = Boolean.parseBoolean(strFinalAndroidAttributionEnabled);
- adjustConfig.setFinalAttributionEnabled(finalAndroidAttributionEnabled);
+ // read device info only once
+ if (configMap.containsKey("isDeviceIdsReadingOnceEnabled")) {
+ String strIsDeviceIdsReadingOnceEnabled = (String) configMap.get("isDeviceIdsReadingOnceEnabled");
+ boolean isDeviceIdsReadingOnceEnabled = Boolean.parseBoolean(strIsDeviceIdsReadingOnceEnabled);
+ if (isDeviceIdsReadingOnceEnabled) {
+ adjustConfig.enableDeviceIdsReadingOnce();
+ }
}
- // Read Android device info only once.
- if (configMap.containsKey("readDeviceInfoOnceEnabled")) {
- String strReadDeviceInfoOnceEnabled = (String) configMap.get("readDeviceInfoOnceEnabled");
- boolean readDeviceInfoOnceEnabled = Boolean.parseBoolean(strReadDeviceInfoOnceEnabled);
- adjustConfig.setReadDeviceInfoOnceEnabled(readDeviceInfoOnceEnabled);
+ // event deduplication buffer size
+ if (configMap.containsKey("eventDeduplicationIdsMaxSize")) {
+ String strEventDeduplicationIdsMaxSize = (String) configMap.get("eventDeduplicationIdsMaxSize");
+ try {
+ int eventDeduplicationIdsMaxSize = Integer.valueOf(strEventDeduplicationIdsMaxSize);
+ adjustConfig.setEventDeduplicationIdsMaxSize(eventDeduplicationIdsMaxSize);
+ } catch (Exception e) {}
}
- // Google Play Store kids apps.
- if (configMap.containsKey("playStoreKidsAppEnabled")) {
- String strPlayStoreKidsAppEnabled = (String) configMap.get("playStoreKidsAppEnabled");
- boolean playStoreKidsAppEnabled = Boolean.parseBoolean(strPlayStoreKidsAppEnabled);
- adjustConfig.setPlayStoreKidsAppEnabled(playStoreKidsAppEnabled);
+ // URL strategy
+ if (configMap.containsKey("urlStrategyDomains")
+ && configMap.containsKey("useSubdomains")
+ && configMap.containsKey("isDataResidency")) {
+ String strUrlStrategyDomains = (String) configMap.get("urlStrategyDomains");
+ try {
+ JSONArray jsonArray = new JSONArray(strUrlStrategyDomains);
+ ArrayList urlStrategyDomainsArray = new ArrayList<>();
+ for (int i = 0; i < jsonArray.length(); i += 1) {
+ urlStrategyDomainsArray.add((String)jsonArray.get(i));
+ }
+ String strShouldUseSubdomains = (String) configMap.get("useSubdomains");
+ boolean useSubdomains = Boolean.parseBoolean(strShouldUseSubdomains);
+
+ String strIsDataResidency = (String) configMap.get("isDataResidency");
+ boolean isDataResidency = Boolean.parseBoolean(strIsDataResidency);
+
+ adjustConfig.setUrlStrategy(urlStrategyDomainsArray, useSubdomains, isDataResidency);
+ } catch (JSONException ignored) {}
}
- // Main process name.
+ // main process name
if (configMap.containsKey("processName")) {
String processName = (String) configMap.get("processName");
adjustConfig.setProcessName(processName);
}
- // Default tracker.
+ // default tracker
if (configMap.containsKey("defaultTracker")) {
String defaultTracker = (String) configMap.get("defaultTracker");
adjustConfig.setDefaultTracker(defaultTracker);
}
- // External device ID.
+ // external device ID
if (configMap.containsKey("externalDeviceId")) {
String externalDeviceId = (String) configMap.get("externalDeviceId");
adjustConfig.setExternalDeviceId(externalDeviceId);
}
- // Custom preinstall file path.
+ // custom preinstall file path
if (configMap.containsKey("preinstallFilePath")) {
String preinstallFilePath = (String) configMap.get("preinstallFilePath");
adjustConfig.setPreinstallFilePath(preinstallFilePath);
}
- // META install referrer.
+ // META install referrer
if (configMap.containsKey("fbAppId")) {
String fbAppId = (String) configMap.get("fbAppId");
adjustConfig.setFbAppId(fbAppId);
}
- // URL strategy.
- if (configMap.containsKey("urlStrategy")) {
- String urlStrategy = (String) configMap.get("urlStrategy");
- if (urlStrategy.equalsIgnoreCase("china")) {
- adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CHINA);
- } else if (urlStrategy.equalsIgnoreCase("india")) {
- adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_INDIA);
- } else if (urlStrategy.equalsIgnoreCase("cn")) {
- adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CN);
- } else if (urlStrategy.equalsIgnoreCase("cn-only")) {
- adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CN_ONLY);
- } else if (urlStrategy.equalsIgnoreCase("data-residency-eu")) {
- adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_EU);
- } else if (urlStrategy.equalsIgnoreCase("data-residency-tr")) {
- adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_TR);
- } else if (urlStrategy.equalsIgnoreCase("data-residency-us")) {
- adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_US);
+ // sending in background
+ if (configMap.containsKey("isSendingInBackgroundEnabled")) {
+ String strIsSendingInBackgroundEnabled = (String) configMap.get("isSendingInBackgroundEnabled");
+ boolean isSendingInBackgroundEnabled = Boolean.parseBoolean(strIsSendingInBackgroundEnabled);
+ if (isSendingInBackgroundEnabled) {
+ adjustConfig.enableSendingInBackground();
}
}
- // User agent.
- if (configMap.containsKey("userAgent")) {
- String userAgent = (String) configMap.get("userAgent");
- adjustConfig.setUserAgent(userAgent);
- }
-
- // Background tracking.
- if (configMap.containsKey("sendInBackground")) {
- String strSendInBackground = (String) configMap.get("sendInBackground");
- boolean sendInBackground = Boolean.parseBoolean(strSendInBackground);
- adjustConfig.setSendInBackground(sendInBackground);
- }
-
- // Set device known.
- if (configMap.containsKey("isDeviceKnown")) {
- String strIsDeviceKnown = (String) configMap.get("isDeviceKnown");
- boolean isDeviceKnown = Boolean.parseBoolean(strIsDeviceKnown);
- adjustConfig.setDeviceKnown(isDeviceKnown);
- }
-
- // Cost data.
- if (configMap.containsKey("needsCost")) {
- String strNeedsCost = (String) configMap.get("needsCost");
- boolean needsCost = Boolean.parseBoolean(strNeedsCost);
- adjustConfig.setNeedsCost(needsCost);
- }
-
- // Preinstall tracking.
- if (configMap.containsKey("preinstallTrackingEnabled")) {
- String strPreinstallTrackingEnabled = (String) configMap.get("preinstallTrackingEnabled");
- boolean preinstallTrackingEnabled = Boolean.parseBoolean(strPreinstallTrackingEnabled);
- adjustConfig.setPreinstallTrackingEnabled(preinstallTrackingEnabled);
- }
-
- // Delayed start.
- if (configMap.containsKey("delayStart")) {
- String strDelayStart = (String) configMap.get("delayStart");
- if (isNumber(strDelayStart)) {
- double delayStart = Double.parseDouble(strDelayStart);
- adjustConfig.setDelayStart(delayStart);
+ // cost data in attribution callback
+ if (configMap.containsKey("isCostDataInAttributionEnabled")) {
+ String strIsCostDataInAttributionEnabled = (String) configMap.get("isCostDataInAttributionEnabled");
+ boolean isCostDataInAttributionEnabled = Boolean.parseBoolean(strIsCostDataInAttributionEnabled);
+ if (isCostDataInAttributionEnabled) {
+ adjustConfig.enableCostDataInAttribution();
}
}
- // App secret.
- if (configMap.containsKey("secretId")
- && configMap.containsKey("info1")
- && configMap.containsKey("info2")
- && configMap.containsKey("info3")
- && configMap.containsKey("info4")) {
- try {
- String strSecretId = (String) configMap.get("secretId");
- String strInfo1 = (String) configMap.get("info1");
- String strInfo2 = (String) configMap.get("info2");
- String strInfo3 = (String) configMap.get("info3");
- String strInfo4 = (String) configMap.get("info4");
- long secretId = Long.parseLong(strSecretId, 10);
- long info1 = Long.parseLong(strInfo1, 10);
- long info2 = Long.parseLong(strInfo2, 10);
- long info3 = Long.parseLong(strInfo3, 10);
- long info4 = Long.parseLong(strInfo4, 10);
- adjustConfig.setAppSecret(secretId, info1, info2, info3, info4);
- } catch (NumberFormatException ignore) {}
+ // preinstall tracking
+ if (configMap.containsKey("isPreinstallTrackingEnabled")) {
+ String strIsPreinstallTrackingEnabled = (String) configMap.get("isPreinstallTrackingEnabled");
+ boolean isPreinstallTrackingEnabled = Boolean.parseBoolean(strIsPreinstallTrackingEnabled);
+ if (isPreinstallTrackingEnabled) {
+ adjustConfig.enablePreinstallTracking();
+ }
}
- // Launch deferred deep link.
- if (configMap.containsKey("launchDeferredDeeplink")) {
- String strLaunchDeferredDeeplink = (String) configMap.get("launchDeferredDeeplink");
- launchDeferredDeeplink = strLaunchDeferredDeeplink.equals("true");
+ // launch deferred deep link
+ if (configMap.containsKey("isDeferredDeeplinkOpeningEnabled")) {
+ String strIsDeferredDeeplinkOpeningEnabled = (String) configMap.get("isDeferredDeeplinkOpeningEnabled");
+ isDeferredDeeplinkOpeningEnabled = strIsDeferredDeeplinkOpeningEnabled.equals("true");
}
- // Attribution callback.
+ // attribution callback
if (configMap.containsKey("attributionCallback")) {
final String dartMethodName = (String) configMap.get("attributionCallback");
if (dartMethodName != null) {
@@ -469,7 +418,6 @@ public void onAttributionChanged(AdjustAttribution adjustAttribution) {
adjustAttributionMap.put("adgroup", adjustAttribution.adgroup);
adjustAttributionMap.put("creative", adjustAttribution.creative);
adjustAttributionMap.put("clickLabel", adjustAttribution.clickLabel);
- adjustAttributionMap.put("adid", adjustAttribution.adid);
adjustAttributionMap.put("costType", adjustAttribution.costType);
adjustAttributionMap.put("costAmount", adjustAttribution.costAmount != null ?
adjustAttribution.costAmount.toString() : "");
@@ -483,13 +431,13 @@ public void onAttributionChanged(AdjustAttribution adjustAttribution) {
}
}
- // Session success callback.
+ // session success callback
if (configMap.containsKey("sessionSuccessCallback")) {
final String dartMethodName = (String) configMap.get("sessionSuccessCallback");
if (dartMethodName != null) {
adjustConfig.setOnSessionTrackingSucceededListener(new OnSessionTrackingSucceededListener() {
@Override
- public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess adjustSessionSuccess) {
+ public void onSessionTrackingSucceeded(AdjustSessionSuccess adjustSessionSuccess) {
HashMap adjustSessionSuccessMap = new HashMap();
adjustSessionSuccessMap.put("message", adjustSessionSuccess.message);
adjustSessionSuccessMap.put("timestamp", adjustSessionSuccess.timestamp);
@@ -505,13 +453,13 @@ public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess adjustSessio
}
}
- // Session failure callback.
+ // session failure callback
if (configMap.containsKey("sessionFailureCallback")) {
final String dartMethodName = (String) configMap.get("sessionFailureCallback");
if (dartMethodName != null) {
adjustConfig.setOnSessionTrackingFailedListener(new OnSessionTrackingFailedListener() {
@Override
- public void onFinishedSessionTrackingFailed(AdjustSessionFailure adjustSessionFailure) {
+ public void onSessionTrackingFailed(AdjustSessionFailure adjustSessionFailure) {
HashMap adjustSessionFailureMap = new HashMap();
adjustSessionFailureMap.put("message", adjustSessionFailure.message);
adjustSessionFailureMap.put("timestamp", adjustSessionFailure.timestamp);
@@ -528,13 +476,13 @@ public void onFinishedSessionTrackingFailed(AdjustSessionFailure adjustSessionFa
}
}
- // Event success callback.
+ // event success callback
if (configMap.containsKey("eventSuccessCallback")) {
final String dartMethodName = (String) configMap.get("eventSuccessCallback");
if (dartMethodName != null) {
adjustConfig.setOnEventTrackingSucceededListener(new OnEventTrackingSucceededListener() {
@Override
- public void onFinishedEventTrackingSucceeded(AdjustEventSuccess adjustEventSuccess) {
+ public void onEventTrackingSucceeded(AdjustEventSuccess adjustEventSuccess) {
HashMap adjustEventSuccessMap = new HashMap();
adjustEventSuccessMap.put("message", adjustEventSuccess.message);
adjustEventSuccessMap.put("timestamp", adjustEventSuccess.timestamp);
@@ -552,13 +500,13 @@ public void onFinishedEventTrackingSucceeded(AdjustEventSuccess adjustEventSucce
}
}
- // Event failure callback.
+ // event failure callback
if (configMap.containsKey("eventFailureCallback")) {
final String dartMethodName = (String) configMap.get("eventFailureCallback");
if (dartMethodName != null) {
adjustConfig.setOnEventTrackingFailedListener(new OnEventTrackingFailedListener() {
@Override
- public void onFinishedEventTrackingFailed(AdjustEventFailure adjustEventFailure) {
+ public void onEventTrackingFailed(AdjustEventFailure adjustEventFailure) {
HashMap adjustEventFailureMap = new HashMap();
adjustEventFailureMap.put("message", adjustEventFailure.message);
adjustEventFailureMap.put("timestamp", adjustEventFailure.timestamp);
@@ -577,27 +525,26 @@ public void onFinishedEventTrackingFailed(AdjustEventFailure adjustEventFailure)
}
}
- // Deferred deep link callback.
+ // deferred deep link callback
if (configMap.containsKey("deferredDeeplinkCallback")) {
final String dartMethodName = (String) configMap.get("deferredDeeplinkCallback");
if (dartMethodName != null) {
- adjustConfig.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() {
+ adjustConfig.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() {
@Override
- public boolean launchReceivedDeeplink(Uri uri) {
+ public boolean launchReceivedDeeplink(Uri deeplink) {
HashMap uriParamsMap = new HashMap();
- uriParamsMap.put("uri", uri.toString());
+ uriParamsMap.put("deeplink", deeplink.toString());
if (channel != null) {
channel.invokeMethod(dartMethodName, uriParamsMap);
}
- return launchDeferredDeeplink;
+ return isDeferredDeeplinkOpeningEnabled;
}
});
}
}
- // Start SDK.
- Adjust.onCreate(adjustConfig);
- Adjust.onResume();
+ // initialize SDK
+ Adjust.initSdk(adjustConfig);
result.success(null);
}
@@ -607,16 +554,16 @@ private void trackEvent(final MethodCall call, final Result result) {
return;
}
- // Event token.
+ // event token
String eventToken = null;
if (eventMap.containsKey("eventToken")) {
eventToken = (String) eventMap.get("eventToken");
}
- // Create event object.
+ // create event object
AdjustEvent event = new AdjustEvent(eventToken);
- // Revenue.
+ // revenue and currency
if (eventMap.containsKey("revenue") || eventMap.containsKey("currency")) {
double revenue = -1.0;
String strRevenue = (String) eventMap.get("revenue");
@@ -629,31 +576,31 @@ private void trackEvent(final MethodCall call, final Result result) {
event.setRevenue(revenue, currency);
}
- // Revenue deduplication.
- if (eventMap.containsKey("transactionId")) {
- String orderId = (String) eventMap.get("transactionId");
- event.setOrderId(orderId);
+ // event deduplication
+ if (eventMap.containsKey("deduplicationId")) {
+ String deduplicationId = (String) eventMap.get("deduplicationId");
+ event.setDeduplicationId(deduplicationId);
}
- // Product ID.
+ // product ID
if (eventMap.containsKey("productId")) {
String productId = (String) eventMap.get("productId");
event.setProductId(productId);
}
- // Purchase token.
+ // purchase token
if (eventMap.containsKey("purchaseToken")) {
String purchaseToken = (String) eventMap.get("purchaseToken");
event.setPurchaseToken(purchaseToken);
}
- // Callback ID.
+ // callback ID
if (eventMap.containsKey("callbackId")) {
String callbackId = (String) eventMap.get("callbackId");
event.setCallbackId(callbackId);
}
- // Callback parameters.
+ // callback parameters
if (eventMap.containsKey("callbackParameters")) {
String strCallbackParametersJson = (String) eventMap.get("callbackParameters");
try {
@@ -669,7 +616,7 @@ private void trackEvent(final MethodCall call, final Result result) {
}
}
- // Partner parameters.
+ // partner parameters
if (eventMap.containsKey("partnerParameters")) {
String strPartnerParametersJson = (String) eventMap.get("partnerParameters");
try {
@@ -685,15 +632,18 @@ private void trackEvent(final MethodCall call, final Result result) {
}
}
- // Track event.
+ // track event
Adjust.trackEvent(event);
result.success(null);
}
- private void setOfflineMode(final MethodCall call, final Result result) {
- Map isOfflineParamsMap = (Map) call.arguments;
- boolean isOffline = (boolean) isOfflineParamsMap.get("isOffline");
- Adjust.setOfflineMode(isOffline);
+ private void switchToOfflineMode(final Result result) {
+ Adjust.switchToOfflineMode();
+ result.success(null);
+ }
+
+ private void switchBackToOnlineMode(final Result result) {
+ Adjust.switchBackToOnlineMode();
result.success(null);
}
@@ -707,66 +657,45 @@ private void setPushToken(final MethodCall call, final Result result) {
result.success(null);
}
- private void setEnabled(final MethodCall call, final Result result) {
- Map isEnabledParamsMap = (Map) call.arguments;
- if (!isEnabledParamsMap.containsKey("isEnabled")) {
- result.error("0", "Arguments null or wrong (missing argument of 'isEnabled' method.", null);
- return;
- }
-
- boolean isEnabled = (boolean) isEnabledParamsMap.get("isEnabled");
- Adjust.setEnabled(isEnabled);
+ private void enable(final Result result) {
+ Adjust.enable();
+ result.success(null);
+ }
+ private void disable( final Result result) {
+ Adjust.disable();
result.success(null);
}
- private void appWillOpenUrl(final MethodCall call, final Result result) {
+ private void processDeeplink(final MethodCall call, final Result result) {
Map urlParamsMap = (Map) call.arguments;
String url = null;
- if (urlParamsMap.containsKey("url")) {
- url = urlParamsMap.get("url").toString();
+ if (urlParamsMap.containsKey("deeplink")) {
+ url = urlParamsMap.get("deeplink").toString();
}
- Adjust.appWillOpenUrl(Uri.parse(url), applicationContext);
- result.success(null);
- }
-
- // Exposed for handling deep linking from native layer of the example app.
- public static void appWillOpenUrl(Uri deeplink, Context context) {
- Adjust.appWillOpenUrl(deeplink, context);
- }
-
- private void sendFirstPackages(final Result result) {
- Adjust.sendFirstPackages();
- result.success(null);
- }
-
- private void onResume(final Result result) {
- Adjust.onResume();
- result.success(null);
- }
-
- private void onPause(final Result result) {
- Adjust.onPause();
+ Adjust.processDeeplink(new AdjustDeeplink(Uri.parse(url)), applicationContext);
result.success(null);
}
private void isEnabled(final Result result) {
- result.success(Adjust.isEnabled());
+ Adjust.isEnabled(applicationContext, new OnIsEnabledListener() {
+ @Override
+ public void onIsEnabledRead(boolean isEnabled) {
+ result.success(isEnabled);
+ }
+ });
}
private void getAdid(final Result result) {
- result.success(Adjust.getAdid());
- }
-
- private void getIdfa(final Result result) {
- result.success("Error. No IDFA on Android platform!");
- }
-
- private void getIdfv(final Result result) {
- result.success("Error. No IDFV on Android platform!");
+ Adjust.getAdid(new OnAdidReadListener() {
+ @Override
+ public void onAdidRead(String adid) {
+ result.success(adid);
+ }
+ });
}
private void getGoogleAdId(final Result result) {
- Adjust.getGoogleAdId(applicationContext, new OnDeviceIdsRead() {
+ Adjust.getGoogleAdId(applicationContext, new OnGoogleAdIdReadListener() {
@Override
public void onGoogleAdIdRead(String googleAdId) {
result.success(googleAdId);
@@ -775,7 +704,12 @@ public void onGoogleAdIdRead(String googleAdId) {
}
private void getAmazonAdId(final Result result) {
- result.success(Adjust.getAmazonAdId(applicationContext));
+ Adjust.getAmazonAdId(applicationContext, new OnAmazonAdIdReadListener() {
+ @Override
+ public void onAmazonAdIdRead(String amazonAdId) {
+ result.success(amazonAdId);
+ }
+ });
}
private void gdprForgetMe(final Result result) {
@@ -783,36 +717,35 @@ private void gdprForgetMe(final Result result) {
result.success(null);
}
- private void disableThirdPartySharing(final Result result) {
- Adjust.disableThirdPartySharing(applicationContext);
- result.success(null);
- }
-
private void getAttribution(final Result result) {
- AdjustAttribution adjustAttribution = Adjust.getAttribution();
- if (adjustAttribution == null) {
- adjustAttribution = new AdjustAttribution();
- }
-
- HashMap adjustAttributionMap = new HashMap();
- adjustAttributionMap.put("trackerToken", adjustAttribution.trackerToken);
- adjustAttributionMap.put("trackerName", adjustAttribution.trackerName);
- adjustAttributionMap.put("network", adjustAttribution.network);
- adjustAttributionMap.put("campaign", adjustAttribution.campaign);
- adjustAttributionMap.put("adgroup", adjustAttribution.adgroup);
- adjustAttributionMap.put("creative", adjustAttribution.creative);
- adjustAttributionMap.put("clickLabel", adjustAttribution.clickLabel);
- adjustAttributionMap.put("adid", adjustAttribution.adid);
- adjustAttributionMap.put("costType", adjustAttribution.costType);
- adjustAttributionMap.put("costAmount", adjustAttribution.costAmount != null ?
- adjustAttribution.costAmount.toString() : "");
- adjustAttributionMap.put("costCurrency", adjustAttribution.costCurrency);
- adjustAttributionMap.put("fbInstallReferrer", adjustAttribution.fbInstallReferrer);
- result.success(adjustAttributionMap);
+ Adjust.getAttribution(new OnAttributionReadListener() {
+ @Override
+ public void onAttributionRead(AdjustAttribution attribution){
+ HashMap adjustAttributionMap = new HashMap();
+ adjustAttributionMap.put("trackerToken", attribution.trackerToken);
+ adjustAttributionMap.put("trackerName", attribution.trackerName);
+ adjustAttributionMap.put("network", attribution.network);
+ adjustAttributionMap.put("campaign", attribution.campaign);
+ adjustAttributionMap.put("adgroup", attribution.adgroup);
+ adjustAttributionMap.put("creative", attribution.creative);
+ adjustAttributionMap.put("clickLabel", attribution.clickLabel);
+ adjustAttributionMap.put("costType", attribution.costType);
+ adjustAttributionMap.put("costAmount", attribution.costAmount != null ?
+ attribution.costAmount.toString() : "");
+ adjustAttributionMap.put("costCurrency", attribution.costCurrency);
+ adjustAttributionMap.put("fbInstallReferrer", attribution.fbInstallReferrer);
+ result.success(adjustAttributionMap);
+ }
+ });
}
private void getSdkVersion(final Result result) {
- result.success(Adjust.getSdkVersion());
+ Adjust.getSdkVersion(new OnSdkVersionReadListener (){
+ @Override
+ public void onSdkVersionRead(String sdkVersion) {
+ result.success(sdkVersion);
+ }
+ });
}
private void setReferrer(final MethodCall call, final Result result) {
@@ -824,127 +757,109 @@ private void setReferrer(final MethodCall call, final Result result) {
result.success(null);
}
- private void addSessionCallbackParameter(final MethodCall call, final Result result) {
+ private void addGlobalCallbackParameter(final MethodCall call, final Result result) {
String key = null;
String value = null;
if (call.hasArgument("key") && call.hasArgument("value")) {
key = (String) call.argument("key");
value = (String) call.argument("value");
}
- Adjust.addSessionCallbackParameter(key, value);
+ Adjust.addGlobalCallbackParameter(key, value);
result.success(null);
}
- private void addSessionPartnerParameter(final MethodCall call, final Result result) {
+ private void addGlobalPartnerParameter(final MethodCall call, final Result result) {
String key = null;
String value = null;
if (call.hasArgument("key") && call.hasArgument("value")) {
key = (String) call.argument("key");
value = (String) call.argument("value");
}
- Adjust.addSessionPartnerParameter(key, value);
+ Adjust.addGlobalPartnerParameter(key, value);
result.success(null);
}
- private void removeSessionCallbackParameter(final MethodCall call, final Result result) {
+ private void removeGlobalCallbackParameter(final MethodCall call, final Result result) {
String key = null;
if (call.hasArgument("key")) {
key = (String) call.argument("key");
}
- Adjust.removeSessionCallbackParameter(key);
+ Adjust.removeGlobalCallbackParameter(key);
result.success(null);
}
- private void removeSessionPartnerParameter(final MethodCall call, final Result result) {
+ private void removeGlobalPartnerParameter(final MethodCall call, final Result result) {
String key = null;
if (call.hasArgument("key")) {
key = (String) call.argument("key");
}
- Adjust.removeSessionPartnerParameter(key);
+ Adjust.removeGlobalPartnerParameter(key);
result.success(null);
}
- private void resetSessionCallbackParameters(final Result result) {
- Adjust.resetSessionCallbackParameters();
+ private void removeGlobalCallbackParameters(final Result result) {
+ Adjust.removeGlobalCallbackParameters();
result.success(null);
}
- private void resetSessionPartnerParameters(final Result result) {
- Adjust.resetSessionPartnerParameters();
+ private void removeGlobalPartnerParameters(final Result result) {
+ Adjust.removeGlobalPartnerParameters();
result.success(null);
}
private void trackAdRevenue(final MethodCall call, final Result result) {
- if (call.hasArgument("source") && call.hasArgument("payload")) {
- // Old (MoPub) API.
- String source = (String) call.argument("source");
- String payload = (String) call.argument("payload");
-
- try {
- JSONObject jsonPayload = new JSONObject(payload);
- Adjust.trackAdRevenue(source, jsonPayload);
- } catch (JSONException err) {
- Log.e(TAG, "Given ad revenue payload is not a valid JSON string");
- }
- }
- result.success(null);
- }
-
- private void trackAdRevenueNew(final MethodCall call, final Result result) {
- // New API.
Map adRevenueMap = (Map) call.arguments;
if (adRevenueMap == null) {
return;
}
- // Source.
+ // ad revenue source
String source = null;
if (adRevenueMap.containsKey("source")) {
source = (String) adRevenueMap.get("source");
}
- // Create ad revenue object.
+ // create ad revenue object
AdjustAdRevenue adRevenue = new AdjustAdRevenue(source);
- // Revenue.
+ // revenue and currency
if (adRevenueMap.containsKey("revenue") || adRevenueMap.containsKey("currency")) {
double revenue = -1.0;
String strRevenue = (String) adRevenueMap.get("revenue");
try {
revenue = Double.parseDouble(strRevenue);
+ String currency = (String) adRevenueMap.get("currency");
+ adRevenue.setRevenue(revenue, currency);
} catch (NumberFormatException ignore) {}
-
- String currency = (String) adRevenueMap.get("currency");
- adRevenue.setRevenue(revenue, currency);
}
- // Ad impressions count.
+ // ad impressions count
if (adRevenueMap.containsKey("adImpressionsCount")) {
String strAdImpressionsCount = (String) adRevenueMap.get("adImpressionsCount");
int adImpressionsCount = Integer.parseInt(strAdImpressionsCount);
adRevenue.setAdImpressionsCount(adImpressionsCount);
}
- // Ad revenue network.
+ // ad revenue network
if (adRevenueMap.containsKey("adRevenueNetwork")) {
String adRevenueNetwork = (String) adRevenueMap.get("adRevenueNetwork");
adRevenue.setAdRevenueNetwork(adRevenueNetwork);
}
- // Ad revenue unit.
+ // ad revenue unit
if (adRevenueMap.containsKey("adRevenueUnit")) {
String adRevenueUnit = (String) adRevenueMap.get("adRevenueUnit");
adRevenue.setAdRevenueUnit(adRevenueUnit);
}
- // Ad revenue placement.
+ // ad revenue placement
if (adRevenueMap.containsKey("adRevenuePlacement")) {
String adRevenuePlacement = (String) adRevenueMap.get("adRevenuePlacement");
adRevenue.setAdRevenuePlacement(adRevenuePlacement);
}
- // Callback parameters.
+ // callback parameters
if (adRevenueMap.containsKey("callbackParameters")) {
String strCallbackParametersJson = (String) adRevenueMap.get("callbackParameters");
try {
@@ -960,7 +875,7 @@ private void trackAdRevenueNew(final MethodCall call, final Result result) {
}
}
- // Partner parameters.
+ // partner parameters
if (adRevenueMap.containsKey("partnerParameters")) {
String strPartnerParametersJson = (String) adRevenueMap.get("partnerParameters");
try {
@@ -976,22 +891,18 @@ private void trackAdRevenueNew(final MethodCall call, final Result result) {
}
}
- // Track ad revenue.
+ // track ad revenue
Adjust.trackAdRevenue(adRevenue);
result.success(null);
}
- private void trackAppStoreSubscription(final Result result) {
- result.success("Error. No App Store subscription tracking on Android platform!");
- }
-
private void trackPlayStoreSubscription(final MethodCall call, final Result result) {
Map subscriptionMap = (Map) call.arguments;
if (subscriptionMap == null) {
return;
}
- // Price.
+ // price
long price = -1;
if (subscriptionMap.containsKey("price")) {
try {
@@ -999,19 +910,19 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
} catch (NumberFormatException ignore) {}
}
- // Currency.
+ // currency
String currency = null;
if (subscriptionMap.containsKey("currency")) {
currency = (String) subscriptionMap.get("currency");
}
- // SKU.
+ // SKU
String sku = null;
if (subscriptionMap.containsKey("sku")) {
sku = (String) subscriptionMap.get("sku");
}
- // Order ID.
+ // order ID
String orderId = null;
if (subscriptionMap.containsKey("orderId")) {
orderId = (String) subscriptionMap.get("orderId");
@@ -1023,13 +934,13 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
signature = (String) subscriptionMap.get("signature");
}
- // Purchase token.
+ // purchase token
String purchaseToken = null;
if (subscriptionMap.containsKey("purchaseToken")) {
purchaseToken = (String) subscriptionMap.get("purchaseToken");
}
- // Create subscription object.
+ // create subscription object
AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription(
price,
currency,
@@ -1038,7 +949,7 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
signature,
purchaseToken);
- // Purchase time.
+ // purchase time
if (subscriptionMap.containsKey("purchaseTime")) {
try {
long purchaseTime = Long.parseLong(subscriptionMap.get("purchaseTime").toString());
@@ -1046,7 +957,7 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
} catch (NumberFormatException ignore) {}
}
- // Callback parameters.
+ // callback parameters
if (subscriptionMap.containsKey("callbackParameters")) {
String strCallbackParametersJson = (String) subscriptionMap.get("callbackParameters");
try {
@@ -1062,7 +973,7 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
}
}
- // Partner parameters.
+ // partner parameters
if (subscriptionMap.containsKey("partnerParameters")) {
String strPartnerParametersJson = (String) subscriptionMap.get("partnerParameters");
try {
@@ -1078,19 +989,11 @@ private void trackPlayStoreSubscription(final MethodCall call, final Result resu
}
}
- // Track subscription.
+ // track subscription
Adjust.trackPlayStoreSubscription(subscription);
result.success(null);
}
- private void requestTrackingAuthorizationWithCompletionHandler(final Result result) {
- result.success(-1);
- }
-
- private void updateConversionValue(final Result result) {
- result.success("Error. No updateConversionValue on Android platform!");
- }
-
private void trackThirdPartySharing(final MethodCall call, final Result result) {
Map thirdPartySharingMap = (Map) call.arguments;
if (thirdPartySharingMap == null) {
@@ -1102,10 +1005,10 @@ private void trackThirdPartySharing(final MethodCall call, final Result result)
isEnabled = (Boolean) thirdPartySharingMap.get("isEnabled");
}
- // Create third party sharing object.
+ // create third party sharing object
AdjustThirdPartySharing thirdPartySharing = new AdjustThirdPartySharing(isEnabled);
- // Granular options.
+ // granular options
if (thirdPartySharingMap.containsKey("granularOptions")) {
String strGranularOptions = (String) thirdPartySharingMap.get("granularOptions");
String[] arrayGranularOptions = strGranularOptions.split("__ADJ__", -1);
@@ -1117,7 +1020,7 @@ private void trackThirdPartySharing(final MethodCall call, final Result result)
}
}
- // Partner sharing settings.
+ // partner sharing settings
if (thirdPartySharingMap.containsKey("partnerSharingSettings")) {
String strPartnerSharingSettings = (String) thirdPartySharingMap.get("partnerSharingSettings");
String[] arrayPartnerSharingSettings = strPartnerSharingSettings.split("__ADJ__", -1);
@@ -1129,7 +1032,7 @@ private void trackThirdPartySharing(final MethodCall call, final Result result)
}
}
- // Track third party sharing.
+ // track third party sharing
Adjust.trackThirdPartySharing(thirdPartySharing);
result.success(null);
}
@@ -1146,16 +1049,17 @@ private void trackMeasurementConsent(final MethodCall call, final Result result)
result.success(null);
}
- private void checkForNewAttStatus(final MethodCall call, final Result result) {
- result.success("Error. No checkForNewAttStatus for Android platform!");
- }
-
- private void getAppTrackingAuthorizationStatus(final MethodCall call, final Result result) {
- result.success(-1);
- }
-
- private void getLastDeeplink(final MethodCall call, final Result result) {
- result.success("Error. No getLastDeeplink for Android platform!");
+ private void getLastDeeplink(final Result result) {
+ Adjust.getLastDeeplink(applicationContext, new OnLastDeeplinkReadListener() {
+ @Override
+ public void onLastDeeplinkRead(Uri deeplink) {
+ if (deeplink != null) {
+ result.success(deeplink.toString());
+ } else {
+ result.success("");
+ }
+ }
+ });
}
private void verifyPlayStorePurchase(final MethodCall call, final Result result) {
@@ -1164,23 +1068,23 @@ private void verifyPlayStorePurchase(final MethodCall call, final Result result)
return;
}
- // Product ID.
+ // product ID
String productId = null;
if (purchaseMap.containsKey("productId")) {
productId = (String) purchaseMap.get("productId");
}
- // Purchase token.
+ // purchase token
String purchaseToken = null;
if (purchaseMap.containsKey("purchaseToken")) {
purchaseToken = (String) purchaseMap.get("purchaseToken");
}
- // Create purchase instance.
- AdjustPurchase purchase = new AdjustPurchase(productId, purchaseToken);
+ // create purchase instance
+ AdjustPlayStorePurchase purchase = new AdjustPlayStorePurchase(productId, purchaseToken);
- // Verify purchase.
- Adjust.verifyPurchase(purchase, new OnPurchaseVerificationFinishedListener() {
+ // verify purchase
+ Adjust.verifyPlayStorePurchase(purchase, new OnPurchaseVerificationFinishedListener() {
@Override
public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
HashMap adjustPurchaseMap = new HashMap();
@@ -1192,14 +1096,111 @@ public void onVerificationFinished(AdjustPurchaseVerificationResult verification
});
}
- private void processDeeplink(final MethodCall call, final Result result) {
+ private void verifyAndTrackPlayStorePurchase(final MethodCall call, final Result result) {
+ Map eventMap = (Map) call.arguments;
+ if (eventMap == null) {
+ return;
+ }
+
+ // event token
+ String eventToken = null;
+ if (eventMap.containsKey("eventToken")) {
+ eventToken = (String) eventMap.get("eventToken");
+ }
+
+ // create event object
+ AdjustEvent event = new AdjustEvent(eventToken);
+
+ // revenue
+ if (eventMap.containsKey("revenue") || eventMap.containsKey("currency")) {
+ double revenue = -1.0;
+ String strRevenue = (String) eventMap.get("revenue");
+
+ try {
+ revenue = Double.parseDouble(strRevenue);
+ } catch (NumberFormatException ignore) {}
+
+ String currency = (String) eventMap.get("currency");
+ event.setRevenue(revenue, currency);
+ }
+
+ // event deduplication
+ if (eventMap.containsKey("deduplicationId")) {
+ String deduplicationId = (String) eventMap.get("deduplicationId");
+ event.setDeduplicationId(deduplicationId);
+ }
+
+ // product ID
+ if (eventMap.containsKey("productId")) {
+ String productId = (String) eventMap.get("productId");
+ event.setProductId(productId);
+ }
+
+ // purchase token
+ if (eventMap.containsKey("purchaseToken")) {
+ String purchaseToken = (String) eventMap.get("purchaseToken");
+ event.setPurchaseToken(purchaseToken);
+ }
+
+ // callback ID
+ if (eventMap.containsKey("callbackId")) {
+ String callbackId = (String) eventMap.get("callbackId");
+ event.setCallbackId(callbackId);
+ }
+
+ // callback parameters
+ if (eventMap.containsKey("callbackParameters")) {
+ String strCallbackParametersJson = (String) eventMap.get("callbackParameters");
+ try {
+ JSONObject jsonCallbackParameters = new JSONObject(strCallbackParametersJson);
+ JSONArray callbackParametersKeys = jsonCallbackParameters.names();
+ for (int i = 0; i < callbackParametersKeys.length(); ++i) {
+ String key = callbackParametersKeys.getString(i);
+ String value = jsonCallbackParameters.getString(key);
+ event.addCallbackParameter(key, value);
+ }
+ } catch (JSONException e) {
+ Log.e(TAG, "Failed to parse event callback parameter! Details: " + e);
+ }
+ }
+
+ // partner parameters
+ if (eventMap.containsKey("partnerParameters")) {
+ String strPartnerParametersJson = (String) eventMap.get("partnerParameters");
+ try {
+ JSONObject jsonPartnerParameters = new JSONObject(strPartnerParametersJson);
+ JSONArray partnerParametersKeys = jsonPartnerParameters.names();
+ for (int i = 0; i < partnerParametersKeys.length(); ++i) {
+ String key = partnerParametersKeys.getString(i);
+ String value = jsonPartnerParameters.getString(key);
+ event.addPartnerParameter(key, value);
+ }
+ } catch (JSONException e) {
+ Log.e(TAG, "Failed to parse event partner parameter! Details: " + e);
+ }
+ }
+
+ // verify and track purchase
+ Adjust.verifyAndTrackPlayStorePurchase(event, new OnPurchaseVerificationFinishedListener() {
+ @Override
+ public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
+ HashMap adjustPurchaseMap = new HashMap();
+ adjustPurchaseMap.put("code", String.valueOf(verificationResult.getCode()));
+ adjustPurchaseMap.put("verificationStatus", verificationResult.getVerificationStatus());
+ adjustPurchaseMap.put("message", verificationResult.getMessage());
+ result.success(adjustPurchaseMap);
+ }
+ });
+ }
+
+ private void processAndResolveDeeplink(final MethodCall call, final Result result) {
Map urlParamsMap = (Map) call.arguments;
String url = null;
if (urlParamsMap.containsKey("deeplink")) {
url = urlParamsMap.get("deeplink").toString();
}
- Adjust.processDeeplink(Uri.parse(url), applicationContext, new OnDeeplinkResolvedListener() {
+ Adjust.processAndResolveDeeplink(new AdjustDeeplink(Uri.parse(url)), applicationContext, new OnDeeplinkResolvedListener() {
@Override
public void onDeeplinkResolved(String resolvedLink) {
result.success(resolvedLink);
@@ -1207,8 +1208,48 @@ public void onDeeplinkResolved(String resolvedLink) {
});
}
+ // ios only methods
+ private void getIdfa(final Result result) {
+ result.success("Error. No getIdfa on Android platform!");
+ }
+
+ private void getIdfv(final Result result) {
+ result.success("Error. No getIdfv on Android platform!");
+ }
+
+ private void requestAppTrackingAuthorization(final Result result) {
+ result.success(-1);
+ }
+
+ private void updateSkanConversionValue(final Result result) {
+ result.success("Error. No updateSkanConversionValue on Android platform!");
+ }
+
+ private void getAppTrackingAuthorizationStatus(final MethodCall call, final Result result) {
+ result.success(-1);
+ }
+
+ private void trackAppStoreSubscription(final Result result) {
+ result.success("Error. No trackAppStoreSubscription on Android platform!");
+ }
+
private void verifyAppStorePurchase(final MethodCall call, final Result result) {
- result.success("Error. No verifyAppStorePurchase for Android platform!");
+ result.success("Error. No verifyAppStorePurchase on Android platform!");
+ }
+
+ private void verifyAndTrackAppStorePurchase(final MethodCall call, final Result result) {
+ result.success("Error. No verifyAndTrackAppStorePurchase on Android platform!");
+ }
+
+ // used for testing only
+ private void onResume(final Result result) {
+ Adjust.onResume();
+ result.success(null);
+ }
+
+ private void onPause(final Result result) {
+ Adjust.onPause();
+ result.success(null);
}
private void setTestOptions(final MethodCall call, final Result result) {
@@ -1239,7 +1280,8 @@ private void setTestOptions(final MethodCall call, final Result result) {
if (testOptionsMap.containsKey("purchaseVerificationPath")) {
testOptions.purchaseVerificationPath = (String) testOptionsMap.get("purchaseVerificationPath");
}
- // Kept for the record. Not needed anymore with test options extraction.
+ // kept for the record
+ // not needed anymore with test options extraction
// if (testOptionsMap.containsKey("useTestConnectionOptions")) {
// testOptions.useTestConnectionOptions = testOptionsMap.get("useTestConnectionOptions").toString().equals("true");
// }
@@ -1267,6 +1309,9 @@ private void setTestOptions(final MethodCall call, final Result result) {
if (testOptionsMap.containsKey("deleteState")) {
testOptions.context = applicationContext;
}
+ if (testOptionsMap.containsKey("ignoreSystemLifecycleBootstrap")) {
+ testOptions.ignoreSystemLifecycleBootstrap = testOptionsMap.get("ignoreSystemLifecycleBootstrap").toString().equals("true");
+ }
Adjust.setTestOptions(testOptions);
}
diff --git a/example/android/build.gradle b/example/android/build.gradle
index 34d0a89..44994d6 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -6,7 +6,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:8.1.1'
+ classpath 'com.android.tools.build:gradle:8.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
diff --git a/example/android/gradle.properties b/example/android/gradle.properties
index dfff1c8..f7a6b1a 100644
--- a/example/android/gradle.properties
+++ b/example/android/gradle.properties
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
-org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
+org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 4f8d4d2..8c6e561 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 11.0
+ 12.0
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 5c3a88d..1b79886 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -175,7 +175,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1430;
+ LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -363,10 +363,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
- SUPPORTED_PLATFORMS = iphoneos;
+ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -451,7 +451,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -501,10 +501,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
- SUPPORTED_PLATFORMS = iphoneos;
+ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 4ba725f..5e31d3d 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
with WidgetsBindingObserver {
case AppLifecycleState.inactive:
break;
case AppLifecycleState.resumed:
- Adjust.onResume();
break;
case AppLifecycleState.paused:
- Adjust.onPause();
break;
case AppLifecycleState.detached:
break;
@@ -98,6 +96,13 @@ class _MyHomePageState extends State with WidgetsBindingObserver {
new AdjustConfig('2fm9gkqubvpc', AdjustEnvironment.sandbox);
config.logLevel = AdjustLogLevel.verbose;
+ config.setUrlStrategy(['adjust.net.in', 'adjust.com'], true, false);
+ //config.setUrlStrategy(['adjust.world', 'adjust.com'], true, false);
+ //config.setUrlStrategy(['adjust.cn'], true, false);
+ //config.setUrlStrategy(['eu.adjust.com'], true, true);
+ //config.setUrlStrategy(['us.adjust.com'], true, true);
+ //config.setUrlStrategy(['tr.adjust.com'], true, true);
+
config.attributionCallback = (AdjustAttribution attributionChangedData) {
print('[Adjust]: Attribution changed!');
@@ -123,9 +128,6 @@ class _MyHomePageState extends State with WidgetsBindingObserver {
if (attributionChangedData.clickLabel != null) {
print('[Adjust]: Click label: ' + attributionChangedData.clickLabel!);
}
- if (attributionChangedData.adid != null) {
- print('[Adjust]: Adid: ' + attributionChangedData.adid!);
- }
if (attributionChangedData.costType != null) {
print('[Adjust]: Cost type: ' + attributionChangedData.costType!);
}
@@ -230,38 +232,42 @@ class _MyHomePageState extends State with WidgetsBindingObserver {
print('[Adjust]: Received deferred deeplink: ' + uri!);
};
- config.conversionValueUpdatedCallback = (num? conversionValue) {
- print('[Adjust]: Received conversion value update: ' +
- conversionValue!.toString());
- };
-
- config.skad4ConversionValueUpdatedCallback = (num? conversionValue, String? coarseValue, bool? lockWindow) {
- print('[Adjust]: Received conversion value update!');
- print('[Adjust]: Conversion value: ' + conversionValue!.toString());
- print('[Adjust]: Coarse value: ' + coarseValue!);
- print('[Adjust]: Lock window: ' + lockWindow!.toString());
+ config.skanUpdatedCallback = (Map skanUpdateData) {
+ print('[Adjust]: Received SKAN update information!');
+ if (skanUpdateData["conversion_value"] != null) {
+ print('[Adjust]: Conversion value: ' + skanUpdateData["conversion_value"]!);
+ }
+ if (skanUpdateData["coarse_value"] != null) {
+ print('[Adjust]: Coarse value: ' + skanUpdateData["coarse_value"]!);
+ }
+ if (skanUpdateData["lock_window"] != null) {
+ print('[Adjust]: Lock window: ' + skanUpdateData["lock_window"]!);
+ }
+ if (skanUpdateData["error"] != null) {
+ print('[Adjust]: Error: ' + skanUpdateData["error"]!);
+ }
};
// Add session callback parameters.
- Adjust.addSessionCallbackParameter('scp_foo_1', 'scp_bar');
- Adjust.addSessionCallbackParameter('scp_foo_2', 'scp_value');
+ Adjust.addGlobalCallbackParameter('scp_foo_1', 'scp_bar');
+ Adjust.addGlobalCallbackParameter('scp_foo_2', 'scp_value');
// Add session Partner parameters.
- Adjust.addSessionPartnerParameter('spp_foo_1', 'spp_bar');
- Adjust.addSessionPartnerParameter('spp_foo_2', 'spp_value');
+ Adjust.addGlobalPartnerParameter('spp_foo_1', 'spp_bar');
+ Adjust.addGlobalPartnerParameter('spp_foo_2', 'spp_value');
// Remove session callback parameters.
- Adjust.removeSessionCallbackParameter('scp_foo_1');
- Adjust.removeSessionPartnerParameter('spp_foo_1');
+ Adjust.removeGlobalCallbackParameter('scp_foo_1');
+ Adjust.removeGlobalPartnerParameter('spp_foo_1');
// Clear all session callback parameters.
- Adjust.resetSessionCallbackParameters();
+ Adjust.removeGlobalCallbackParameters();
// Clear all session partner parameters.
- Adjust.resetSessionPartnerParameters();
+ Adjust.removeGlobalPartnerParameters();
// Ask for tracking consent.
- Adjust.requestTrackingAuthorizationWithCompletionHandler().then((status) {
+ Adjust.requestAppTrackingAuthorization().then((status) {
print('[Adjust]: Authorization status update!');
switch (status) {
case 0:
@@ -283,14 +289,8 @@ class _MyHomePageState extends State with WidgetsBindingObserver {
}
});
- // COPPA compliance.
- // config.coppaCompliantEnabled = true;
-
- // Google Play Store kids apps.
- // config.playStoreKidsAppEnabled = true;
-
- // Start SDK.
- Adjust.start(config);
+ // start SDK
+ Adjust.initSdk(config);
}
@override
@@ -381,7 +381,11 @@ class _MyHomePageState extends State with WidgetsBindingObserver {
value: _isSdkEnabled,
onChanged: (bool value) {
setState(() {
- Adjust.setEnabled(value);
+ if(value == true){
+ Adjust.enable();
+ }else {
+ Adjust.disable();
+ }
_isSdkEnabled = value;
print('Switch state = $_isSdkEnabled');
});
diff --git a/ios/Classes/AdjustSdk.m b/ios/Classes/AdjustSdk.m
index ad2d031..6bfd35b 100644
--- a/ios/Classes/AdjustSdk.m
+++ b/ios/Classes/AdjustSdk.m
@@ -8,7 +8,7 @@
#import "AdjustSdk.h"
#import "AdjustSdkDelegate.h"
-#import
+#import
static NSString * const CHANNEL_API_NAME = @"com.adjust.sdk/api";
@@ -34,289 +34,265 @@ - (void)dealloc {
}
- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result {
- if ([@"start" isEqualToString:call.method]) {
- [self start:call withResult:result];
- } else if ([@"onResume" isEqualToString:call.method]) {
- [Adjust trackSubsessionStart];
- } else if ([@"onPause" isEqualToString:call.method]) {
- [Adjust trackSubsessionEnd];
+ if ([@"initSdk" isEqualToString:call.method]) {
+ [self initSdk:call withResult:result];
} else if ([@"trackEvent" isEqualToString:call.method]) {
[self trackEvent:call withResult:result];
- } else if ([@"setEnabled" isEqualToString:call.method]) {
- [self setEnabled:call withResult:result];
- } else if ([@"sendFirstPackages" isEqualToString:call.method]) {
- [self sendFirstPackages:call withResult:result];
+ } else if ([@"enable" isEqualToString:call.method]) {
+ [Adjust enable];
+ } else if ([@"disable" isEqualToString:call.method]) {
+ [Adjust disable];
} else if ([@"gdprForgetMe" isEqualToString:call.method]) {
[self gdprForgetMe:call withResult:result];
- } else if ([@"disableThirdPartySharing" isEqualToString:call.method]) {
- [self disableThirdPartySharing:call withResult:result];
} else if ([@"getAttribution" isEqualToString:call.method]) {
[self getAttribution:call withResult:result];
} else if ([@"getIdfa" isEqualToString:call.method]) {
[self getIdfa:call withResult:result];
} else if ([@"getIdfv" isEqualToString:call.method]) {
[self getIdfv:call withResult:result];
- } else if ([@"getGoogleAdId" isEqualToString:call.method]) {
- [self getGoogleAdId:call withResult:result];
} else if ([@"getSdkVersion" isEqualToString:call.method]) {
[self getSdkVersion:call withResult:result];
- } else if ([@"setOfflineMode" isEqualToString:call.method]) {
- [self setOfflineMode:call withResult:result];
+ } else if ([@"switchToOfflineMode" isEqualToString:call.method]) {
+ [Adjust switchToOfflineMode];
+ } else if ([@"switchBackToOnlineMode" isEqualToString:call.method]) {
+ [Adjust switchBackToOnlineMode];
} else if ([@"setPushToken" isEqualToString:call.method]) {
[self setPushToken:call withResult:result];
} else if ([@"appWillOpenUrl" isEqualToString:call.method]) {
- [self appWillOpenUrl:call withResult:result];
+ [self processDeeplink:call withResult:result];
} else if ([@"trackAdRevenue" isEqualToString:call.method]) {
[self trackAdRevenue:call withResult:result];
- } else if ([@"trackAdRevenueNew" isEqualToString:call.method]) {
- [self trackAdRevenueNew:call withResult:result];
} else if ([@"trackAppStoreSubscription" isEqualToString:call.method]) {
[self trackAppStoreSubscription:call withResult:result];
- } else if ([@"trackPlayStoreSubscription" isEqualToString:call.method]) {
- [self trackPlayStoreSubscription:call withResult:result];
- } else if ([@"requestTrackingAuthorizationWithCompletionHandler" isEqualToString:call.method]) {
- [self requestTrackingAuthorizationWithCompletionHandler:call withResult:result];
+ } else if ([@"requestAppTrackingAuthorization" isEqualToString:call.method]) {
+ [self requestAppTrackingAuthorization:call withResult:result];
} else if ([@"getAppTrackingAuthorizationStatus" isEqualToString:call.method]) {
[self getAppTrackingAuthorizationStatus:call withResult:result];
- } else if ([@"updateConversionValue" isEqualToString:call.method]) {
- [self updateConversionValue:call withResult:result];
} else if ([@"trackThirdPartySharing" isEqualToString:call.method]) {
[self trackThirdPartySharing:call withResult:result];
} else if ([@"trackMeasurementConsent" isEqualToString:call.method]) {
[self trackMeasurementConsent:call withResult:result];
- } else if ([@"setTestOptions" isEqualToString:call.method]) {
- [self setTestOptions:call withResult:result];
- } else if ([@"addSessionCallbackParameter" isEqualToString:call.method]) {
+ } else if ([@"updateSkanConversionValue" isEqualToString:call.method ]){
+ [self updateSkanConversionValue:call withResult:result];
+ } else if ([@"addGlobalCallbackParameter" isEqualToString:call.method]) {
NSString *key = call.arguments[@"key"];
NSString *value = call.arguments[@"value"];
if (!([self isFieldValid:key]) || !([self isFieldValid:value])) {
return;
}
- [Adjust addSessionCallbackParameter:key value:value];
- } else if ([@"removeSessionCallbackParameter" isEqualToString:call.method]) {
+ [Adjust addGlobalCallbackParameter:value forKey:key];
+ } else if ([@"removeGlobalCallbackParameter" isEqualToString:call.method]) {
NSString *key = call.arguments[@"key"];
if (!([self isFieldValid:key])) {
return;
}
- [Adjust removeSessionCallbackParameter:key];
- } else if ([@"resetSessionCallbackParameters" isEqualToString:call.method]) {
- [Adjust resetSessionCallbackParameters];
- } else if ([@"addSessionPartnerParameter" isEqualToString:call.method]) {
+ [Adjust removeGlobalCallbackParameterForKey:key];
+ } else if ([@"removeGlobalCallbackParameters" isEqualToString:call.method]) {
+ [Adjust removeGlobalCallbackParameters];
+ } else if ([@"addGlobalPartnerParameter" isEqualToString:call.method]) {
NSString *key = call.arguments[@"key"];
NSString *value = call.arguments[@"value"];
if (!([self isFieldValid:key]) || !([self isFieldValid:value])) {
return;
}
- [Adjust addSessionPartnerParameter:key value:value];
- } else if ([@"removeSessionPartnerParameter" isEqualToString:call.method]) {
+ [Adjust addGlobalPartnerParameter:value forKey:key];
+ } else if ([@"removeGlobalPartnerParameter" isEqualToString:call.method]) {
NSString *key = call.arguments[@"key"];
if (!([self isFieldValid:key])) {
return;
}
- [Adjust removeSessionPartnerParameter:key];
- } else if ([@"resetSessionPartnerParameters" isEqualToString:call.method]) {
- [Adjust resetSessionPartnerParameters];
+ [Adjust removeGlobalPartnerParameterForKey:key];
+ } else if ([@"removeGlobalPartnerParameters" isEqualToString:call.method]) {
+ [Adjust removeGlobalPartnerParameters];
} else if ([@"isEnabled" isEqualToString:call.method]) {
- BOOL isEnabled = [Adjust isEnabled];
- result(@(isEnabled));
+ [Adjust isEnabledWithCompletionHandler:^(BOOL isEnabled) {
+ result(@(isEnabled));
+ }];
} else if ([@"getAdid" isEqualToString:call.method]) {
- result([Adjust adid]);
- } else if ([@"checkForNewAttStatus" isEqualToString:call.method]) {
- [Adjust checkForNewAttStatus];
- } else if ([@"getLastDeeplink" isEqualToString:call.method]) {
- [self getLastDeeplink:call withResult:result];
- } else if ([@"updateConversionValueWithErrorCallback" isEqualToString:call.method]) {
- [self updateConversionValueWithErrorCallback:call withResult:result];
- } else if ([@"updateConversionValueWithErrorCallbackSkad4" isEqualToString:call.method]) {
- [self updateConversionValueWithErrorCallbackSkad4:call withResult:result];
+ [Adjust adidWithCompletionHandler:^(NSString * _Nullable adid) {
+ result(adid);
+ }];
} else if ([@"verifyAppStorePurchase" isEqualToString:call.method]) {
[self verifyAppStorePurchase:call withResult:result];
- } else if ([@"verifyPlayStorePurchase" isEqualToString:call.method]) {
- [self verifyAppStorePurchase:call withResult:result];
+ } else if ([@"verifyAndTrackAppStorePurchase" isEqualToString:call.method]) {
+ [self verifyAndTrackAppStorePurchase:call withResult:result];
} else if ([@"processDeeplink" isEqualToString:call.method]) {
[self processDeeplink:call withResult:result];
+ } else if ([@"processAndResolveDeeplink" isEqualToString:call.method]) {
+ [self processAndResolveDeeplink:call withResult:result];
+ } else if ([@"getGoogleAdId" isEqualToString:call.method]) {
+ [self getGoogleAdId:call withResult:result];
+ } else if ([@"trackPlayStoreSubscription" isEqualToString:call.method]) {
+ [self trackPlayStoreSubscription:call withResult:result];
+ } else if ([@"verifyPlayStorePurchase" isEqualToString:call.method]) {
+ [self verifyAppStorePurchase:call withResult:result];
+ } else if ([@"verifyAndTrackPlayStorePurchase" isEqualToString:call.method]) {
+ [self verifyAndTrackPlayStorePurchase:call withResult:result];
+ } else if ([@"onResume" isEqualToString:call.method]) {
+ [Adjust trackSubsessionStart];
+ } else if ([@"onPause" isEqualToString:call.method]) {
+ [Adjust trackSubsessionEnd];
+ } else if ([@"setTestOptions" isEqualToString:call.method]) {
+ [self setTestOptions:call withResult:result];
} else {
result(FlutterMethodNotImplemented);
}
}
-- (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+- (void)initSdk:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *appToken = call.arguments[@"appToken"];
NSString *environment = call.arguments[@"environment"];
NSString *logLevel = call.arguments[@"logLevel"];
NSString *sdkPrefix = call.arguments[@"sdkPrefix"];
NSString *defaultTracker = call.arguments[@"defaultTracker"];
NSString *externalDeviceId = call.arguments[@"externalDeviceId"];
- NSString *userAgent = call.arguments[@"userAgent"];
- NSString *urlStrategy = call.arguments[@"urlStrategy"];
- NSString *secretId = call.arguments[@"secretId"];
- NSString *info1 = call.arguments[@"info1"];
- NSString *info2 = call.arguments[@"info2"];
- NSString *info3 = call.arguments[@"info3"];
- NSString *info4 = call.arguments[@"info4"];
- NSString *delayStart = call.arguments[@"delayStart"];
+ NSString *strUrlStrategyDomainsJson = call.arguments[@"urlStrategyDomains"];
+ BOOL isDataResidency = [call.arguments[@"isDataResidency"] boolValue];
+ BOOL useSubdomains = [call.arguments[@"useSubdomains"] boolValue];
NSString *attConsentWaitingInterval = call.arguments[@"attConsentWaitingInterval"];
- NSString *isDeviceKnown = call.arguments[@"isDeviceKnown"];
- NSString *eventBufferingEnabled = call.arguments[@"eventBufferingEnabled"];
- NSString *sendInBackground = call.arguments[@"sendInBackground"];
- NSString *needsCost = call.arguments[@"needsCost"];
- NSString *coppaCompliantEnabled = call.arguments[@"coppaCompliantEnabled"];
- NSString *linkMeEnabled = call.arguments[@"linkMeEnabled"];
- NSString *allowAdServicesInfoReading = call.arguments[@"allowAdServicesInfoReading"];
- NSString *allowIdfaReading = call.arguments[@"allowIdfaReading"];
- NSString *skAdNetworkHandling = call.arguments[@"skAdNetworkHandling"];
- NSString *readDeviceInfoOnceEnabled = call.arguments[@"readDeviceInfoOnceEnabled"];
+ NSString *isSendingInBackgroundEnabled = call.arguments[@"isSendingInBackgroundEnabled"];
+ NSInteger eventDeduplicationIdsMaxSize = [call.arguments[@"eventDeduplicationIdsMaxSize"] integerValue];
+ NSString *isCostDataInAttributionEnabled = call.arguments[@"isCostDataInAttributionEnabled"];
+ NSString *isCoppaComplianceEnabled = call.arguments[@"isCoppaComplianceEnabled"];
+ NSString *isLinkMeEnabled = call.arguments[@"isLinkMeEnabled"];
+ NSString *isAdServicesEnabled = call.arguments[@"isAdServicesEnabled"];
+ NSString *isIdfaReadingEnabled = call.arguments[@"isIdfaReadingEnabled"];
+ NSString *isIdfvReadingEnabled = call.arguments[@"isIdfvReadingEnabled"];
+ NSString *isSkanAttributionEnabled = call.arguments[@"isSkanAttributionEnabled"];
+ NSString *isDeviceIdsReadingOnceEnabled = call.arguments[@"isDeviceIdsReadingOnceEnabled"];
NSString *dartAttributionCallback = call.arguments[@"attributionCallback"];
NSString *dartSessionSuccessCallback = call.arguments[@"sessionSuccessCallback"];
NSString *dartSessionFailureCallback = call.arguments[@"sessionFailureCallback"];
NSString *dartEventSuccessCallback = call.arguments[@"eventSuccessCallback"];
NSString *dartEventFailureCallback = call.arguments[@"eventFailureCallback"];
NSString *dartDeferredDeeplinkCallback = call.arguments[@"deferredDeeplinkCallback"];
- NSString *dartConversionValueUpdatedCallback = call.arguments[@"conversionValueUpdatedCallback"];
- NSString *dartSkad4ConversionValueUpdatedCallback = call.arguments[@"skad4ConversionValueUpdatedCallback"];
+ NSString *dartSkanUpdatedCallback = call.arguments[@"skanUpdatedCallback"];
BOOL allowSuppressLogLevel = NO;
BOOL launchDeferredDeeplink = [call.arguments[@"launchDeferredDeeplink"] boolValue];
- // Suppress log level.
+ // suppress log level
if ([self isFieldValid:logLevel]) {
if ([ADJLogger logLevelFromString:[logLevel lowercaseString]] == ADJLogLevelSuppress) {
allowSuppressLogLevel = YES;
}
}
- // Create config object.
- ADJConfig *adjustConfig = [ADJConfig configWithAppToken:appToken
- environment:environment
- allowSuppressLogLevel:allowSuppressLogLevel];
-
- // SDK prefix.
+ // create config object
+ ADJConfig *adjustConfig = [[ADJConfig alloc] initWithAppToken:appToken
+ environment:environment
+ suppressLogLevel:allowSuppressLogLevel];
+ // SDK prefix
if ([self isFieldValid:sdkPrefix]) {
[adjustConfig setSdkPrefix:sdkPrefix];
}
- // Log level.
+ // log level
if ([self isFieldValid:logLevel]) {
[adjustConfig setLogLevel:[ADJLogger logLevelFromString:[logLevel lowercaseString]]];
}
- // Event buffering.
- if ([self isFieldValid:eventBufferingEnabled]) {
- [adjustConfig setEventBufferingEnabled:[eventBufferingEnabled boolValue]];
- }
-
- // COPPA compliance.
- if ([self isFieldValid:coppaCompliantEnabled]) {
- [adjustConfig setCoppaCompliantEnabled:[coppaCompliantEnabled boolValue]];
+ // LinkMe
+ if ([self isFieldValid:isLinkMeEnabled]) {
+ if ([isLinkMeEnabled boolValue] == YES) {
+ [adjustConfig enableLinkMe];
+ }
}
- // LinkMe.
- if ([self isFieldValid:linkMeEnabled]) {
- [adjustConfig setLinkMeEnabled:[linkMeEnabled boolValue]];
+ // COPPA compliance
+ if ([self isFieldValid:isCoppaComplianceEnabled]) {
+ if ([isCoppaComplianceEnabled boolValue] == YES) {
+ [adjustConfig enableCoppaCompliance];
+ }
}
- // Default tracker.
+ // default tracker
if ([self isFieldValid:defaultTracker]) {
[adjustConfig setDefaultTracker:defaultTracker];
}
- // External device ID.
+ // external device ID
if ([self isFieldValid:externalDeviceId]) {
[adjustConfig setExternalDeviceId:externalDeviceId];
}
- // User agent.
- if ([self isFieldValid:userAgent]) {
- [adjustConfig setUserAgent:userAgent];
- }
-
- // URL strategy.
- if ([self isFieldValid:urlStrategy]) {
- if ([urlStrategy isEqualToString:@"china"]) {
- [adjustConfig setUrlStrategy:ADJUrlStrategyChina];
- } else if ([urlStrategy isEqualToString:@"india"]) {
- [adjustConfig setUrlStrategy:ADJUrlStrategyIndia];
- } else if ([urlStrategy isEqualToString:@"cn"]) {
- [adjustConfig setUrlStrategy:ADJUrlStrategyCn];
- } else if ([urlStrategy isEqualToString:@"cn-only"]) {
- [adjustConfig setUrlStrategy:ADJUrlStrategyCnOnly];
- } else if ([urlStrategy isEqualToString:@"data-residency-eu"]) {
- [adjustConfig setUrlStrategy:ADJDataResidencyEU];
- } else if ([urlStrategy isEqualToString:@"data-residency-tr"]) {
- [adjustConfig setUrlStrategy:ADJDataResidencyTR];
- } else if ([urlStrategy isEqualToString:@"data-residency-us"]) {
- [adjustConfig setUrlStrategy:ADJDataResidencyUS];
- }
+ // URL strategy
+ if ([self isFieldValid:strUrlStrategyDomainsJson]) {
+ NSData *data = [strUrlStrategyDomainsJson dataUsingEncoding:NSUTF8StringEncoding];
+ NSArray *urlStrategyDomainsArray = [NSJSONSerialization JSONObjectWithData:data
+ options:NSJSONReadingMutableContainers
+ error:nil];
+ [adjustConfig setUrlStrategy:urlStrategyDomainsArray
+ useSubdomains:useSubdomains
+ isDataResidency:isDataResidency];
}
- // Background tracking.
- if ([self isFieldValid:sendInBackground]) {
- [adjustConfig setSendInBackground:[sendInBackground boolValue]];
+ // sending in background
+ if ([self isFieldValid:isSendingInBackgroundEnabled]) {
+ if ([isSendingInBackgroundEnabled boolValue] == YES) {
+ [adjustConfig enableSendingInBackground];
+ }
}
- // Cost data.
- if ([self isFieldValid:needsCost]) {
- [adjustConfig setNeedsCost:[needsCost boolValue]];
+ // event deduplication
+ if (eventDeduplicationIdsMaxSize > 0) {
+ [adjustConfig setEventDeduplicationIdsMaxSize:eventDeduplicationIdsMaxSize];
}
- // Allow AdServices info reading.
- if ([self isFieldValid:allowAdServicesInfoReading]) {
- [adjustConfig setAllowAdServicesInfoReading:[allowAdServicesInfoReading boolValue]];
+ // cost data in attribution callback
+ if ([self isFieldValid:isCostDataInAttributionEnabled]) {
+ if ([isCostDataInAttributionEnabled boolValue] == YES) {
+ [adjustConfig enableCostDataInAttribution];
+ }
}
- // Allow IDFA reading.
- if ([self isFieldValid:allowIdfaReading]) {
- [adjustConfig setAllowIdfaReading:[allowIdfaReading boolValue]];
- }
-
- // SKAdNetwork handling.
- if ([self isFieldValid:skAdNetworkHandling]) {
- if ([skAdNetworkHandling boolValue] == NO) {
- [adjustConfig deactivateSKAdNetworkHandling];
+ // AdServices.framework interaction
+ if ([self isFieldValid:isAdServicesEnabled]) {
+ if ([isAdServicesEnabled boolValue] == NO) {
+ [adjustConfig disableAdServices];
}
}
- // Read device info once.
- if ([self isFieldValid:readDeviceInfoOnceEnabled]) {
- [adjustConfig setReadDeviceInfoOnceEnabled:[readDeviceInfoOnceEnabled boolValue]];
+ // IDFA reading
+ if ([self isFieldValid:isIdfaReadingEnabled]) {
+ if ([isIdfaReadingEnabled boolValue] == NO) {
+ [adjustConfig disableIdfaReading];
+ }
}
- // Set device known.
- if ([self isFieldValid:isDeviceKnown]) {
- [adjustConfig setIsDeviceKnown:[isDeviceKnown boolValue]];
+ // IDFV reading
+ if ([self isFieldValid:isIdfvReadingEnabled]) {
+ if ([isIdfvReadingEnabled boolValue] == NO) {
+ [adjustConfig disableIdfvReading];
+ }
+ }
+
+ // SKAdNetwork attribution
+ if ([self isFieldValid:isSkanAttributionEnabled]) {
+ if ([isSkanAttributionEnabled boolValue] == NO) {
+ [adjustConfig disableSkanAttribution];
+ }
}
- // Delayed start.
- if ([self isFieldValid:delayStart]) {
- [adjustConfig setDelayStart:[delayStart doubleValue]];
+ // read device info once
+ if ([self isFieldValid:isDeviceIdsReadingOnceEnabled]) {
+ if ([isDeviceIdsReadingOnceEnabled boolValue] == YES) {
+ [adjustConfig enableDeviceIdsReadingOnce];
+ }
}
- // ATT consent delay.
+ // ATT consent delay
if ([self isFieldValid:attConsentWaitingInterval]) {
[adjustConfig setAttConsentWaitingInterval:[attConsentWaitingInterval intValue]];
}
-
- // App secret.
- if ([self isFieldValid:secretId]
- && [self isFieldValid:info1]
- && [self isFieldValid:info2]
- && [self isFieldValid:info3]
- && [self isFieldValid:info4]) {
- [adjustConfig setAppSecret:[[NSNumber numberWithLongLong:[secretId longLongValue]] unsignedIntegerValue]
- info1:[[NSNumber numberWithLongLong:[info1 longLongValue]] unsignedIntegerValue]
- info2:[[NSNumber numberWithLongLong:[info2 longLongValue]] unsignedIntegerValue]
- info3:[[NSNumber numberWithLongLong:[info3 longLongValue]] unsignedIntegerValue]
- info4:[[NSNumber numberWithLongLong:[info4 longLongValue]] unsignedIntegerValue]];
- }
-
- // Callbacks.
+
+ // callbacks
if (dartAttributionCallback != nil
|| dartSessionSuccessCallback != nil
|| dartSessionFailureCallback != nil
|| dartEventSuccessCallback != nil
|| dartEventFailureCallback != nil
|| dartDeferredDeeplinkCallback != nil
- || dartConversionValueUpdatedCallback != nil
- || dartSkad4ConversionValueUpdatedCallback != nil) {
+ || dartSkanUpdatedCallback != nil) {
[adjustConfig setDelegate:
[AdjustSdkDelegate getInstanceWithSwizzleOfAttributionCallback:dartAttributionCallback
sessionSuccessCallback:dartSessionSuccessCallback
@@ -324,15 +300,13 @@ - (void)start:(FlutterMethodCall *)call withResult:(FlutterResult)result {
eventSuccessCallback:dartEventSuccessCallback
eventFailureCallback:dartEventFailureCallback
deferredDeeplinkCallback:dartDeferredDeeplinkCallback
- conversionValueUpdatedCallback:dartConversionValueUpdatedCallback
- skad4ConversionValueUpdatedCallback:dartSkad4ConversionValueUpdatedCallback
+ skanUpdatedCallback:dartSkanUpdatedCallback
shouldLaunchDeferredDeeplink:launchDeferredDeeplink
- andMethodChannel:self.channel]];
+ methodChannel:self.channel]];
}
- // Start SDK.
- [Adjust appDidLaunch:adjustConfig];
- [Adjust trackSubsessionStart];
+ // start SDK
+ [Adjust initSdk:adjustConfig];
result(nil);
}
@@ -341,44 +315,42 @@ - (void)trackEvent:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *revenue = call.arguments[@"revenue"];
NSString *currency = call.arguments[@"currency"];
NSString *callbackId = call.arguments[@"callbackId"];
- NSString *receipt = call.arguments[@"receipt"];
NSString *productId = call.arguments[@"productId"];
NSString *transactionId = call.arguments[@"transactionId"];
+ NSString *deduplicationId = call.arguments[@"deduplicationId"];
NSString *strCallbackParametersJson = call.arguments[@"callbackParameters"];
NSString *strPartnerParametersJson = call.arguments[@"partnerParameters"];
- // Create event object.
- ADJEvent *adjustEvent = [ADJEvent eventWithEventToken:eventToken];
+ // create event object
+ ADJEvent *adjustEvent = [[ADJEvent alloc] initWithEventToken:eventToken];
- // Revenue.
+ // revenue and currency
if ([self isFieldValid:revenue]) {
double revenueValue = [revenue doubleValue];
[adjustEvent setRevenue:revenueValue currency:currency];
}
- // Receipt.
- if ([self isFieldValid:receipt]) {
- NSData *receiptValue;
- receiptValue = [receipt dataUsingEncoding:NSUTF8StringEncoding];
- [adjustEvent setReceipt:receiptValue];
- }
-
- // Product ID.
+ // rroduct ID
if ([self isFieldValid:productId]) {
[adjustEvent setProductId:productId];
}
- // Transaction ID.
+ // transaction ID
if ([self isFieldValid:transactionId]) {
[adjustEvent setTransactionId:transactionId];
}
- // Callback ID.
+ // deduplication ID
+ if ([self isFieldValid:deduplicationId]) {
+ [adjustEvent setDeduplicationId:deduplicationId];
+ }
+
+ // callback ID
if ([self isFieldValid:callbackId]) {
[adjustEvent setCallbackId:callbackId];
}
- // Callback parameters.
+ // callback parameters
if (strCallbackParametersJson != nil) {
NSData *callbackParametersData = [strCallbackParametersJson dataUsingEncoding:NSUTF8StringEncoding];
id callbackParametersJson = [NSJSONSerialization JSONObjectWithData:callbackParametersData
@@ -390,7 +362,7 @@ - (void)trackEvent:(FlutterMethodCall *)call withResult:(FlutterResult)result {
}
}
- // Partner parameters.
+ // partner parameters
if (strPartnerParametersJson != nil) {
NSData *partnerParametersData = [strPartnerParametersJson dataUsingEncoding:NSUTF8StringEncoding];
id partnerParametersJson = [NSJSONSerialization JSONObjectWithData:partnerParametersData
@@ -402,21 +374,18 @@ - (void)trackEvent:(FlutterMethodCall *)call withResult:(FlutterResult)result {
}
}
- // Track event.
+ // track event
[Adjust trackEvent:adjustEvent];
result(nil);
}
-- (void)setEnabled:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *isEnabled = call.arguments[@"isEnabled"];
- if ([self isFieldValid:isEnabled]) {
- [Adjust setEnabled:[isEnabled boolValue]];
- }
+- (void)enable:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ [Adjust enable];
result(nil);
}
-- (void)sendFirstPackages:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- [Adjust sendFirstPackages];
+- (void)disable:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ [Adjust disable];
result(nil);
}
@@ -425,29 +394,26 @@ - (void)gdprForgetMe:(FlutterMethodCall *)call withResult:(FlutterResult)result
result(nil);
}
-- (void)disableThirdPartySharing:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- [Adjust disableThirdPartySharing];
+- (void)switchToOfflineMode:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ [Adjust switchToOfflineMode];
result(nil);
}
-- (void)setOfflineMode:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *isOffline = call.arguments[@"isOffline"];
- if ([self isFieldValid:isOffline]) {
- [Adjust setOfflineMode:[isOffline boolValue]];
- }
+- (void)switchBackToOnlineMode:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ [Adjust switchBackToOnlineMode];
result(nil);
}
- (void)setPushToken:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *pushToken = call.arguments[@"pushToken"];
if ([self isFieldValid:pushToken]) {
- [Adjust setPushToken:pushToken];
+ [Adjust setPushTokenAsString:pushToken];
}
result(nil);
}
-- (void)appWillOpenUrl:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *urlString = call.arguments[@"url"];
+- (void)processDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ NSString *urlString = call.arguments[@"deeplink"];
if (urlString == nil) {
return;
}
@@ -461,20 +427,13 @@ - (void)appWillOpenUrl:(FlutterMethodCall *)call withResult:(FlutterResult)resul
url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
#pragma clang diagnostic pop
- [Adjust appWillOpenUrl:url];
-}
-- (void)trackAdRevenue:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *source = call.arguments[@"source"];
- NSString *payload = call.arguments[@"payload"];
- if (!([self isFieldValid:source]) || !([self isFieldValid:payload])) {
- return;
- }
- NSData *dataPayload = [payload dataUsingEncoding:NSUTF8StringEncoding];
- [Adjust trackAdRevenue:source payload:dataPayload];
+ ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:url];
+ [Adjust processDeeplink:deeplink];
}
-- (void)trackAdRevenueNew:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+
+- (void)trackAdRevenue:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *source = call.arguments[@"source"];
NSString *revenue = call.arguments[@"revenue"];
NSString *currency = call.arguments[@"currency"];
@@ -485,37 +444,37 @@ - (void)trackAdRevenueNew:(FlutterMethodCall *)call withResult:(FlutterResult)re
NSString *strCallbackParametersJson = call.arguments[@"callbackParameters"];
NSString *strPartnerParametersJson = call.arguments[@"partnerParameters"];
- // Create ad revenue object.
+ // create ad revenue object
ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:source];
- // Revenue.
+ // revenue
if ([self isFieldValid:revenue]) {
double revenueValue = [revenue doubleValue];
[adjustAdRevenue setRevenue:revenueValue currency:currency];
}
- // Ad impressions count.
+ // ad impressions count
if ([self isFieldValid:adImpressionsCount]) {
int adImpressionsCountValue = [adImpressionsCount intValue];
[adjustAdRevenue setAdImpressionsCount:adImpressionsCountValue];
}
- // Ad revenue network.
+ // ad revenue network
if ([self isFieldValid:adRevenueNetwork]) {
[adjustAdRevenue setAdRevenueNetwork:adRevenueNetwork];
}
- // Ad revenue unit.
+ // ad revenue unit
if ([self isFieldValid:adRevenueUnit]) {
[adjustAdRevenue setAdRevenueUnit:adRevenueUnit];
}
- // Ad revenue placement.
+ // ad revenue placement
if ([self isFieldValid:adRevenuePlacement]) {
[adjustAdRevenue setAdRevenuePlacement:adRevenuePlacement];
}
- // Callback parameters.
+ // callback parameters
if (strCallbackParametersJson != nil) {
NSData *callbackParametersData = [strCallbackParametersJson dataUsingEncoding:NSUTF8StringEncoding];
id callbackParametersJson = [NSJSONSerialization JSONObjectWithData:callbackParametersData
@@ -527,7 +486,7 @@ - (void)trackAdRevenueNew:(FlutterMethodCall *)call withResult:(FlutterResult)re
}
}
- // Partner parameters.
+ // partner parameters
if (strPartnerParametersJson != nil) {
NSData *partnerParametersData = [strPartnerParametersJson dataUsingEncoding:NSUTF8StringEncoding];
id partnerParametersJson = [NSJSONSerialization JSONObjectWithData:partnerParametersData
@@ -539,59 +498,46 @@ - (void)trackAdRevenueNew:(FlutterMethodCall *)call withResult:(FlutterResult)re
}
}
- // Track ad revenue.
+ // track ad revenue
[Adjust trackAdRevenue:adjustAdRevenue];
result(nil);
}
-- (void)trackPlayStoreSubscription:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- result([FlutterError errorWithCode:@"non_existing_method"
- message:@"trackPlayStoreSubscription not available for iOS platform"
- details:nil]);
-}
-
- (void)trackAppStoreSubscription:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *price = call.arguments[@"price"];
NSString *currency = call.arguments[@"currency"];
NSString *transactionId = call.arguments[@"transactionId"];
- NSString *receipt = call.arguments[@"receipt"];
NSString *transactionDate = call.arguments[@"transactionDate"];
NSString *salesRegion = call.arguments[@"salesRegion"];
// NSString *billingStore = call.arguments[@"billingStore"];
NSString *strCallbackParametersJson = call.arguments[@"callbackParameters"];
NSString *strPartnerParametersJson = call.arguments[@"partnerParameters"];
- // Price.
+ // price
NSDecimalNumber *priceValue;
if ([self isFieldValid:price]) {
priceValue = [NSDecimalNumber decimalNumberWithString:price];
}
- // Receipt.
- NSData *receiptValue;
- if ([self isFieldValid:receipt]) {
- receiptValue = [receipt dataUsingEncoding:NSUTF8StringEncoding];
- }
-
- // Create subscription object.
- ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:priceValue
- currency:currency
- transactionId:transactionId
- andReceipt:receiptValue];
+ // create subscription object
+ ADJAppStoreSubscription *subscription =
+ [[ADJAppStoreSubscription alloc] initWithPrice:priceValue
+ currency:currency
+ transactionId:transactionId];
- // Transaction date.
+ // transaction date
if ([self isFieldValid:transactionDate]) {
NSTimeInterval transactionDateInterval = [transactionDate doubleValue];
NSDate *oTransactionDate = [NSDate dateWithTimeIntervalSince1970:transactionDateInterval];
[subscription setTransactionDate:oTransactionDate];
}
- // Sales region.
+ // sales region
if ([self isFieldValid:salesRegion]) {
[subscription setSalesRegion:salesRegion];
}
- // Callback parameters.
+ // callback parameters
if (strCallbackParametersJson != nil) {
NSData *callbackParametersData = [strCallbackParametersJson dataUsingEncoding:NSUTF8StringEncoding];
id callbackParametersJson = [NSJSONSerialization JSONObjectWithData:callbackParametersData
@@ -603,7 +549,7 @@ - (void)trackAppStoreSubscription:(FlutterMethodCall *)call withResult:(FlutterR
}
}
- // Partner parameters.
+ // partner parameters
if (strPartnerParametersJson != nil) {
NSData *partnerParametersData = [strPartnerParametersJson dataUsingEncoding:NSUTF8StringEncoding];
id partnerParametersJson = [NSJSONSerialization JSONObjectWithData:partnerParametersData
@@ -615,55 +561,52 @@ - (void)trackAppStoreSubscription:(FlutterMethodCall *)call withResult:(FlutterR
}
}
- // Track subscription.
- [Adjust trackSubscription:subscription];
+ // track subscription
+ [Adjust trackAppStoreSubscription:subscription];
result(nil);
}
- (void)getAttribution:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- ADJAttribution *attribution = [Adjust attribution];
- NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
- if (attribution == nil) {
+ [Adjust attributionWithCompletionHandler:^(ADJAttribution * _Nullable attribution) {
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ if (attribution == nil) {
+ result(dictionary);
+ }
+
+ [self addValueOrEmpty:attribution.trackerToken withKey:@"trackerToken" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.trackerName withKey:@"trackerName" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.network withKey:@"network" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.campaign withKey:@"campaign" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.creative withKey:@"creative" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.adgroup withKey:@"adgroup" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.clickLabel withKey:@"clickLabel" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.costType withKey:@"costType" toDictionary:dictionary];
+ [self addNumberOrEmpty:attribution.costAmount withKey:@"costAmount" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.costCurrency withKey:@"costCurrency" toDictionary:dictionary];
result(dictionary);
- }
-
- [self addValueOrEmpty:attribution.trackerToken withKey:@"trackerToken" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.trackerName withKey:@"trackerName" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.network withKey:@"network" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.campaign withKey:@"campaign" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.creative withKey:@"creative" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.adgroup withKey:@"adgroup" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.clickLabel withKey:@"clickLabel" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.adid withKey:@"adid" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.costType withKey:@"costType" toDictionary:dictionary];
- [self addNumberOrEmpty:attribution.costAmount withKey:@"costAmount" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.costCurrency withKey:@"costCurrency" toDictionary:dictionary];
- result(dictionary);
+ }];
}
- (void)getIdfa:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *idfa = [Adjust idfa];
- result(idfa);
+ [Adjust idfaWithCompletionHandler:^(NSString * _Nullable idfa) {
+ result(idfa);
+ }];
}
- (void)getIdfv:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *idfv = [Adjust idfv];
- result(idfv);
-}
-
-- (void)getGoogleAdId:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- result([FlutterError errorWithCode:@"non_existing_method"
- message:@"getGoogleAdId not available for iOS platform"
- details:nil]);
+ [Adjust idfvWithCompletionHandler:^(NSString * _Nullable idfv) {
+ result(idfv);
+ }];
}
- (void)getSdkVersion:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *sdkVersion = [Adjust sdkVersion];
- result(sdkVersion);
+ [Adjust sdkVersionWithCompletionHandler:^(NSString * _Nullable sdkVersion) {
+ result(sdkVersion);
+ }];
}
-- (void)requestTrackingAuthorizationWithCompletionHandler:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- [Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
+- (void)requestAppTrackingAuthorization:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ [Adjust requestAppTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
result([NSNumber numberWithUnsignedLong:status]);
}];
}
@@ -672,24 +615,16 @@ - (void)getAppTrackingAuthorizationStatus:(FlutterMethodCall *)call withResult:(
result([NSNumber numberWithInt:[Adjust appTrackingAuthorizationStatus]]);
}
-- (void)updateConversionValue:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *conversionValue = call.arguments[@"conversionValue"];
- if ([self isFieldValid:conversionValue]) {
- [Adjust updateConversionValue:[conversionValue intValue]];
- }
- result(nil);
-}
-
- (void)trackThirdPartySharing:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSNumber *isEnabled = call.arguments[@"isEnabled"];
NSString *strGranularOptions = call.arguments[@"granularOptions"];
NSString *strPartnerSharingSettings = call.arguments[@"partnerSharingSettings"];
- // Create third party sharing object.
+ // create third party sharing object
ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc]
- initWithIsEnabledNumberBool:[self isFieldValid:isEnabled] ? isEnabled : nil];
+ initWithIsEnabled:[self isFieldValid:isEnabled] ? isEnabled : nil];
- // Granular options.
+ // granular options
if (strGranularOptions != nil) {
NSArray *arrayGranularOptions = [strGranularOptions componentsSeparatedByString:@"__ADJ__"];
if (arrayGranularOptions != nil) {
@@ -701,7 +636,7 @@ - (void)trackThirdPartySharing:(FlutterMethodCall *)call withResult:(FlutterResu
}
}
- // Partner sharing settings.
+ // partner sharing settings
if (strPartnerSharingSettings != nil) {
NSArray *arrayPartnerSharingSettings = [strPartnerSharingSettings componentsSeparatedByString:@"__ADJ__"];
if (arrayPartnerSharingSettings != nil) {
@@ -713,7 +648,7 @@ - (void)trackThirdPartySharing:(FlutterMethodCall *)call withResult:(FlutterResu
}
}
- // Track third party sharing.
+ // track third party sharing
[Adjust trackThirdPartySharing:adjustThirdPartySharing];
result(nil);
}
@@ -726,66 +661,28 @@ - (void)trackMeasurementConsent:(FlutterMethodCall *)call withResult:(FlutterRes
result(nil);
}
-- (void)getLastDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSURL *lastDeeplink = [Adjust lastDeeplink];
- if (![self isFieldValid:lastDeeplink]) {
- result(nil);
- } else {
- result([lastDeeplink absoluteString]);
- }
-}
-
-- (void)updateConversionValueWithErrorCallback:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *conversionValue = call.arguments[@"conversionValue"];
- if ([self isFieldValid:conversionValue]) {
- [Adjust updatePostbackConversionValue:[conversionValue intValue]
- completionHandler:^(NSError * _Nullable error) {
- result([error localizedDescription]);
- }];
- }
-}
-
-- (void)updateConversionValueWithErrorCallbackSkad4:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *conversionValue = call.arguments[@"conversionValue"];
+- (void)updateSkanConversionValue:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ NSInteger conversionValue = [call.arguments[@"conversionValue"] integerValue];
NSString *coarseValue = call.arguments[@"coarseValue"];
- NSString *lockWindow = call.arguments[@"lockWindow"];
- if ([self isFieldValid:conversionValue] &&
- [self isFieldValid:coarseValue] &&
- [self isFieldValid:lockWindow]) {
- [Adjust updatePostbackConversionValue:[conversionValue intValue]
- coarseValue:coarseValue
- lockWindow:(BOOL)lockWindow
- completionHandler:^(NSError * _Nullable error) {
- result([error localizedDescription]);
- }];
- }
-}
-
-- (void)verifyPlayStorePurchase:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- result([FlutterError errorWithCode:@"non_existing_method"
- message:@"verifyPlayStorePurchase not available for iOS platform"
- details:nil]);
+ NSNumber *lockWindow = call.arguments[@"lockWindow"];
+ [Adjust updateSkanConversionValue:conversionValue
+ coarseValue:coarseValue
+ lockWindow:lockWindow
+ withCompletionHandler:^(NSError * _Nullable error) {
+ result(error.description);
+ }];
}
- (void)verifyAppStorePurchase:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- NSString *receipt = call.arguments[@"receipt"];
NSString *productId = call.arguments[@"productId"];
NSString *transactionId = call.arguments[@"transactionId"];
- // Receipt.
- NSData *receiptValue;
- if ([self isFieldValid:receipt]) {
- receiptValue = [receipt dataUsingEncoding:NSUTF8StringEncoding];
- }
-
- // Create purchase instance.
- ADJPurchase *purchase = [[ADJPurchase alloc] initWithTransactionId:transactionId
- productId:productId
- andReceipt:receiptValue];
+ // create purchase instance
+ ADJAppStorePurchase *purchase = [[ADJAppStorePurchase alloc] initWithTransactionId:transactionId
+ productId:productId];
- // Verify purchase.
- [Adjust verifyPurchase:purchase
- completionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
+ // verify purchase
+ [Adjust verifyAppStorePurchase:purchase withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
if (verificationResult == nil) {
result(dictionary);
@@ -804,7 +701,7 @@ - (void)verifyAppStorePurchase:(FlutterMethodCall *)call withResult:(FlutterResu
}];
}
-- (void)processDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+- (void)processAndResolveDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSString *deeplink = call.arguments[@"deeplink"];
if ([self isFieldValid:deeplink]) {
NSURL *nsUrl;
@@ -817,7 +714,9 @@ - (void)processDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)resu
}
#pragma clang diagnostic pop
- [Adjust processDeeplink:nsUrl completionHandler:^(NSString * _Nonnull resolvedLink) {
+ ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:nsUrl];
+ [Adjust processAndResolveDeeplink:deeplink
+ withCompletionHandler:^(NSString * _Nullable resolvedLink) {
if (![self isFieldValid:resolvedLink]) {
result(nil);
} else {
@@ -827,75 +726,187 @@ - (void)processDeeplink:(FlutterMethodCall *)call withResult:(FlutterResult)resu
}
}
+- (void)verifyAndTrackAppStorePurchase:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ NSString *eventToken = call.arguments[@"eventToken"];
+ NSString *revenue = call.arguments[@"revenue"];
+ NSString *currency = call.arguments[@"currency"];
+ NSString *callbackId = call.arguments[@"callbackId"];
+ NSString *productId = call.arguments[@"productId"];
+ NSString *transactionId = call.arguments[@"transactionId"];
+ NSString *deduplicationId = call.arguments[@"deduplicationId"];
+ NSString *strCallbackParametersJson = call.arguments[@"callbackParameters"];
+ NSString *strPartnerParametersJson = call.arguments[@"partnerParameters"];
+
+ // create event object
+ ADJEvent *adjustEvent = [[ADJEvent alloc] initWithEventToken:eventToken];
+
+ // revenue
+ if ([self isFieldValid:revenue]) {
+ double revenueValue = [revenue doubleValue];
+ [adjustEvent setRevenue:revenueValue currency:currency];
+ }
+
+ // product ID
+ if ([self isFieldValid:productId]) {
+ [adjustEvent setProductId:productId];
+ }
+
+ // transaction ID
+ if ([self isFieldValid:transactionId]) {
+ [adjustEvent setTransactionId:transactionId];
+ }
+
+ // deduplication ID
+ if ([self isFieldValid:deduplicationId]) {
+ [adjustEvent setDeduplicationId:deduplicationId];
+ }
+
+ // callback ID
+ if ([self isFieldValid:callbackId]) {
+ [adjustEvent setCallbackId:callbackId];
+ }
+
+ // callback parameters
+ if (strCallbackParametersJson != nil) {
+ NSData *callbackParametersData = [strCallbackParametersJson dataUsingEncoding:NSUTF8StringEncoding];
+ id callbackParametersJson = [NSJSONSerialization JSONObjectWithData:callbackParametersData
+ options:0
+ error:NULL];
+ for (id key in callbackParametersJson) {
+ NSString *value = [callbackParametersJson objectForKey:key];
+ [adjustEvent addCallbackParameter:key value:value];
+ }
+ }
+
+ // partner parameters
+ if (strPartnerParametersJson != nil) {
+ NSData *partnerParametersData = [strPartnerParametersJson dataUsingEncoding:NSUTF8StringEncoding];
+ id partnerParametersJson = [NSJSONSerialization JSONObjectWithData:partnerParametersData
+ options:0
+ error:NULL];
+ for (id key in partnerParametersJson) {
+ NSString *value = [partnerParametersJson objectForKey:key];
+ [adjustEvent addPartnerParameter:key value:value];
+ }
+ }
+
+ // verify and track app store purchase
+ [Adjust verifyAndTrackAppStorePurchase:adjustEvent
+ withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ if (verificationResult == nil) {
+ result(dictionary);
+ }
+
+ [self addValueOrEmpty:verificationResult.verificationStatus
+ withKey:@"verificationStatus"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:[NSString stringWithFormat:@"%d", verificationResult.code]
+ withKey:@"code"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:verificationResult.message
+ withKey:@"message"
+ toDictionary:dictionary];
+ result(dictionary);
+ }];
+}
+
+#pragma mark - Testing only methods
+
- (void)setTestOptions:(FlutterMethodCall *)call withResult:(FlutterResult)result {
- AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
- NSString *overwriteUrl = call.arguments[@"urlOverwrite"];
- NSString *extraPath = call.arguments[@"extraPath"];
- NSString *timerIntervalInMilliseconds = call.arguments[@"timerIntervalInMilliseconds"];
- NSString *timerStartInMilliseconds = call.arguments[@"timerStartInMilliseconds"];
- NSString *sessionIntervalInMilliseconds = call.arguments[@"sessionIntervalInMilliseconds"];
- NSString *subsessionIntervalInMilliseconds = call.arguments[@"subsessionIntervalInMilliseconds"];
- NSString *teardown = call.arguments[@"teardown"];
- NSString *deleteState = call.arguments[@"deleteState"];
- NSString *noBackoffWait = call.arguments[@"noBackoffWait"];
- NSString *adServicesFrameworkEnabled = call.arguments[@"adServicesFrameworkEnabled"];
- NSString *attStatus = call.arguments[@"attStatus"];
- NSString *idfa = call.arguments[@"idfa"];
-
- if ([self isFieldValid:overwriteUrl]) {
- testOptions.urlOverwrite = overwriteUrl;
+ NSMutableDictionary *testOptions = [[NSMutableDictionary alloc] init];
+
+ if (call.arguments[@"urlOverwrite"] != nil) {
+ [testOptions setObject:call.arguments[@"urlOverwrite"] forKey:@"testUrlOverwrite"];
+ }
+ if (call.arguments[@"extraPath"] != nil) {
+ [testOptions setObject:call.arguments[@"extraPath"] forKey:@"extraPath"];
}
- if ([self isFieldValid:extraPath]) {
- testOptions.extraPath = extraPath;
+ if (call.arguments[@"basePath"] != nil) {
+ [testOptions setObject:call.arguments[@"basePath"] forKey:@"basePath"];
}
- if ([self isFieldValid:timerIntervalInMilliseconds]) {
- testOptions.timerIntervalInMilliseconds = [NSNumber numberWithLongLong:[timerIntervalInMilliseconds longLongValue]];
+ if (call.arguments[@"timerIntervalInMilliseconds"] != nil) {
+ [testOptions setObject:call.arguments[@"timerIntervalInMilliseconds"] forKey:@"timerIntervalInMilliseconds"];
}
- if ([self isFieldValid:timerStartInMilliseconds]) {
- testOptions.timerStartInMilliseconds = [NSNumber numberWithLongLong:[timerStartInMilliseconds longLongValue]];
+ if (call.arguments[@"timerStartInMilliseconds"] != nil) {
+ [testOptions setObject:call.arguments[@"timerStartInMilliseconds"] forKey:@"timerStartInMilliseconds"];
}
- if ([self isFieldValid:sessionIntervalInMilliseconds]) {
- testOptions.sessionIntervalInMilliseconds = [NSNumber numberWithLongLong:[sessionIntervalInMilliseconds longLongValue]];
+ if (call.arguments[@"sessionIntervalInMilliseconds"] != nil) {
+ [testOptions setObject:call.arguments[@"sessionIntervalInMilliseconds"] forKey:@"sessionIntervalInMilliseconds"];
}
- if ([self isFieldValid:subsessionIntervalInMilliseconds]) {
- testOptions.subsessionIntervalInMilliseconds = [NSNumber numberWithLongLong:[subsessionIntervalInMilliseconds longLongValue]];
+ if (call.arguments[@"subsessionIntervalInMilliseconds"] != nil) {
+ [testOptions setObject:call.arguments[@"subsessionIntervalInMilliseconds"] forKey:@"subsessionIntervalInMilliseconds"];
}
- if ([self isFieldValid:teardown]) {
- testOptions.teardown = [teardown boolValue];
- if (testOptions.teardown) {
+ if (call.arguments[@"teardown"] != nil) {
+ [testOptions setObject:call.arguments[@"teardown"] forKey:@"teardown"];
+ if ([testOptions[@"teardown"] isEqualToString:@"true"] == YES) {
[AdjustSdkDelegate teardown];
}
}
- if ([self isFieldValid:deleteState]) {
- testOptions.deleteState = [deleteState boolValue];
+ if (call.arguments[@"resetSdk"] != nil) {
+ [testOptions setObject:call.arguments[@"resetSdk"] forKey:@"resetSdk"];
}
- if ([self isFieldValid:noBackoffWait]) {
- testOptions.noBackoffWait = [noBackoffWait boolValue];
+ if (call.arguments[@"deleteState"] != nil) {
+ [testOptions setObject:call.arguments[@"deleteState"] forKey:@"deleteState"];
}
- if ([self isFieldValid:adServicesFrameworkEnabled]) {
- testOptions.adServicesFrameworkEnabled = [adServicesFrameworkEnabled boolValue];
+ if (call.arguments[@"resetTest"] != nil) {
+ [testOptions setObject:call.arguments[@"resetTest"] forKey:@"resetTest"];
}
- if ([self isFieldValid:attStatus]) {
- testOptions.attStatusInt = [NSNumber numberWithInt:[attStatus intValue]];
+ if (call.arguments[@"noBackoffWait"] != nil) {
+ [testOptions setObject:call.arguments[@"noBackoffWait"] forKey:@"noBackoffWait"];
}
- if ([self isFieldValid:idfa]) {
- testOptions.idfa = idfa;
+ if (call.arguments[@"adServicesFrameworkEnabled"] != nil) {
+ [testOptions setObject:call.arguments[@"adServicesFrameworkEnabled"] forKey:@"adServicesFrameworkEnabled"];
}
-
+ if (call.arguments[@"attStatus"] != nil) {
+ [testOptions setObject:call.arguments[@"attStatus"] forKey:@"attStatusInt"];
+ }
+ if (call.arguments[@"idfa"] != nil) {
+ [testOptions setObject:call.arguments[@"idfa"] forKey:@"idfa"];
+ }
+
[Adjust setTestOptions:testOptions];
}
+#pragma mark - Android only methods
+
+- (void)getGoogleAdId:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ result([FlutterError errorWithCode:@"non_existing_method"
+ message:@"getGoogleAdId not available on iOS platform!"
+ details:nil]);
+}
+
+- (void)trackPlayStoreSubscription:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ result([FlutterError errorWithCode:@"non_existing_method"
+ message:@"trackPlayStoreSubscription not available on iOS platform!"
+ details:nil]);
+}
+
+- (void)verifyPlayStorePurchase:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ result([FlutterError errorWithCode:@"non_existing_method"
+ message:@"verifyPlayStorePurchase not available on iOS platform!"
+ details:nil]);
+}
+
+- (void)verifyAndTrackPlayStorePurchase:(FlutterMethodCall *)call withResult:(FlutterResult)result {
+ result([FlutterError errorWithCode:@"non_existing_method"
+ message:@"verifyAndTrackPlayStorePurchase not available on iOS platform!"
+ details:nil]);
+}
+
+#pragma mark - Utility & helper methods
+
- (BOOL)isFieldValid:(NSObject *)field {
if (field == nil) {
return NO;
}
- // Check if its an instance of the singleton NSNull.
+ // check if its an instance of the singleton NSNull
if ([field isKindOfClass:[NSNull class]]) {
return NO;
}
- // If field can be converted to a string, check if it has any content.
+ // if field can be converted to a string, check if it has any content
NSString *str = [NSString stringWithFormat:@"%@", field];
if (str != nil) {
if ([str length] == 0) {
diff --git a/ios/Classes/AdjustSdkDelegate.h b/ios/Classes/AdjustSdkDelegate.h
index deee0cc..77d79c4 100644
--- a/ios/Classes/AdjustSdkDelegate.h
+++ b/ios/Classes/AdjustSdkDelegate.h
@@ -7,7 +7,7 @@
//
#import
-#import
+#import
@interface AdjustSdkDelegate : NSObject
@@ -20,10 +20,9 @@
eventSuccessCallback:(NSString *)swizzleEventSuccessCallback
eventFailureCallback:(NSString *)swizzleEventFailureCallback
deferredDeeplinkCallback:(NSString *)swizzleDeferredDeeplinkCallback
- conversionValueUpdatedCallback:(NSString *)swizzleConversionValueUpdatedCallback
- skad4ConversionValueUpdatedCallback:(NSString *)swizzleSkad4ConversionValueUpdatedCallback
+ skanUpdatedCallback:(NSString *)swizzleSkanUpdatedCallback
shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
- andMethodChannel:(FlutterMethodChannel *)channel;
+ methodChannel:(FlutterMethodChannel *)channel;
+ (void)teardown;
diff --git a/ios/Classes/AdjustSdkDelegate.m b/ios/Classes/AdjustSdkDelegate.m
index 4672818..eea2676 100644
--- a/ios/Classes/AdjustSdkDelegate.m
+++ b/ios/Classes/AdjustSdkDelegate.m
@@ -11,14 +11,13 @@
static dispatch_once_t onceToken;
static AdjustSdkDelegate *defaultInstance = nil;
-static NSString *dartAttributionCallback;
-static NSString *dartSessionSuccessCallback;
-static NSString *dartSessionFailureCallback;
-static NSString *dartEventSuccessCallback;
-static NSString *dartEventFailureCallback;
-static NSString *dartDeferredDeeplinkCallback;
-static NSString *dartConversionValueUpdatedCallback;
-static NSString *dartSkad4ConversionValueUpdatedCallback;
+static NSString *dartAttributionCallback = nil;
+static NSString *dartSessionSuccessCallback = nil;
+static NSString *dartSessionFailureCallback = nil;
+static NSString *dartEventSuccessCallback = nil;
+static NSString *dartEventFailureCallback = nil;
+static NSString *dartDeferredDeeplinkCallback = nil;
+static NSString *dartSkanUpdatedCallback = nil;
@implementation AdjustSdkDelegate
@@ -40,15 +39,13 @@ + (id)getInstanceWithSwizzleOfAttributionCallback:(NSString *)swizzleAttribution
eventSuccessCallback:(NSString *)swizzleEventSuccessCallback
eventFailureCallback:(NSString *)swizzleEventFailureCallback
deferredDeeplinkCallback:(NSString *)swizzleDeferredDeeplinkCallback
- conversionValueUpdatedCallback:(NSString *)swizzleConversionValueUpdatedCallback
- skad4ConversionValueUpdatedCallback:(NSString *)swizzleSkad4ConversionValueUpdatedCallback
+ skanUpdatedCallback:(NSString *)swizzleSkanUpdatedCallback
shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
- andMethodChannel:(FlutterMethodChannel *)channel {
-
+ methodChannel:(FlutterMethodChannel *)channel {
dispatch_once(&onceToken, ^{
defaultInstance = [[AdjustSdkDelegate alloc] init];
- // Do the swizzling where and if needed.
+ // do the swizzling where and if needed
if (swizzleAttributionCallback != nil) {
[defaultInstance swizzleCallbackMethod:@selector(adjustAttributionChanged:)
swizzledSelector:@selector(adjustAttributionChangedWannabe:)];
@@ -75,19 +72,14 @@ + (id)getInstanceWithSwizzleOfAttributionCallback:(NSString *)swizzleAttribution
dartEventFailureCallback = swizzleEventFailureCallback;
}
if (swizzleDeferredDeeplinkCallback != nil) {
- [defaultInstance swizzleCallbackMethod:@selector(adjustDeeplinkResponse:)
- swizzledSelector:@selector(adjustDeeplinkResponseWannabe:)];
+ [defaultInstance swizzleCallbackMethod:@selector(adjustDeferredDeeplinkReceived:)
+ swizzledSelector:@selector(adjustDeferredDeeplinkReceivedWannabe:)];
dartDeferredDeeplinkCallback = swizzleDeferredDeeplinkCallback;
}
- if (swizzleConversionValueUpdatedCallback != nil) {
- [defaultInstance swizzleCallbackMethod:@selector(adjustConversionValueUpdated:)
- swizzledSelector:@selector(adjustConversionValueUpdatedWannabe:)];
- dartConversionValueUpdatedCallback = swizzleConversionValueUpdatedCallback;
- }
- if (swizzleSkad4ConversionValueUpdatedCallback != nil) {
- [defaultInstance swizzleCallbackMethod:@selector(adjustConversionValueUpdated:coarseValue:lockWindow:)
- swizzledSelector:@selector(adjustConversionValueUpdatedWannabe:coarseValue:lockWindow:)];
- dartSkad4ConversionValueUpdatedCallback = swizzleSkad4ConversionValueUpdatedCallback;
+ if (swizzleSkanUpdatedCallback != nil) {
+ [defaultInstance swizzleCallbackMethod:@selector(adjustSkanUpdatedWithConversionData:)
+ swizzledSelector:@selector(adjustSkanUpdatedWithConversionDataWannabe:)];
+ dartSkanUpdatedCallback = swizzleSkanUpdatedCallback;
}
[defaultInstance setShouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink];
@@ -100,12 +92,19 @@ + (id)getInstanceWithSwizzleOfAttributionCallback:(NSString *)swizzleAttribution
+ (void)teardown {
defaultInstance = nil;
onceToken = 0;
+ dartAttributionCallback = nil;
+ dartSessionSuccessCallback = nil;
+ dartSessionFailureCallback = nil;
+ dartEventSuccessCallback = nil;
+ dartEventFailureCallback = nil;
+ dartDeferredDeeplinkCallback = nil;
+ dartSkanUpdatedCallback = nil;
}
#pragma mark - Private & helper methods
- (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
- if (attribution == nil) {
+ if (nil == attribution || nil == dartAttributionCallback) {
return;
}
@@ -117,10 +116,10 @@ - (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
@"adgroup",
@"creative",
@"clickLabel",
- @"adid",
@"costType",
@"costAmount",
- @"costCurrency" };
+ @"costCurrency"
+ };
id values[] = {
[self getValueOrEmpty:[attribution trackerToken]],
[self getValueOrEmpty:[attribution trackerName]],
@@ -129,7 +128,6 @@ - (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
[self getValueOrEmpty:[attribution adgroup]],
[self getValueOrEmpty:[attribution creative]],
[self getValueOrEmpty:[attribution clickLabel]],
- [self getValueOrEmpty:[attribution adid]],
[self getValueOrEmpty:[attribution costType]],
[self getNumberValueOrEmpty:[attribution costAmount]],
[self getValueOrEmpty:[attribution costCurrency]]
@@ -142,14 +140,19 @@ - (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
}
- (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSuccessResponseData {
- if (nil == sessionSuccessResponseData) {
+ if (nil == sessionSuccessResponseData || nil == dartSessionSuccessCallback) {
return;
}
- id keys[] = { @"message", @"timestamp", @"adid", @"jsonResponse" };
+ id keys[] = {
+ @"message",
+ @"timestamp",
+ @"adid",
+ @"jsonResponse"
+ };
id values[] = {
[self getValueOrEmpty:[sessionSuccessResponseData message]],
- [self getValueOrEmpty:[sessionSuccessResponseData timeStamp]],
+ [self getValueOrEmpty:[sessionSuccessResponseData timestamp]],
[self getValueOrEmpty:[sessionSuccessResponseData adid]],
[self toJson:[self getObjectValueOrEmpty:[sessionSuccessResponseData jsonResponse]]]
};
@@ -161,15 +164,21 @@ - (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSucces
}
- (void)adjustSessionTrackingFailedWananbe:(ADJSessionFailure *)sessionFailureResponseData {
- if (nil == sessionFailureResponseData) {
+ if (nil == sessionFailureResponseData || nil == dartSessionFailureCallback) {
return;
}
NSString *willRetryString = [sessionFailureResponseData willRetry] ? @"true" : @"false";
- id keys[] = { @"message", @"timestamp", @"adid", @"willRetry", @"jsonResponse" };
+ id keys[] = {
+ @"message",
+ @"timestamp",
+ @"adid",
+ @"willRetry",
+ @"jsonResponse"
+ };
id values[] = {
[self getValueOrEmpty:[sessionFailureResponseData message]],
- [self getValueOrEmpty:[sessionFailureResponseData timeStamp]],
+ [self getValueOrEmpty:[sessionFailureResponseData timestamp]],
[self getValueOrEmpty:[sessionFailureResponseData adid]],
willRetryString,
[self toJson:[self getObjectValueOrEmpty:[sessionFailureResponseData jsonResponse]]]
@@ -182,14 +191,21 @@ - (void)adjustSessionTrackingFailedWananbe:(ADJSessionFailure *)sessionFailureRe
}
- (void)adjustEventTrackingSucceededWannabe:(ADJEventSuccess *)eventSuccessResponseData {
- if (nil == eventSuccessResponseData) {
+ if (nil == eventSuccessResponseData || nil == dartEventSuccessCallback) {
return;
}
- id keys[] = { @"message", @"timestamp", @"adid", @"eventToken", @"callbackId", @"jsonResponse" };
+ id keys[] = {
+ @"message",
+ @"timestamp",
+ @"adid",
+ @"eventToken",
+ @"callbackId",
+ @"jsonResponse"
+ };
id values[] = {
[self getValueOrEmpty:[eventSuccessResponseData message]],
- [self getValueOrEmpty:[eventSuccessResponseData timeStamp]],
+ [self getValueOrEmpty:[eventSuccessResponseData timestamp]],
[self getValueOrEmpty:[eventSuccessResponseData adid]],
[self getValueOrEmpty:[eventSuccessResponseData eventToken]],
[self getValueOrEmpty:[eventSuccessResponseData callbackId]],
@@ -203,15 +219,23 @@ - (void)adjustEventTrackingSucceededWannabe:(ADJEventSuccess *)eventSuccessRespo
}
- (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponseData {
- if (nil == eventFailureResponseData) {
+ if (nil == eventFailureResponseData || nil == dartEventFailureCallback) {
return;
}
NSString *willRetryString = [eventFailureResponseData willRetry] ? @"true" : @"false";
- id keys[] = { @"message", @"timestamp", @"adid", @"eventToken", @"callbackId", @"willRetry", @"jsonResponse" };
+ id keys[] = {
+ @"message",
+ @"timestamp",
+ @"adid",
+ @"eventToken",
+ @"callbackId",
+ @"willRetry",
+ @"jsonResponse"
+ };
id values[] = {
[self getValueOrEmpty:[eventFailureResponseData message]],
- [self getValueOrEmpty:[eventFailureResponseData timeStamp]],
+ [self getValueOrEmpty:[eventFailureResponseData timestamp]],
[self getValueOrEmpty:[eventFailureResponseData adid]],
[self getValueOrEmpty:[eventFailureResponseData eventToken]],
[self getValueOrEmpty:[eventFailureResponseData callbackId]],
@@ -225,8 +249,12 @@ - (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponse
[self.channel invokeMethod:dartEventFailureCallback arguments:eventFailureMap];
}
-- (BOOL)adjustDeeplinkResponseWannabe:(NSURL *)deeplink {
- id keys[] = { @"uri" };
+- (BOOL)adjustDeferredDeeplinkReceivedWannabe:(NSURL *)deeplink {
+ if (nil == deeplink || nil == dartDeferredDeeplinkCallback) {
+ return NO;
+ }
+
+ id keys[] = { @"deeplink" };
id values[] = { [deeplink absoluteString] };
NSUInteger count = sizeof(values) / sizeof(id);
NSDictionary *deeplinkMap = [NSDictionary dictionaryWithObjects:values
@@ -236,30 +264,12 @@ - (BOOL)adjustDeeplinkResponseWannabe:(NSURL *)deeplink {
return self.shouldLaunchDeferredDeeplink;
}
-- (void)adjustConversionValueUpdatedWannabe:(NSNumber *)conversionValue {
- id keys[] = { @"conversionValue" };
- id values[] = { [conversionValue stringValue] };
- NSUInteger count = sizeof(values) / sizeof(id);
- NSDictionary *conversionValueMap = [NSDictionary dictionaryWithObjects:values
- forKeys:keys
- count:count];
- [self.channel invokeMethod:dartConversionValueUpdatedCallback arguments:conversionValueMap];
-}
-
-- (void)adjustConversionValueUpdatedWannabe:(nullable NSNumber *)fineValue
- coarseValue:(nullable NSString *)coarseValue
- lockWindow:(nullable NSNumber *)lockWindow {
- NSMutableDictionary *conversionValueMap = [NSMutableDictionary dictionary];
- if (![fineValue isKindOfClass:[NSNull class]] && fineValue != nil) {
- [conversionValueMap setValue:[fineValue stringValue] forKey:@"fineValue"];
- }
- if (![coarseValue isKindOfClass:[NSNull class]] && coarseValue != nil) {
- [conversionValueMap setValue:coarseValue forKey:@"coarseValue"];
- }
- if (![lockWindow isKindOfClass:[NSNull class]] && lockWindow != nil) {
- [conversionValueMap setValue:[lockWindow stringValue] forKey:@"lockWindow"];
+- (void)adjustSkanUpdatedWithConversionDataWannabe:(NSDictionary *)data {
+ if (nil == data || nil == dartSkanUpdatedCallback) {
+ return;
}
- [self.channel invokeMethod:dartSkad4ConversionValueUpdatedCallback arguments:conversionValueMap];
+
+ [self.channel invokeMethod:dartSkanUpdatedCallback arguments:data];
}
- (void)swizzleCallbackMethod:(SEL)originalSelector
diff --git a/ios/adjust_sdk.podspec b/ios/adjust_sdk.podspec
index 030167b..94a8a78 100644
--- a/ios/adjust_sdk.podspec
+++ b/ios/adjust_sdk.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'adjust_sdk'
- s.version = '4.38.2'
+ s.version = '5.0.0'
s.summary = 'Adjust Flutter SDK for iOS platform'
s.description = <<-DESC
Adjust Flutter SDK for iOS platform.
@@ -11,8 +11,8 @@ Pod::Spec.new do |s|
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
- s.ios.deployment_target = '8.0'
+ s.ios.deployment_target = '12.0'
s.dependency 'Flutter'
- s.dependency 'Adjust', '4.38.4'
+ s.dependency 'Adjust', '5.0.0'
end
diff --git a/lib/adjust.dart b/lib/adjust.dart
index 16e7ede..d25f5ab 100644
--- a/lib/adjust.dart
+++ b/lib/adjust.dart
@@ -16,66 +16,55 @@ import 'package:adjust_sdk/adjust_config.dart';
import 'package:adjust_sdk/adjust_event.dart';
import 'package:adjust_sdk/adjust_play_store_purchase.dart';
import 'package:adjust_sdk/adjust_play_store_subscription.dart';
-import 'package:adjust_sdk/adjust_purchase_verification_info.dart';
+import 'package:adjust_sdk/adjust_purchase_verification_result.dart';
import 'package:adjust_sdk/adjust_third_party_sharing.dart';
+import 'package:adjust_sdk/adjust_deeplink.dart';
import 'package:flutter/services.dart';
import 'package:meta/meta.dart';
class Adjust {
- static const String _sdkPrefix = 'flutter4.38.2';
+ static const String _sdkPrefix = 'flutter5.0.0';
static const MethodChannel _channel =
const MethodChannel('com.adjust.sdk/api');
- static void start(AdjustConfig config) {
+ static void initSdk(AdjustConfig config) {
config.sdkPrefix = _sdkPrefix;
- _channel.invokeMethod('start', config.toMap);
+ _channel.invokeMethod('initSdk', config.toMap);
}
static void trackEvent(AdjustEvent event) {
_channel.invokeMethod('trackEvent', event.toMap);
}
- static void setEnabled(bool isEnabled) {
- _channel.invokeMethod('setEnabled', {'isEnabled': isEnabled});
+ static void enable() {
+ _channel.invokeMethod('enable');
}
- static void setOfflineMode(bool isOffline) {
- _channel.invokeMethod('setOfflineMode', {'isOffline': isOffline});
+ static void disable() {
+ _channel.invokeMethod('disable');
}
- static void setPushToken(String token) {
- _channel.invokeMethod('setPushToken', {'pushToken': token});
+ static void switchToOfflineMode() {
+ _channel.invokeMethod('switchToOfflineMode');
}
- static void setReferrer(String referrer) {
- _channel.invokeMethod('setReferrer', {'referrer': referrer});
+ static void switchBackToOnlineMode() {
+ _channel.invokeMethod('switchBackToOnlineMode');
}
- static void appWillOpenUrl(String url) {
- _channel.invokeMethod('appWillOpenUrl', {'url': url});
+ static void setPushToken(String token) {
+ _channel.invokeMethod('setPushToken', {'pushToken': token});
}
- static void sendFirstPackages() {
- _channel.invokeMethod('sendFirstPackages');
+ static void processDeeplink(AdjustDeeplink deeplink) {
+ _channel.invokeMethod('processDeeplink', {'deeplink': deeplink.deeplink});
}
static void gdprForgetMe() {
_channel.invokeMethod('gdprForgetMe');
}
- static void disableThirdPartySharing() {
- _channel.invokeMethod('disableThirdPartySharing');
- }
-
- static void onResume() {
- _channel.invokeMethod('onResume');
- }
-
- static void onPause() {
- _channel.invokeMethod('onPause');
- }
-
static Future isEnabled() async {
final bool isEnabled = await _channel.invokeMethod('isEnabled');
return isEnabled;
@@ -106,9 +95,9 @@ class Adjust {
return googleAdId;
}
- static Future requestTrackingAuthorizationWithCompletionHandler() async {
+ static Future requestAppTrackingAuthorization() async {
final num status = await _channel
- .invokeMethod('requestTrackingAuthorizationWithCompletionHandler');
+ .invokeMethod('requestAppTrackingAuthorization');
return status;
}
@@ -129,39 +118,34 @@ class Adjust {
return _sdkPrefix + '@' + sdkVersion;
}
- static void addSessionCallbackParameter(String key, String value) {
+ static void addGlobalCallbackParameter(String key, String value) {
_channel.invokeMethod(
- 'addSessionCallbackParameter', {'key': key, 'value': value});
+ 'addGlobalCallbackParameter', {'key': key, 'value': value});
}
- static void addSessionPartnerParameter(String key, String value) {
+ static void addGlobalPartnerParameter(String key, String value) {
_channel.invokeMethod(
- 'addSessionPartnerParameter', {'key': key, 'value': value});
- }
-
- static void removeSessionCallbackParameter(String key) {
- _channel.invokeMethod('removeSessionCallbackParameter', {'key': key});
+ 'addGlobalPartnerParameter', {'key': key, 'value': value});
}
- static void removeSessionPartnerParameter(String key) {
- _channel.invokeMethod('removeSessionPartnerParameter', {'key': key});
+ static void removeGlobalCallbackParameter(String key) {
+ _channel.invokeMethod('removeGlobalCallbackParameter', {'key': key});
}
- static void resetSessionCallbackParameters() {
- _channel.invokeMethod('resetSessionCallbackParameters');
+ static void removeGlobalPartnerParameter(String key) {
+ _channel.invokeMethod('removeGlobalPartnerParameter', {'key': key});
}
- static void resetSessionPartnerParameters() {
- _channel.invokeMethod('resetSessionPartnerParameters');
+ static void removeGlobalCallbackParameters() {
+ _channel.invokeMethod('removeGlobalCallbackParameters');
}
- static void trackAdRevenue(String source, String payload) {
- _channel
- .invokeMethod('trackAdRevenue', {'source': source, 'payload': payload});
+ static void removeGlobalPartnerParameters() {
+ _channel.invokeMethod('removeGlobalPartnerParameters');
}
- static void trackAdRevenueNew(AdjustAdRevenue adRevenue) {
- _channel.invokeMethod('trackAdRevenueNew', adRevenue.toMap);
+ static void trackAdRevenue(AdjustAdRevenue adRevenue) {
+ _channel.invokeMethod('trackAdRevenue', adRevenue.toMap);
}
static void trackAppStoreSubscription(
@@ -184,13 +168,13 @@ class Adjust {
'trackMeasurementConsent', {'measurementConsent': measurementConsent});
}
- static void updateConversionValue(int conversionValue) {
- _channel.invokeMethod(
- 'updateConversionValue', {'conversionValue': conversionValue});
- }
-
- static void checkForNewAttStatus() {
- _channel.invokeMethod('checkForNewAttStatus');
+ static Future updateSkanConversionValue(int conversionValue, String coarseValue, bool lockWindow) async {
+ final String error = await _channel.invokeMethod('updateSkanConversionValue', {
+ 'conversionValue': conversionValue,
+ 'coarseValue': coarseValue,
+ 'lockWindow': lockWindow
+ });
+ return error;
}
static Future getLastDeeplink() async {
@@ -198,46 +182,53 @@ class Adjust {
return deeplink;
}
- static Future updateConversionValueWithErrorCallback(int conversionValue) async {
- final String? error = await _channel.invokeMethod(
- 'updateConversionValueWithErrorCallback', {'conversionValue': conversionValue});
- return error;
- }
-
- static Future updateConversionValueWithErrorCallbackSkad4(
- int conversionValue,
- String coarseValue,
- bool lockWindow) async {
- final String? error = await _channel.invokeMethod(
- 'updateConversionValueWithErrorCallbackSkad4', {'conversionValue': conversionValue,
- 'coarseValue': coarseValue,
- 'lockWindow': lockWindow});
- return error;
- }
-
- static Future verifyPlayStorePurchase(
+ static Future verifyPlayStorePurchase(
AdjustPlayStorePurchase purchase) async {
final dynamic playStorePurchaseMap =
await _channel.invokeMethod('verifyPlayStorePurchase', purchase.toMap);
- return AdjustPurchaseVerificationInfo.fromMap(playStorePurchaseMap);
+ return AdjustPurchaseVerificationResult.fromMap(playStorePurchaseMap);
+ }
+
+ static Future verifyAndTrackPlayStorePurchase(
+ AdjustEvent event) async {
+ final dynamic playStorePurchaseMap =
+ await _channel.invokeMethod('verifyAndTrackPlayStorePurchase', event.toMap);
+ return AdjustPurchaseVerificationResult.fromMap(playStorePurchaseMap);
}
- static Future verifyAppStorePurchase(
+ static Future verifyAppStorePurchase(
AdjustAppStorePurchase purchase) async {
final dynamic appStorePurchaseMap =
await _channel.invokeMethod('verifyAppStorePurchase', purchase.toMap);
- return AdjustPurchaseVerificationInfo.fromMap(appStorePurchaseMap);
+ return AdjustPurchaseVerificationResult.fromMap(appStorePurchaseMap);
+ }
+
+ static Future verifyAndTrackAppStorePurchase(
+ AdjustEvent event) async {
+ final dynamic appStorePurchaseMap =
+ await _channel.invokeMethod('verifyAndTrackAppStorePurchase', event.toMap);
+ return AdjustPurchaseVerificationResult.fromMap(appStorePurchaseMap);
}
- static Future processDeeplink(String deeplink) async {
+ static Future processAndResolveDeeplink(AdjustDeeplink deeplink) async {
final resolvedLink =
- await _channel.invokeMethod('processDeeplink', {'deeplink': deeplink});
+ await _channel.invokeMethod('processAndResolveDeeplink', {'deeplink': deeplink.deeplink});
return resolvedLink;
}
- // For testing purposes only. Do not use in production.
+ // for testing purposes only, do not use in production!
@visibleForTesting
static void setTestOptions(final dynamic testOptions) {
_channel.invokeMethod('setTestOptions', testOptions);
}
+
+ @visibleForTesting
+ static void onResume() {
+ _channel.invokeMethod('onResume');
+ }
+
+ @visibleForTesting
+ static void onPause() {
+ _channel.invokeMethod('onPause');
+ }
}
diff --git a/lib/adjust_ad_revenue.dart b/lib/adjust_ad_revenue.dart
index 20834ec..ce10bad 100644
--- a/lib/adjust_ad_revenue.dart
+++ b/lib/adjust_ad_revenue.dart
@@ -9,7 +9,7 @@
import 'dart:convert';
class AdjustAdRevenue {
- String _source;
+ final String _source;
num? _revenue;
String? _currency;
num? adImpressionsCount;
diff --git a/lib/adjust_app_store_purchase.dart b/lib/adjust_app_store_purchase.dart
index 9b70738..14b0c8b 100644
--- a/lib/adjust_app_store_purchase.dart
+++ b/lib/adjust_app_store_purchase.dart
@@ -7,23 +7,19 @@
//
class AdjustAppStorePurchase {
- String? receipt;
- String? productId;
- String? transactionId;
+ final String _productId;
+ final String _transactionId;
- AdjustAppStorePurchase(this.receipt, this.productId, this.transactionId);
+ AdjustAppStorePurchase(this._productId, this._transactionId);
Map get toMap {
Map purchaseMap = new Map();
- if (receipt != null) {
- purchaseMap['receipt'] = receipt;
+ if (_productId != null) {
+ purchaseMap['productId'] = _productId;
}
- if (productId != null) {
- purchaseMap['productId'] = productId;
- }
- if (transactionId != null) {
- purchaseMap['transactionId'] = transactionId;
+ if (_transactionId != null) {
+ purchaseMap['transactionId'] = _transactionId;
}
return purchaseMap;
diff --git a/lib/adjust_app_store_subscription.dart b/lib/adjust_app_store_subscription.dart
index c35ab74..0500617 100644
--- a/lib/adjust_app_store_subscription.dart
+++ b/lib/adjust_app_store_subscription.dart
@@ -9,31 +9,21 @@
import 'dart:convert';
class AdjustAppStoreSubscription {
- String? _price;
- String? _currency;
- String? _transactionId;
- String? _receipt;
- String? _transactionDate;
- String? _salesRegion;
+ final String _price;
+ final String _currency;
+ final String _transactionId;
+ String? transactionDate;
+ String? salesRegion;
String? _billingStore;
Map? _callbackParameters;
Map? _partnerParameters;
- AdjustAppStoreSubscription(
- this._price, this._currency, this._transactionId, this._receipt) {
+ AdjustAppStoreSubscription(this._price, this._currency, this._transactionId) {
_billingStore = "iOS";
_callbackParameters = new Map();
_partnerParameters = new Map();
}
- void setTransactionDate(String transactionDate) {
- _transactionDate = transactionDate;
- }
-
- void setSalesRegion(String salesRegion) {
- _salesRegion = salesRegion;
- }
-
void addCallbackParameter(String key, String value) {
_callbackParameters![key] = value;
}
@@ -54,14 +44,11 @@ class AdjustAppStoreSubscription {
if (_transactionId != null) {
subscriptionMap['transactionId'] = _transactionId;
}
- if (_receipt != null) {
- subscriptionMap['receipt'] = _receipt;
- }
- if (_transactionDate != null) {
- subscriptionMap['transactionDate'] = _transactionDate;
+ if (transactionDate != null) {
+ subscriptionMap['transactionDate'] = transactionDate;
}
- if (_salesRegion != null) {
- subscriptionMap['salesRegion'] = _salesRegion;
+ if (salesRegion != null) {
+ subscriptionMap['salesRegion'] = salesRegion;
}
if (_billingStore != null) {
subscriptionMap['billingStore'] = _billingStore;
diff --git a/lib/adjust_attribution.dart b/lib/adjust_attribution.dart
index 57493cb..8927f0d 100644
--- a/lib/adjust_attribution.dart
+++ b/lib/adjust_attribution.dart
@@ -14,7 +14,6 @@ class AdjustAttribution {
final String? adgroup;
final String? creative;
final String? clickLabel;
- final String? adid;
final String? costType;
final num? costAmount;
final String? costCurrency;
@@ -22,18 +21,17 @@ class AdjustAttribution {
final String? fbInstallReferrer;
AdjustAttribution({
- required this.trackerToken,
- required this.trackerName,
- required this.network,
- required this.campaign,
- required this.adgroup,
- required this.creative,
- required this.clickLabel,
- required this.adid,
- required this.costType,
- required this.costAmount,
- required this.costCurrency,
- required this.fbInstallReferrer,
+ this.trackerToken,
+ this.trackerName,
+ this.network,
+ this.campaign,
+ this.adgroup,
+ this.creative,
+ this.clickLabel,
+ this.costType,
+ this.costAmount,
+ this.costCurrency,
+ this.fbInstallReferrer,
});
factory AdjustAttribution.fromMap(dynamic map) {
@@ -53,7 +51,6 @@ class AdjustAttribution {
adgroup: map['adgroup'],
creative: map['creative'],
clickLabel: map['clickLabel'],
- adid: map['adid'],
costType: map['costType'],
costAmount: parsedCostAmount != -1 ? parsedCostAmount : null,
costCurrency: map['costCurrency'],
diff --git a/lib/adjust_config.dart b/lib/adjust_config.dart
index f81fa0f..b27af39 100644
--- a/lib/adjust_config.dart
+++ b/lib/adjust_config.dart
@@ -6,6 +6,8 @@
// Copyright (c) 2018-Present Adjust GmbH. All rights reserved.
//
+import 'dart:convert';
+
import 'package:adjust_sdk/adjust_attribution.dart';
import 'package:adjust_sdk/adjust_event_failure.dart';
import 'package:adjust_sdk/adjust_event_success.dart';
@@ -22,9 +24,8 @@ typedef void SessionSuccessCallback(AdjustSessionSuccess successData);
typedef void SessionFailureCallback(AdjustSessionFailure failureData);
typedef void EventSuccessCallback(AdjustEventSuccess successData);
typedef void EventFailureCallback(AdjustEventFailure failureData);
-typedef void DeferredDeeplinkCallback(String? uri);
-typedef void ConversionValueUpdatedCallback(num? conversionValue);
-typedef void Skad4ConversionValueUpdatedCallback(num? conversionValue, String? coarseValue, bool? lockWindow);
+typedef void DeferredDeeplinkCallback(String? deeplink);
+typedef void SkanUpdatedCallback(Map skanUpdateData);
class AdjustConfig {
static const MethodChannel _channel =
@@ -35,66 +36,38 @@ class AdjustConfig {
static const String _eventSuccessCallbackName = 'adj-event-success';
static const String _eventFailureCallbackName = 'adj-event-failure';
static const String _deferredDeeplinkCallbackName = 'adj-deferred-deeplink';
- static const String _conversionValueUpdatedCallbackName =
- 'adj-conversion-value-updated';
- static const String _skad4ConversionValueUpdatedCallbackName =
- 'adj-skad4-conversion-value-updated';
-
- static const String UrlStrategyIndia = 'india';
- static const String UrlStrategyChina = 'china';
- static const String UrlStrategyCn = 'cn';
- static const String UrlStrategyCnOnly = 'cn-only';
-
- static const String DataResidencyEU = 'data-residency-eu';
- static const String DataResidencyTR = 'data-residency-tr';
- static const String DataResidencyUS = 'data-residency-us';
-
- static const String AdRevenueSourceAppLovinMAX = "applovin_max_sdk";
- static const String AdRevenueSourceMopub = 'mopub';
- static const String AdRevenueSourceAdMob = 'admob_sdk';
- static const String AdRevenueSourceIronSource = 'ironsource_sdk';
- static const String AdRevenueSourceAdMostSource = 'admost_sdk';
- static const String AdRevenueSourceUnity = 'unity_sdk';
- static const String AdRevenueSourceHeliumChartboost = 'helium_chartboost_sdk';
- static const String AdRevenueSourcePublisher = 'publisher_sdk';
- static const String AdRevenueSourceTopOn = 'topon_sdk';
- static const String AdRevenueSourceAdx = 'adx_sdk';
- static const String AdRevenueTradPlus = 'tradplus_sdk';
-
- String _appToken;
- AdjustEnvironment _environment;
-
- num? _info1;
- num? _info2;
- num? _info3;
- num? _info4;
- num? _secretId;
- bool? _skAdNetworkHandling;
+ static const String _skanUpdatedCallbackName = 'adj-skan-updated';
+
+ final String _appToken;
+ final AdjustEnvironment _environment;
+
+ bool? isSkanAttributionEnabled;
+ bool? isSendingInBackgroundEnabled;
+ bool? isAdServicesEnabled;
+ bool? isIdfaReadingEnabled;
+ bool? isIdfvReadingEnabled;
+ bool? isCostDataInAttributionEnabled;
+ bool? isPreinstallTrackingEnabled;
+ bool? isLinkMeEnabled;
+ bool? isDeviceIdsReadingOnceEnabled;
+ bool? isCoppaComplianceEnabled;
+ bool? isPlayStoreKidsComplianceEnabled;
+ bool? isDeferredDeeplinkOpeningEnabled;
num? attConsentWaitingInterval;
- double? delayStart;
- bool? isDeviceKnown;
- bool? sendInBackground;
- bool? eventBufferingEnabled;
- bool? allowiAdInfoReading;
- bool? allowAdServicesInfoReading;
- bool? allowIdfaReading;
- bool? launchDeferredDeeplink;
- bool? needsCost;
- bool? preinstallTrackingEnabled;
- bool? playStoreKidsAppEnabled;
- bool? coppaCompliantEnabled;
- bool? linkMeEnabled;
- bool? finalAndroidAttributionEnabled;
- bool? readDeviceInfoOnceEnabled;
+ num? eventDeduplicationIdsMaxSize;
+
String? sdkPrefix;
- String? userAgent;
String? defaultTracker;
String? externalDeviceId;
- String? urlStrategy;
String? processName;
String? preinstallFilePath;
String? fbAppId;
+
+ bool? _isDataResidency;
+ bool? _useSubdomains;
+ List _urlStrategyDomains = [];
+
AdjustLogLevel? logLevel;
AttributionCallback? attributionCallback;
SessionSuccessCallback? sessionSuccessCallback;
@@ -102,12 +75,16 @@ class AdjustConfig {
EventSuccessCallback? eventSuccessCallback;
EventFailureCallback? eventFailureCallback;
DeferredDeeplinkCallback? deferredDeeplinkCallback;
- ConversionValueUpdatedCallback? conversionValueUpdatedCallback;
- Skad4ConversionValueUpdatedCallback? skad4ConversionValueUpdatedCallback;
+ SkanUpdatedCallback? skanUpdatedCallback;
AdjustConfig(this._appToken, this._environment) {
_initCallbackHandlers();
- _skAdNetworkHandling = true;
+ }
+
+ void setUrlStrategy(List urlStrategyDomains, bool useSubdomains, bool isDataResidency) {
+ _urlStrategyDomains.addAll(urlStrategyDomains);
+ _useSubdomains = useSubdomains;
+ _isDataResidency = isDataResidency;
}
void _initCallbackHandlers() {
@@ -116,66 +93,45 @@ class AdjustConfig {
switch (call.method) {
case _attributionCallbackName:
if (attributionCallback != null) {
- AdjustAttribution attribution =
- AdjustAttribution.fromMap(call.arguments);
+ AdjustAttribution attribution = AdjustAttribution.fromMap(call.arguments);
attributionCallback!(attribution);
}
break;
case _sessionSuccessCallbackName:
if (sessionSuccessCallback != null) {
- AdjustSessionSuccess sessionSuccess =
- AdjustSessionSuccess.fromMap(call.arguments);
+ AdjustSessionSuccess sessionSuccess = AdjustSessionSuccess.fromMap(call.arguments);
sessionSuccessCallback!(sessionSuccess);
}
break;
case _sessionFailureCallbackName:
if (sessionFailureCallback != null) {
- AdjustSessionFailure sessionFailure =
- AdjustSessionFailure.fromMap(call.arguments);
+ AdjustSessionFailure sessionFailure = AdjustSessionFailure.fromMap(call.arguments);
sessionFailureCallback!(sessionFailure);
}
break;
case _eventSuccessCallbackName:
if (eventSuccessCallback != null) {
- AdjustEventSuccess eventSuccess =
- AdjustEventSuccess.fromMap(call.arguments);
+ AdjustEventSuccess eventSuccess = AdjustEventSuccess.fromMap(call.arguments);
eventSuccessCallback!(eventSuccess);
}
break;
case _eventFailureCallbackName:
if (eventFailureCallback != null) {
- AdjustEventFailure eventFailure =
- AdjustEventFailure.fromMap(call.arguments);
+ AdjustEventFailure eventFailure = AdjustEventFailure.fromMap(call.arguments);
eventFailureCallback!(eventFailure);
}
break;
case _deferredDeeplinkCallbackName:
if (deferredDeeplinkCallback != null) {
- String? uri = call.arguments['uri'];
+ String? deeplink = call.arguments['deeplink'];
if (deferredDeeplinkCallback != null) {
- deferredDeeplinkCallback!(uri);
- }
- }
- break;
- case _conversionValueUpdatedCallbackName:
- if (conversionValueUpdatedCallback != null) {
- String? conversionValue = call.arguments['conversionValue'];
- if (conversionValue != null) {
- conversionValueUpdatedCallback!(int.parse(conversionValue));
+ deferredDeeplinkCallback!(deeplink);
}
}
break;
- case _skad4ConversionValueUpdatedCallbackName:
- if (skad4ConversionValueUpdatedCallback != null) {
- String? conversionValue = call.arguments['fineValue'];
- String? coarseValue = call.arguments['coarseValue'];
- String? lockWindow = call.arguments['lockWindow'];
- if (conversionValue != null && coarseValue != null && lockWindow != null) {
- skad4ConversionValueUpdatedCallback!(
- int.parse(conversionValue),
- coarseValue,
- lockWindow.toLowerCase() == 'true');
- }
+ case _skanUpdatedCallbackName:
+ if (skanUpdatedCallback != null) {
+ skanUpdatedCallback!(Map.from(call.arguments));
}
break;
default:
@@ -188,18 +144,6 @@ class AdjustConfig {
});
}
- void setAppSecret(num secretId, num info1, num info2, num info3, num info4) {
- _secretId = secretId;
- _info1 = info1;
- _info2 = info2;
- _info3 = info3;
- _info4 = info4;
- }
-
- void deactivateSKAdNetworkHandling() {
- _skAdNetworkHandling = false;
- }
-
Map get toMap {
Map configMap = {
'sdkPrefix': sdkPrefix,
@@ -209,9 +153,6 @@ class AdjustConfig {
.substring(_environment.toString().indexOf('.') + 1),
};
- if (userAgent != null) {
- configMap['userAgent'] = userAgent;
- }
if (processName != null) {
configMap['processName'] = processName;
}
@@ -225,79 +166,62 @@ class AdjustConfig {
if (externalDeviceId != null) {
configMap['externalDeviceId'] = externalDeviceId;
}
+ if (eventDeduplicationIdsMaxSize != null) {
+ configMap['eventDeduplicationIdsMaxSize'] = eventDeduplicationIdsMaxSize.toString();
+ }
if (preinstallFilePath != null) {
configMap['preinstallFilePath'] = preinstallFilePath;
}
if (fbAppId != null) {
configMap['fbAppId'] = fbAppId;
}
- if (urlStrategy != null) {
- configMap['urlStrategy'] = urlStrategy;
+ if (_urlStrategyDomains.isEmpty != true ) {
+ configMap['urlStrategyDomains'] = json.encode(_urlStrategyDomains);
}
- if (isDeviceKnown != null) {
- configMap['isDeviceKnown'] = isDeviceKnown.toString();
+ if (_isDataResidency != null) {
+ configMap['isDataResidency'] = _isDataResidency.toString();
}
- if (sendInBackground != null) {
- configMap['sendInBackground'] = sendInBackground.toString();
+ if (_useSubdomains != null) {
+ configMap['useSubdomains'] = _useSubdomains.toString();
}
- if (eventBufferingEnabled != null) {
- configMap['eventBufferingEnabled'] = eventBufferingEnabled.toString();
+ if (isCostDataInAttributionEnabled != null) {
+ configMap['isCostDataInAttributionEnabled'] = isCostDataInAttributionEnabled.toString();
}
- if (needsCost != null) {
- configMap['needsCost'] = needsCost.toString();
+ if (isSendingInBackgroundEnabled != null) {
+ configMap['isSendingInBackgroundEnabled'] = isSendingInBackgroundEnabled.toString();
}
- if (preinstallTrackingEnabled != null) {
- configMap['preinstallTrackingEnabled'] =
- preinstallTrackingEnabled.toString();
+ if (isCostDataInAttributionEnabled != null) {
+ configMap['isCostDataInAttributionEnabled'] = isCostDataInAttributionEnabled.toString();
}
- if (playStoreKidsAppEnabled != null) {
- configMap['playStoreKidsAppEnabled'] = playStoreKidsAppEnabled.toString();
+ if (isPreinstallTrackingEnabled != null) {
+ configMap['isPreinstallTrackingEnabled'] = isPreinstallTrackingEnabled.toString();
}
- if (coppaCompliantEnabled != null) {
- configMap['coppaCompliantEnabled'] = coppaCompliantEnabled.toString();
+ if (isPlayStoreKidsComplianceEnabled != null) {
+ configMap['isPlayStoreKidsComplianceEnabled'] = isPlayStoreKidsComplianceEnabled.toString();
}
- if (finalAndroidAttributionEnabled != null) {
- configMap['finalAndroidAttributionEnabled'] = finalAndroidAttributionEnabled.toString();
+ if (isCoppaComplianceEnabled != null) {
+ configMap['isCoppaComplianceEnabled'] = isCoppaComplianceEnabled.toString();
}
- if (readDeviceInfoOnceEnabled != null) {
- configMap['readDeviceInfoOnceEnabled'] = readDeviceInfoOnceEnabled.toString();
+ if (isDeviceIdsReadingOnceEnabled != null) {
+ configMap['isDeviceIdsReadingOnceEnabled'] = isDeviceIdsReadingOnceEnabled.toString();
}
- if (linkMeEnabled != null) {
- configMap['linkMeEnabled'] = linkMeEnabled.toString();
+ if (isLinkMeEnabled != null) {
+ configMap['isLinkMeEnabled'] = isLinkMeEnabled.toString();
}
- if (allowiAdInfoReading != null) {
- configMap['allowiAdInfoReading'] = allowiAdInfoReading.toString();
+ if (isAdServicesEnabled != null) {
+ configMap['isAdServicesEnabled'] = isAdServicesEnabled.toString();
}
- if (allowAdServicesInfoReading != null) {
- configMap['allowAdServicesInfoReading'] =
- allowAdServicesInfoReading.toString();
+ if (isIdfaReadingEnabled != null) {
+ configMap['isIdfaReadingEnabled'] = isIdfaReadingEnabled.toString();
}
- if (allowIdfaReading != null) {
- configMap['allowIdfaReading'] = allowIdfaReading.toString();
+ if (isIdfvReadingEnabled != null) {
+ configMap['isIdfvReadingEnabled'] = isIdfvReadingEnabled.toString();
}
- if (_skAdNetworkHandling != null) {
- configMap['skAdNetworkHandling'] = _skAdNetworkHandling.toString();
+ if (isSkanAttributionEnabled != null) {
+ configMap['isSkanAttributionEnabled'] = isSkanAttributionEnabled.toString();
}
- if (launchDeferredDeeplink != null) {
- configMap['launchDeferredDeeplink'] = launchDeferredDeeplink.toString();
- }
- if (_info1 != null) {
- configMap['info1'] = _info1.toString();
- }
- if (_info2 != null) {
- configMap['info2'] = _info2.toString();
- }
- if (_info3 != null) {
- configMap['info3'] = _info3.toString();
- }
- if (_info4 != null) {
- configMap['info4'] = _info4.toString();
- }
- if (_secretId != null) {
- configMap['secretId'] = _secretId.toString();
- }
- if (delayStart != null) {
- configMap['delayStart'] = delayStart.toString();
+ if (isDeferredDeeplinkOpeningEnabled != null) {
+ configMap['isDeferredDeeplinkOpeningEnabled'] = isDeferredDeeplinkOpeningEnabled.toString();
}
if (attConsentWaitingInterval != null) {
configMap['attConsentWaitingInterval'] = attConsentWaitingInterval.toString();
@@ -320,13 +244,8 @@ class AdjustConfig {
if (deferredDeeplinkCallback != null) {
configMap['deferredDeeplinkCallback'] = _deferredDeeplinkCallbackName;
}
- if (conversionValueUpdatedCallback != null) {
- configMap['conversionValueUpdatedCallback'] =
- _conversionValueUpdatedCallbackName;
- }
- if (skad4ConversionValueUpdatedCallback != null) {
- configMap['skad4ConversionValueUpdatedCallback'] =
- _skad4ConversionValueUpdatedCallbackName;
+ if (skanUpdatedCallback != null) {
+ configMap['skanUpdatedCallback'] = _skanUpdatedCallbackName;
}
return configMap;
diff --git a/lib/adjust_deeplink.dart b/lib/adjust_deeplink.dart
new file mode 100644
index 0000000..4dfb5d2
--- /dev/null
+++ b/lib/adjust_deeplink.dart
@@ -0,0 +1,13 @@
+//
+// adjust_deeplink.dart
+// Adjust SDK
+//
+// Created by Ugljesa Erceg (@uerceg) on 19th August 2024.
+// Copyright (c) 2024-Present Adjust GmbH. All rights reserved.
+//
+
+class AdjustDeeplink {
+ final String deeplink;
+
+ AdjustDeeplink(this.deeplink);
+}
diff --git a/lib/adjust_event.dart b/lib/adjust_event.dart
index ab77ec5..13478e8 100644
--- a/lib/adjust_event.dart
+++ b/lib/adjust_event.dart
@@ -9,16 +9,18 @@
import 'dart:convert';
class AdjustEvent {
- String _eventToken;
+ final String _eventToken;
+ num? _revenue;
String? _currency;
- String? receipt;
- String? transactionId;
- String? productId;
- String? purchaseToken;
String? callbackId;
- num? _revenue;
+ String? deduplicationId;
+ String? productId;
Map? _callbackParameters;
Map? _partnerParameters;
+ // ios only
+ String? transactionId;
+ // android only
+ String? purchaseToken;
AdjustEvent(this._eventToken) {
_callbackParameters = new Map();
@@ -47,12 +49,12 @@ class AdjustEvent {
if (_currency != null) {
eventMap['currency'] = _currency;
}
+ if (deduplicationId != null) {
+ eventMap['deduplicationId'] = deduplicationId;
+ }
if (transactionId != null) {
eventMap['transactionId'] = transactionId;
}
- if (receipt != null) {
- eventMap['receipt'] = receipt;
- }
if (productId != null) {
eventMap['productId'] = productId;
}
diff --git a/lib/adjust_event_failure.dart b/lib/adjust_event_failure.dart
index fe9936d..0e6fc26 100644
--- a/lib/adjust_event_failure.dart
+++ b/lib/adjust_event_failure.dart
@@ -16,13 +16,13 @@ class AdjustEventFailure {
final bool? willRetry;
AdjustEventFailure({
- required this.message,
- required this.timestamp,
- required this.adid,
- required this.eventToken,
- required this.callbackId,
- required this.jsonResponse,
- required this.willRetry,
+ this.message,
+ this.timestamp,
+ this.adid,
+ this.eventToken,
+ this.callbackId,
+ this.jsonResponse,
+ this.willRetry,
});
factory AdjustEventFailure.fromMap(dynamic map) {
diff --git a/lib/adjust_event_success.dart b/lib/adjust_event_success.dart
index d367f8e..14e92f3 100644
--- a/lib/adjust_event_success.dart
+++ b/lib/adjust_event_success.dart
@@ -15,12 +15,12 @@ class AdjustEventSuccess {
final String? jsonResponse;
AdjustEventSuccess({
- required this.message,
- required this.timestamp,
- required this.adid,
- required this.eventToken,
- required this.callbackId,
- required this.jsonResponse,
+ this.message,
+ this.timestamp,
+ this.adid,
+ this.eventToken,
+ this.callbackId,
+ this.jsonResponse,
});
factory AdjustEventSuccess.fromMap(dynamic map) {
diff --git a/lib/adjust_play_store_purchase.dart b/lib/adjust_play_store_purchase.dart
index 33c8c54..9a59def 100644
--- a/lib/adjust_play_store_purchase.dart
+++ b/lib/adjust_play_store_purchase.dart
@@ -7,19 +7,19 @@
//
class AdjustPlayStorePurchase {
- String? productId;
- String? purchaseToken;
+ final String _productId;
+ final String _purchaseToken;
- AdjustPlayStorePurchase(this.productId, this.purchaseToken);
+ AdjustPlayStorePurchase(this._productId, this._purchaseToken);
Map get toMap {
Map purchaseMap = new Map();
- if (productId != null) {
- purchaseMap['productId'] = productId;
+ if (_productId != null) {
+ purchaseMap['productId'] = _productId;
}
- if (purchaseToken != null) {
- purchaseMap['purchaseToken'] = purchaseToken;
+ if (_purchaseToken != null) {
+ purchaseMap['purchaseToken'] = _purchaseToken;
}
return purchaseMap;
diff --git a/lib/adjust_play_store_subscription.dart b/lib/adjust_play_store_subscription.dart
index 542c7c5..4924039 100644
--- a/lib/adjust_play_store_subscription.dart
+++ b/lib/adjust_play_store_subscription.dart
@@ -9,28 +9,29 @@
import 'dart:convert';
class AdjustPlayStoreSubscription {
- String? _price;
- String? _currency;
- String? _sku;
- String? _orderId;
- String? _signature;
- String? _purchaseToken;
+ final String _price;
+ final String _currency;
+ final String _sku;
+ final String _orderId;
+ final String _signature;
+ final String _purchaseToken;
String? _billingStore;
- String? _purchaseTime;
+ String? purchaseTime;
Map? _callbackParameters;
Map? _partnerParameters;
- AdjustPlayStoreSubscription(this._price, this._currency, this._sku,
- this._orderId, this._signature, this._purchaseToken) {
+ AdjustPlayStoreSubscription(
+ this._price,
+ this._currency,
+ this._sku,
+ this._orderId,
+ this._signature,
+ this._purchaseToken) {
_billingStore = "GooglePlay";
_callbackParameters = new Map();
_partnerParameters = new Map();
}
- void setPurchaseTime(String purchaseTime) {
- _purchaseTime = purchaseTime;
- }
-
void addCallbackParameter(String key, String value) {
_callbackParameters![key] = value;
}
@@ -40,7 +41,7 @@ class AdjustPlayStoreSubscription {
}
Map get toMap {
- Map subscriptionMap = new Map();
+ Map subscriptionMap = new Map();
if (_price != null) {
subscriptionMap['price'] = _price;
@@ -63,8 +64,8 @@ class AdjustPlayStoreSubscription {
if (_billingStore != null) {
subscriptionMap['billingStore'] = _billingStore;
}
- if (_purchaseTime != null) {
- subscriptionMap['purchaseTime'] = _purchaseTime;
+ if (purchaseTime != null) {
+ subscriptionMap['purchaseTime'] = purchaseTime;
}
if (_callbackParameters!.length > 0) {
subscriptionMap['callbackParameters'] = json.encode(_callbackParameters);
diff --git a/lib/adjust_purchase_verification_info.dart b/lib/adjust_purchase_verification_result.dart
similarity index 65%
rename from lib/adjust_purchase_verification_info.dart
rename to lib/adjust_purchase_verification_result.dart
index 3a9a828..41f9b21 100644
--- a/lib/adjust_purchase_verification_info.dart
+++ b/lib/adjust_purchase_verification_result.dart
@@ -1,5 +1,5 @@
//
-// adjust_purchase_verification_info.dart
+// adjust_purchase_verification_result.dart
// Adjust SDK
//
// Created by Ugljesa Erceg (@uerceg) on 4th September 2020.
@@ -8,14 +8,14 @@
import 'dart:convert';
-class AdjustPurchaseVerificationInfo {
- final num? code;
- final String? message;
- final String? verificationStatus;
+class AdjustPurchaseVerificationResult {
+ final num code;
+ final String message;
+ final String verificationStatus;
- AdjustPurchaseVerificationInfo(this.code, this.message, this.verificationStatus);
+ AdjustPurchaseVerificationResult(this.code, this.message, this.verificationStatus);
- factory AdjustPurchaseVerificationInfo.fromMap(dynamic map) {
+ factory AdjustPurchaseVerificationResult.fromMap(dynamic map) {
try {
int parsedCode = -1;
try {
@@ -24,10 +24,10 @@ class AdjustPurchaseVerificationInfo {
}
} catch (ex) {}
- return AdjustPurchaseVerificationInfo(parsedCode, map['message'], map['verificationStatus']);
+ return AdjustPurchaseVerificationResult(parsedCode, map['message'], map['verificationStatus']);
} catch (e) {
throw Exception(
- '[AdjustFlutter]: Failed to create AdjustPurchaseVerificationInfo object from given map object. Details: ' +
+ '[AdjustFlutter]: Failed to create AdjustPurchaseVerificationResult object from given map object. Details: ' +
e.toString());
}
}
diff --git a/lib/adjust_session_failure.dart b/lib/adjust_session_failure.dart
index 4c2e945..44941ab 100644
--- a/lib/adjust_session_failure.dart
+++ b/lib/adjust_session_failure.dart
@@ -14,11 +14,11 @@ class AdjustSessionFailure {
final bool? willRetry;
AdjustSessionFailure({
- required this.message,
- required this.timestamp,
- required this.adid,
- required this.jsonResponse,
- required this.willRetry,
+ this.message,
+ this.timestamp,
+ this.adid,
+ this.jsonResponse,
+ this.willRetry,
});
factory AdjustSessionFailure.fromMap(dynamic map) {
diff --git a/lib/adjust_session_success.dart b/lib/adjust_session_success.dart
index d313cec..3c6b4c6 100644
--- a/lib/adjust_session_success.dart
+++ b/lib/adjust_session_success.dart
@@ -13,10 +13,10 @@ class AdjustSessionSuccess {
final String? jsonResponse;
AdjustSessionSuccess({
- required this.message,
- required this.timestamp,
- required this.adid,
- required this.jsonResponse,
+ this.message,
+ this.timestamp,
+ this.adid,
+ this.jsonResponse,
});
factory AdjustSessionSuccess.fromMap(dynamic map) {
diff --git a/lib/adjust_third_party_sharing.dart b/lib/adjust_third_party_sharing.dart
index e5cb931..f2446dc 100644
--- a/lib/adjust_third_party_sharing.dart
+++ b/lib/adjust_third_party_sharing.dart
@@ -7,7 +7,7 @@
//
class AdjustThirdPartySharing {
- bool? _isEnabled;
+ final bool? _isEnabled;
late List _granularOptions;
late List _partnerSharingSettings;
diff --git a/pubspec.yaml b/pubspec.yaml
index 653452e..6d85969 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
name: adjust_sdk
description: This is the Flutter SDK of Adjust™. You can read more about Adjust™ at adjust.com.
homepage: https://github.com/adjust/flutter_sdk
-version: 4.38.2
+version: 5.0.0
environment:
sdk: ">=2.12.0 <3.0.0"
diff --git a/test/android/build.gradle b/test/android/build.gradle
index 4be3ee2..3ecbb97 100644
--- a/test/android/build.gradle
+++ b/test/android/build.gradle
@@ -2,13 +2,16 @@ group 'com.adjust.test.lib'
version '1.0-SNAPSHOT'
buildscript {
+ ext {
+ agp_version = '8.1.2'
+ }
repositories {
google()
mavenCentral()
}
dependencies {
- classpath('com.android.tools.build:gradle:7.1.1')
+ classpath("com.android.tools.build:gradle:$agp_version")
}
}
@@ -31,6 +34,7 @@ android {
lintOptions {
disable 'InvalidPackage'
}
+ namespace 'com.adjust.examples'
}
dependencies {
diff --git a/test/android/gradle/wrapper/gradle-wrapper.properties b/test/android/gradle/wrapper/gradle-wrapper.properties
index 533f562..4a2d0c3 100644
--- a/test/android/gradle/wrapper/gradle-wrapper.properties
+++ b/test/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Thu Feb 17 12:43:50 CET 2022
+#Wed Jul 10 16:34:20 CEST 2024
distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
-zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/test/app/.metadata b/test/app/.metadata
index c7645f4..2b2521e 100644
--- a/test/app/.metadata
+++ b/test/app/.metadata
@@ -4,7 +4,27 @@
# This file should be version controlled and should not be manually edited.
version:
- revision: cad4d1333eb70e66fe8e993b10fa09306a48269d
- channel: master
+ revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
+ channel: "stable"
project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ - platform: ios
+ create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/test/app/android/app/build.gradle b/test/app/android/app/build.gradle
index 250bd86..c4a37e8 100644
--- a/test/app/android/app/build.gradle
+++ b/test/app/android/app/build.gradle
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 32
+ compileSdkVersion 33
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
diff --git a/test/app/ios/Flutter/AppFrameworkInfo.plist b/test/app/ios/Flutter/AppFrameworkInfo.plist
index 4f8d4d2..8c6e561 100644
--- a/test/app/ios/Flutter/AppFrameworkInfo.plist
+++ b/test/app/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 11.0
+ 12.0
diff --git a/test/app/ios/Podfile b/test/app/ios/Podfile
index a90a7ee..1535fd8 100644
--- a/test/app/ios/Podfile
+++ b/test/app/ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
-platform :ios, '11.0'
+platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -32,13 +32,17 @@ target 'Runner' do
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+# target 'RunnerTests' do
+# inherit! :search_paths
+# end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
- target.build_configurations.each do |build_configuration|
- build_configuration.build_settings['ENABLE_BITCODE'] = 'NO'
+ target.build_configurations.each do |config|
+ config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
+ config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'i386 arm64'
end
end
end
diff --git a/test/app/ios/Runner.xcodeproj/project.pbxproj b/test/app/ios/Runner.xcodeproj/project.pbxproj
index b336830..ab4fddb 100644
--- a/test/app/ios/Runner.xcodeproj/project.pbxproj
+++ b/test/app/ios/Runner.xcodeproj/project.pbxproj
@@ -10,10 +10,11 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
- 936021FAD72D80C63D28B147 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25BDC56193274910EAD034C3 /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+ 9999701FCCAFA5113A47A686 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F70B9B87078232C44FC6AD5 /* Pods_Runner.framework */; };
+ 9D2B91D62C73E84D00507EA6 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D2B91D52C73E84D00507EA6 /* StoreKit.framework */; };
9D6D515025E068480074ED65 /* AdServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D6D514F25E068480074ED65 /* AdServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
9D6D515225E0684E0074ED65 /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D6D515125E0684E0074ED65 /* AppTrackingTransparency.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
9DF8057224F92ED000A001CE /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DF8057124F92ED000A001CE /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
@@ -35,13 +36,12 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 25BDC56193274910EAD034C3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 18EDECBA3EA00A0A45C7CAD8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 529C72E42E3CCC1FD489E3E5 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 80BAFB441DF331A6DACA7F7C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ 8F70B9B87078232C44FC6AD5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -49,12 +49,14 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 9D2B91D52C73E84D00507EA6 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
9D6D514F25E068480074ED65 /* AdServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdServices.framework; path = System/Library/Frameworks/AdServices.framework; sourceTree = SDKROOT; };
9D6D515125E0684E0074ED65 /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = SDKROOT; };
9D6D515325E0685B0074ED65 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
9DF8056F24F92ECB00A001CE /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; };
9DF8057124F92ED000A001CE /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
- FCC573983476B33DDEA1A95A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ CE5E6A5DD57C2557BF4AFA42 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
+ FF5BD321F363541564281E03 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -62,10 +64,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 936021FAD72D80C63D28B147 /* Pods_Runner.framework in Frameworks */,
9DF8057224F92ED000A001CE /* AdSupport.framework in Frameworks */,
9D6D515025E068480074ED65 /* AdServices.framework in Frameworks */,
+ 9D2B91D62C73E84D00507EA6 /* StoreKit.framework in Frameworks */,
9D6D515225E0684E0074ED65 /* AppTrackingTransparency.framework in Frameworks */,
+ 9999701FCCAFA5113A47A686 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -75,12 +78,13 @@
1E115D8BF851445370C38B97 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 9D2B91D52C73E84D00507EA6 /* StoreKit.framework */,
9D6D515325E0685B0074ED65 /* CoreTelephony.framework */,
9D6D515125E0684E0074ED65 /* AppTrackingTransparency.framework */,
9D6D514F25E068480074ED65 /* AdServices.framework */,
9DF8057124F92ED000A001CE /* AdSupport.framework */,
9DF8056F24F92ECB00A001CE /* iAd.framework */,
- 25BDC56193274910EAD034C3 /* Pods_Runner.framework */,
+ 8F70B9B87078232C44FC6AD5 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "";
@@ -88,9 +92,9 @@
4546E54DAE5FCB3A6AACECE4 /* Pods */ = {
isa = PBXGroup;
children = (
- FCC573983476B33DDEA1A95A /* Pods-Runner.debug.xcconfig */,
- 529C72E42E3CCC1FD489E3E5 /* Pods-Runner.release.xcconfig */,
- 80BAFB441DF331A6DACA7F7C /* Pods-Runner.profile.xcconfig */,
+ 18EDECBA3EA00A0A45C7CAD8 /* Pods-Runner.debug.xcconfig */,
+ CE5E6A5DD57C2557BF4AFA42 /* Pods-Runner.release.xcconfig */,
+ FF5BD321F363541564281E03 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "";
@@ -147,14 +151,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- 6E5D8FD11C1DCB40AD631E85 /* [CP] Check Pods Manifest.lock */,
+ A4A93B42771458AC636E9690 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- 14E06C223349C49889E62E4E /* [CP] Embed Pods Frameworks */,
+ C8F5210F10347C261E5D8A13 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -171,7 +175,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1430;
+ LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -213,40 +217,38 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 14E06C223349C49889E62E4E /* [CP] Embed Pods Frameworks */ = {
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ name = "Thin Binary";
+ outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
- name = "Thin Binary";
+ name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
- 6E5D8FD11C1DCB40AD631E85 /* [CP] Check Pods Manifest.lock */ = {
+ A4A93B42771458AC636E9690 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -268,20 +270,22 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 9740EEB61CF901F6004384FC /* Run Script */ = {
+ C8F5210F10347C261E5D8A13 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
- alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
- inputPaths = (
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
- name = "Run Script";
- outputPaths = (
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -359,7 +363,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -395,8 +399,6 @@
"$(inherited)",
"-ObjC",
"-framework",
- "\"Adjust\"",
- "-framework",
"\"SystemConfiguration\"",
"-framework",
"\"adjust_sdk\"",
@@ -465,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -515,7 +517,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -553,8 +555,6 @@
"$(inherited)",
"-ObjC",
"-framework",
- "\"Adjust\"",
- "-framework",
"\"SystemConfiguration\"",
"-framework",
"\"adjust_sdk\"",
@@ -603,8 +603,6 @@
"$(inherited)",
"-ObjC",
"-framework",
- "\"Adjust\"",
- "-framework",
"\"SystemConfiguration\"",
"-framework",
"\"adjust_sdk\"",
diff --git a/test/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/test/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a6b826d..5e31d3d 100644
--- a/test/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/test/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
+ CADisableMinimumFrameDurationOnPhone
+
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
@@ -22,6 +24,8 @@
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
+ UIApplicationSupportsIndirectInputEvents
+
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
@@ -41,9 +45,5 @@
UIViewControllerBasedStatusBarAppearance
- CADisableMinimumFrameDurationOnPhone
-
- UIApplicationSupportsIndirectInputEvents
-
diff --git a/test/app/lib/command_executor.dart b/test/app/lib/command_executor.dart
index 05b89f6..118564f 100644
--- a/test/app/lib/command_executor.dart
+++ b/test/app/lib/command_executor.dart
@@ -22,7 +22,8 @@ import 'package:adjust_sdk/adjust_play_store_purchase.dart';
import 'package:adjust_sdk/adjust_session_failure.dart';
import 'package:adjust_sdk/adjust_session_success.dart';
import 'package:adjust_sdk/adjust_third_party_sharing.dart';
-import 'package:adjust_sdk/adjust_purchase_verification_info.dart';
+import 'package:adjust_sdk/adjust_purchase_verification_result.dart';
+import 'package:adjust_sdk/adjust_deeplink.dart';
import 'package:test_app/command.dart';
import 'package:test_lib/test_lib.dart';
@@ -59,7 +60,7 @@ class CommandExecutor {
_config();
break;
case 'start':
- _start();
+ _initSdk();
break;
case 'event':
_event();
@@ -76,35 +77,26 @@ class CommandExecutor {
case 'setEnabled':
_setEnabled();
break;
- case 'setReferrer':
- _setReferrer();
- break;
- case 'sendReferrer':
- _setReferrer();
- break;
case 'setOfflineMode':
_setOfflineMode();
break;
- case 'sendFirstPackages':
- _sendFirstPackages();
- break;
- case 'addSessionCallbackParameter':
- _addSessionCallbackParameter();
+ case 'addGlobalCallbackParameter':
+ _addGlobalCallbackParameter();
break;
- case 'addSessionPartnerParameter':
- _addSessionPartnerParameter();
+ case 'addGlobalPartnerParameter':
+ _addGlobalPartnerParameter();
break;
- case 'removeSessionCallbackParameter':
- _removeSessionCallbackParameter();
+ case 'removeGlobalCallbackParameter':
+ _removeGlobalCallbackParameter();
break;
- case 'removeSessionPartnerParameter':
- _removeSessionPartnerParameter();
+ case 'removeGlobalPartnerParameter':
+ _removeGlobalPartnerParameter();
break;
- case 'resetSessionCallbackParameters':
- _resetSessionCallbackParameters();
+ case 'removeGlobalCallbackParameters':
+ _removeGlobalCallbackParameters();
break;
- case 'resetSessionPartnerParameters':
- _resetSessionPartnerParameters();
+ case 'removeGlobalPartnerParameters':
+ _removeGlobalPartnerParameters();
break;
case 'setPushToken':
_setPushToken();
@@ -115,12 +107,6 @@ class CommandExecutor {
case 'gdprForgetMe':
_gdprForgetMe();
break;
- case 'disableThirdPartySharing':
- _disableThirdPartySharing();
- break;
- case 'trackAdRevenue':
- _trackAdRevenue();
- break;
case 'trackSubscription':
_trackSubscription();
break;
@@ -130,8 +116,8 @@ class CommandExecutor {
case 'measurementConsent':
_trackMeasurementConsent();
break;
- case 'trackAdRevenueV2':
- _trackAdRevenueV2();
+ case 'trackAdRevenue':
+ _trackAdRevenue();
break;
case 'getLastDeeplink':
_getLastDeeplink();
@@ -139,9 +125,15 @@ class CommandExecutor {
case 'verifyPurchase':
_verifyPurchase();
break;
+ case 'verifyTrack':
+ _verifyTrack();
+ break;
case 'processDeeplink':
_processDeeplink();
break;
+ case 'attributionGetter':
+ _attributionGetter();
+ break;
}
}
@@ -183,6 +175,14 @@ class CommandExecutor {
testOptions['noBackoffWait'] =
_command.getFirstParameterValue('noBackoffWait');
}
+ if (_command.containsParameter("doNotIgnoreSystemLifecycleBootstrap")) {
+ String? doNotIgnoreSystemLifecycleBootstrapString =
+ _command.getFirstParameterValue("doNotIgnoreSystemLifecycleBootstrap");
+ bool doNotIgnoreSystemLifecycleBootstrap = (doNotIgnoreSystemLifecycleBootstrapString == 'true');
+ if (doNotIgnoreSystemLifecycleBootstrap) {
+ testOptions['ignoreSystemLifecycleBootstrap'] = false;
+ }
+ }
if (_command.containsParameter('adServicesFrameworkEnabled')) {
testOptions['adServicesFrameworkEnabled'] =
_command.getFirstParameterValue('adServicesFrameworkEnabled');
@@ -306,81 +306,45 @@ class CommandExecutor {
_command.getFirstParameterValue('externalDeviceId');
}
- if (_command.containsParameter('appSecret')) {
- List appSecretArray = _command.getParamteters('appSecret')!;
- bool appSecretValid = true;
- for (String appSecretData in appSecretArray) {
- if (appSecretData.length == 0) {
- appSecretValid = false;
- break;
- }
- }
-
- if (appSecretValid) {
- num secretId = num.parse(appSecretArray[0]);
- num info1 = num.parse(appSecretArray[1]);
- num info2 = num.parse(appSecretArray[2]);
- num info3 = num.parse(appSecretArray[3]);
- num info4 = num.parse(appSecretArray[4]);
- adjustConfig!.setAppSecret(secretId, info1, info2, info3, info4);
- }
- }
-
- if (_command.containsParameter('delayStart')) {
- adjustConfig!.delayStart =
- double.parse(_command.getFirstParameterValue('delayStart')!);
- }
-
- if (_command.containsParameter('deviceKnown')) {
- adjustConfig!.isDeviceKnown =
- _command.getFirstParameterValue('deviceKnown') == 'true';
- }
-
- if (_command.containsParameter('eventBufferingEnabled')) {
- adjustConfig!.eventBufferingEnabled =
- _command.getFirstParameterValue('eventBufferingEnabled') == 'true';
- }
-
if (_command.containsParameter('coppaCompliant')) {
- adjustConfig!.coppaCompliantEnabled =
- _command.getFirstParameterValue('coppaCompliant') == 'true';
+ adjustConfig!.isCoppaComplianceEnabled =
+ _command.getFirstParameterValue('coppaCompliant') == 'true';
}
if (_command.containsParameter('playStoreKids')) {
- adjustConfig!.playStoreKidsAppEnabled =
- _command.getFirstParameterValue('playStoreKids') == 'true';
- }
-
- if (_command.containsParameter('finalAttributionEnabled')) {
- adjustConfig!.finalAndroidAttributionEnabled =
- _command.getFirstParameterValue('finalAttributionEnabled') == 'true';
+ adjustConfig!.isPlayStoreKidsComplianceEnabled =
+ _command.getFirstParameterValue('playStoreKids') == 'true';
}
if (_command.containsParameter('sendInBackground')) {
- adjustConfig!.sendInBackground =
- _command.getFirstParameterValue('sendInBackground') == 'true';
+ if(_command.getFirstParameterValue('sendInBackground') == 'true')
+ adjustConfig!.isSendingInBackgroundEnabled = true;
}
if (_command.containsParameter('allowAdServicesInfoReading')) {
- adjustConfig!.allowAdServicesInfoReading =
- _command.getFirstParameterValue('allowAdServicesInfoReading') ==
- 'true';
+ if(_command.getFirstParameterValue('allowAdServicesInfoReading') ==
+ 'false'){
+ adjustConfig!.isAdServicesEnabled = false;
+ }
+ }
+
+ if (_command.containsParameter('eventDeduplicationIdsMaxSize')) {
+ String? maxIds = _command.getFirstParameterValue("eventDeduplicationIdsMaxSize");
+ int maxIdCount = int.parse(maxIds!);
+ adjustConfig!.eventDeduplicationIdsMaxSize = maxIdCount;
}
if (_command.containsParameter('allowSkAdNetworkHandling')) {
if (_command.getFirstParameterValue('allowSkAdNetworkHandling') ==
'false') {
- adjustConfig!.deactivateSKAdNetworkHandling();
+ adjustConfig!.isSkanAttributionEnabled = false;
}
}
if (_command.containsParameter('allowIdfaReading')) {
- adjustConfig!.allowIdfaReading =
- _command.getFirstParameterValue('allowIdfaReading') == 'true';
- }
-
- if (_command.containsParameter('userAgent')) {
- adjustConfig!.userAgent = _command.getFirstParameterValue('userAgent');
+ if(_command.getFirstParameterValue('allowIdfaReading') == 'false') {
+ adjustConfig!.isIdfaReadingEnabled = false;
+ }
}
if (_command.containsParameter('attConsentWaitingSeconds')) {
@@ -395,18 +359,19 @@ class CommandExecutor {
adjustConfig.eventSuccessCallback = null;
adjustConfig.eventFailureCallback = null;
adjustConfig.deferredDeeplinkCallback = null;
+ adjustConfig.skanUpdatedCallback = null;
// TODO: Deeplinking in Flutter example.
// https://github.com/flutter/flutter/issues/8711#issuecomment-304681212
if (_command.containsParameter('deferredDeeplinkCallback')) {
String? localBasePath = _extraPath;
- adjustConfig.launchDeferredDeeplink =
+ adjustConfig.isDeferredDeeplinkOpeningEnabled =
_command.getFirstParameterValue('deferredDeeplinkCallback') == 'true';
print(
- '[CommandExecutor]: Deferred deeplink callback, launchDeferredDeeplink: ${adjustConfig.launchDeferredDeeplink}');
- adjustConfig.deferredDeeplinkCallback = (String? uri) {
- print('[CommandExecutor]: Sending deeplink info to server: $uri');
- TestLib.addInfoToSend('deeplink', uri);
+ '[CommandExecutor]: Deferred deeplink callback, isDeferredDeeplinkOpeningEnabled: ${adjustConfig.isDeferredDeeplinkOpeningEnabled}');
+ adjustConfig.deferredDeeplinkCallback = (String? deeplink) {
+ print('[CommandExecutor]: Sending deeplink info to server: $deeplink');
+ TestLib.addInfoToSend('deeplink', deeplink);
TestLib.sendInfoToServer(localBasePath);
};
}
@@ -415,18 +380,17 @@ class CommandExecutor {
String? localBasePath = _extraPath;
adjustConfig.attributionCallback = (AdjustAttribution attribution) {
print('[CommandExecutor]: Attribution Callback: $attribution');
- TestLib.addInfoToSend('trackerToken', attribution.trackerToken);
- TestLib.addInfoToSend('trackerName', attribution.trackerName);
+ TestLib.addInfoToSend('tracker_token', attribution.trackerToken);
+ TestLib.addInfoToSend('tracker_name', attribution.trackerName);
TestLib.addInfoToSend('network', attribution.network);
TestLib.addInfoToSend('campaign', attribution.campaign);
TestLib.addInfoToSend('adgroup', attribution.adgroup);
TestLib.addInfoToSend('creative', attribution.creative);
- TestLib.addInfoToSend('clickLabel', attribution.clickLabel);
- TestLib.addInfoToSend('adid', attribution.adid);
- TestLib.addInfoToSend('costType', attribution.costType);
- TestLib.addInfoToSend('costAmount', attribution.costAmount.toString());
- TestLib.addInfoToSend('costCurrency', attribution.costCurrency);
- TestLib.addInfoToSend('fbInstallReferrer', attribution.fbInstallReferrer);
+ TestLib.addInfoToSend('click_label', attribution.clickLabel);
+ TestLib.addInfoToSend('cost_type', attribution.costType);
+ TestLib.addInfoToSend('cost_amount', attribution.costAmount.toString());
+ TestLib.addInfoToSend('cost_currency', attribution.costCurrency);
+ TestLib.addInfoToSend('fb_install_referrer', attribution.fbInstallReferrer);
TestLib.sendInfoToServer(localBasePath);
};
}
@@ -513,12 +477,19 @@ class CommandExecutor {
};
}
- if (_command.containsParameter('urlStrategy')) {
- adjustConfig.urlStrategy = _command.getFirstParameterValue('urlStrategy');
+ if (_command.containsParameter('skanCallback')) {
+ String? localBasePath = _extraPath;
+ adjustConfig.skanUpdatedCallback =
+ (Map data) {
+ print(
+ '[CommandExecutor]: Skan Callback: $data');
+ data.forEach((k, v) => TestLib.addInfoToSend(k, v));
+ TestLib.sendInfoToServer(localBasePath);
+ };
}
}
- void _start() {
+ void _initSdk() {
_config();
int configNumber = 0;
if (_command.containsParameter('configName')) {
@@ -527,7 +498,7 @@ class CommandExecutor {
}
AdjustConfig adjustConfig = _savedConfigs[configNumber]!;
- Adjust.start(adjustConfig);
+ Adjust.initSdk(adjustConfig);
_savedConfigs.remove(configNumber);
}
@@ -577,15 +548,15 @@ class CommandExecutor {
if (_command.containsParameter('orderId')) {
adjustEvent!.transactionId = _command.getFirstParameterValue('orderId');
}
- if (_command.containsParameter('receipt')) {
- adjustEvent!.receipt = _command.getFirstParameterValue('receipt');
- }
if (_command.containsParameter('productId')) {
adjustEvent!.productId = _command.getFirstParameterValue('productId');
}
if (_command.containsParameter('transactionId')) {
adjustEvent!.transactionId = _command.getFirstParameterValue('transactionId');
}
+ if (_command.containsParameter('deduplicationId')) {
+ adjustEvent!.deduplicationId = _command.getFirstParameterValue('deduplicationId');
+ }
if (_command.containsParameter('purchaseToken')) {
adjustEvent!.purchaseToken = _command.getFirstParameterValue('purchaseToken');
}
@@ -618,21 +589,20 @@ class CommandExecutor {
void _setEnabled() {
bool isEnabled = _command.getFirstParameterValue('enabled') == 'true';
- Adjust.setEnabled(isEnabled);
- }
-
- void _setReferrer() {
- String referrer = _command.getFirstParameterValue('referrer')!;
- Adjust.setReferrer(referrer);
+ if(isEnabled) {
+ Adjust.enable();
+ }else{
+ Adjust.disable();
+ }
}
void _setOfflineMode() {
bool isEnabled = _command.getFirstParameterValue('enabled') == 'true';
- Adjust.setOfflineMode(isEnabled);
- }
-
- void _sendFirstPackages() {
- Adjust.sendFirstPackages();
+ if(isEnabled){
+ Adjust.switchToOfflineMode();
+ }else{
+ Adjust.switchBackToOnlineMode();
+ }
}
void _setPushToken() {
@@ -642,18 +612,15 @@ class CommandExecutor {
void _openDeeplink() {
String deeplink = _command.getFirstParameterValue('deeplink')!;
- Adjust.appWillOpenUrl(deeplink);
+ AdjustDeeplink adjustDeeplink = new AdjustDeeplink(deeplink);
+ Adjust.processDeeplink(adjustDeeplink);
}
void _gdprForgetMe() {
Adjust.gdprForgetMe();
}
- void _disableThirdPartySharing() {
- Adjust.disableThirdPartySharing();
- }
-
- void _addSessionCallbackParameter() {
+ void _addGlobalCallbackParameter() {
if (!_command.containsParameter('KeyValue')) {
return;
}
@@ -662,11 +629,11 @@ class CommandExecutor {
for (int i = 0; i < keyValuePairs.length; i = i + 2) {
String key = keyValuePairs[i];
String value = keyValuePairs[i + 1];
- Adjust.addSessionCallbackParameter(key, value);
+ Adjust.addGlobalCallbackParameter(key, value);
}
}
- void _addSessionPartnerParameter() {
+ void _addGlobalPartnerParameter() {
if (!_command.containsParameter('KeyValue')) {
return;
}
@@ -675,11 +642,11 @@ class CommandExecutor {
for (int i = 0; i < keyValuePairs.length; i = i + 2) {
String key = keyValuePairs[i];
String value = keyValuePairs[i + 1];
- Adjust.addSessionPartnerParameter(key, value);
+ Adjust.addGlobalPartnerParameter(key, value);
}
}
- void _removeSessionCallbackParameter() {
+ void _removeGlobalCallbackParameter() {
if (!_command.containsParameter('key')) {
return;
}
@@ -687,11 +654,11 @@ class CommandExecutor {
List keys = _command.getParamteters('key')!;
for (int i = 0; i < keys.length; i = i + 1) {
String key = keys[i];
- Adjust.removeSessionCallbackParameter(key);
+ Adjust.removeGlobalCallbackParameter(key);
}
}
- void _removeSessionPartnerParameter() {
+ void _removeGlobalPartnerParameter() {
if (!_command.containsParameter('key')) {
return;
}
@@ -699,39 +666,32 @@ class CommandExecutor {
List keys = _command.getParamteters('key')!;
for (int i = 0; i < keys.length; i = i + 1) {
String key = keys[i];
- Adjust.removeSessionPartnerParameter(key);
+ Adjust.removeGlobalPartnerParameter(key);
}
}
- void _resetSessionCallbackParameters() {
- Adjust.resetSessionCallbackParameters();
+ void _removeGlobalCallbackParameters() {
+ Adjust.removeGlobalCallbackParameters();
}
- void _resetSessionPartnerParameters() {
- Adjust.resetSessionPartnerParameters();
- }
-
- void _trackAdRevenue() {
- String source = _command.getFirstParameterValue('adRevenueSource')!;
- String payload = _command.getFirstParameterValue('adRevenueJsonString')!;
- Adjust.trackAdRevenue(source, payload);
+ void _removeGlobalPartnerParameters() {
+ Adjust.removeGlobalPartnerParameters();
}
void _trackSubscription() {
if (Platform.isIOS) {
- String? price = _command.getFirstParameterValue('revenue');
- String? currency = _command.getFirstParameterValue('currency');
- String? transactionId = _command.getFirstParameterValue('transactionId');
- String? receipt = _command.getFirstParameterValue('receipt');
+ String price = _command.getFirstParameterValue('revenue')!;
+ String currency = _command.getFirstParameterValue('currency')!;
+ String transactionId = _command.getFirstParameterValue('transactionId')!;
String transactionDate =
_command.getFirstParameterValue('transactionDate')!;
String salesRegion = _command.getFirstParameterValue('salesRegion')!;
AdjustAppStoreSubscription subscription = new AdjustAppStoreSubscription(
- price, currency, transactionId, receipt);
+ price, currency, transactionId);
- subscription.setTransactionDate(transactionDate);
- subscription.setSalesRegion(salesRegion);
+ subscription.transactionDate = transactionDate;
+ subscription.salesRegion = salesRegion;
if (_command.containsParameter('callbackParams')) {
List callbackParams =
@@ -757,18 +717,18 @@ class CommandExecutor {
Adjust.trackAppStoreSubscription(subscription);
} else if (Platform.isAndroid) {
- String? price = _command.getFirstParameterValue('revenue');
- String? currency = _command.getFirstParameterValue('currency');
- String? sku = _command.getFirstParameterValue('productId');
- String? signature = _command.getFirstParameterValue('receipt');
- String? purchaseToken = _command.getFirstParameterValue('purchaseToken');
- String? orderId = _command.getFirstParameterValue('transactionId');
+ String price = _command.getFirstParameterValue('revenue')!;
+ String currency = _command.getFirstParameterValue('currency')!;
+ String sku = _command.getFirstParameterValue('productId')!;
+ String signature = _command.getFirstParameterValue('receipt')!;
+ String purchaseToken = _command.getFirstParameterValue('purchaseToken')!;
+ String orderId = _command.getFirstParameterValue('transactionId')!;
String purchaseTime = _command.getFirstParameterValue('transactionDate')!;
AdjustPlayStoreSubscription subscription =
new AdjustPlayStoreSubscription(
price, currency, sku, orderId, signature, purchaseToken);
- subscription.setPurchaseTime(purchaseTime);
+ subscription.purchaseTime = purchaseTime;
if (_command.containsParameter('callbackParams')) {
List callbackParams =
@@ -838,7 +798,7 @@ class CommandExecutor {
Adjust.trackMeasurementConsent(isEnabled);
}
- void _trackAdRevenueV2() {
+ void _trackAdRevenue() {
String source = _command.getFirstParameterValue('adRevenueSource')!;
AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(source);
@@ -883,7 +843,7 @@ class CommandExecutor {
_command.getFirstParameterValue('adRevenueNetwork');
}
- Adjust.trackAdRevenueNew(adjustAdRevenue);
+ Adjust.trackAdRevenue(adjustAdRevenue);
}
void _getLastDeeplink() {
@@ -898,12 +858,11 @@ class CommandExecutor {
void _verifyPurchase() {
if (Platform.isIOS) {
- String? receipt = _command.getFirstParameterValue('receipt');
- String? productId = _command.getFirstParameterValue('productId');
- String? transactionId = _command.getFirstParameterValue('transactionId');
+ String productId = _command.getFirstParameterValue('productId')!;
+ String transactionId = _command.getFirstParameterValue('transactionId')!;
AdjustAppStorePurchase purchase =
- new AdjustAppStorePurchase(receipt, productId, transactionId);
+ new AdjustAppStorePurchase(productId, transactionId);
Adjust.verifyAppStorePurchase(purchase).then((result) {
String? localBasePath = _basePath;
@@ -913,8 +872,8 @@ class CommandExecutor {
TestLib.sendInfoToServer(localBasePath);
});
} else if (Platform.isAndroid) {
- String? productId = _command.getFirstParameterValue('productId');
- String? purchaseToken = _command.getFirstParameterValue('purchaseToken');
+ String productId = _command.getFirstParameterValue('productId')!;
+ String purchaseToken = _command.getFirstParameterValue('purchaseToken')!;
AdjustPlayStorePurchase purchase =
new AdjustPlayStorePurchase(productId, purchaseToken);
@@ -929,12 +888,67 @@ class CommandExecutor {
}
}
+ void _verifyTrack() {
+ _event();
+ int eventNumber = 0;
+ if (_command.containsParameter("eventName")) {
+ String eventName = _command.getFirstParameterValue("eventName")!;
+ eventNumber = int.parse(eventName.substring(eventName.length - 1));
+ }
+
+ AdjustEvent adjustEvent = _savedEvents[eventNumber]!;
+
+ if (Platform.isIOS) {
+ Adjust.verifyAndTrackAppStorePurchase(adjustEvent).then((result) {
+ String? localBasePath = _basePath;
+ TestLib.addInfoToSend('verification_status', result?.verificationStatus);
+ TestLib.addInfoToSend('code', result?.code.toString());
+ TestLib.addInfoToSend('message', result?.message);
+ TestLib.sendInfoToServer(localBasePath);
+ });
+ } else if (Platform.isAndroid) {
+ Adjust.verifyAndTrackPlayStorePurchase(adjustEvent).then((result) {
+ String? localBasePath = _basePath;
+ TestLib.addInfoToSend('verification_status', result?.verificationStatus);
+ TestLib.addInfoToSend('code', result?.code.toString());
+ TestLib.addInfoToSend('message', result?.message);
+ TestLib.sendInfoToServer(localBasePath);
+ });
+ }
+
+ _savedEvents.remove(eventNumber);
+ }
+
void _processDeeplink() {
String deeplink = _command.getFirstParameterValue('deeplink')!;
- Adjust.processDeeplink(deeplink).then((resolvedLink) {
+ AdjustDeeplink adjustDeeplink = new AdjustDeeplink(deeplink);
+ Adjust.processAndResolveDeeplink(adjustDeeplink).then((resolvedLink) {
String? localBasePath = _basePath;
TestLib.addInfoToSend('resolved_link', resolvedLink);
TestLib.sendInfoToServer(localBasePath);
});
}
+
+ void _attributionGetter() {
+ Adjust.getAttribution().then((attribution){
+ if(attribution != null) {
+ Map fields = new Map();
+ fields["tracker_token"] = attribution.trackerToken;
+ fields["tracker_name"] = attribution.trackerName;
+ fields["network"] = attribution.network;
+ fields["campaign"] = attribution.campaign;
+ fields["adgroup"] = attribution.adgroup;
+ fields["creative"] = attribution.creative;
+ fields["click_label"] = attribution.clickLabel;
+ fields["cost_type"] = attribution.costType;
+ fields["cost_amount"] = attribution.costAmount?.toString();
+ fields["cost_currency"] = attribution.costCurrency;
+ fields["fb_install_referrer"] = attribution.fbInstallReferrer;
+ fields.forEach((key, value) {
+ TestLib.addInfoToSend(key, value);
+ });
+ TestLib.sendInfoToServer(_basePath);
+ }
+ });
+ }
}
diff --git a/test/app/lib/main.dart b/test/app/lib/main.dart
index 6a5c151..edb8a25 100644
--- a/test/app/lib/main.dart
+++ b/test/app/lib/main.dart
@@ -25,13 +25,14 @@ class _MyAppState extends State {
void initState() {
super.initState();
- String _address = '192.168.86.53';
if (Platform.isAndroid) {
+ String _address = '192.168.86.80';
String _protocol = 'https';
String _port = '8443';
_overwriteUrl = _protocol + '://' + _address + ':' + _port;
_controlUrl = 'ws://' + _address + ':1987';
} else {
+ String _address = '192.168.86.80';
String _protocol = 'http';
String _port = '8080';
_overwriteUrl = _protocol + '://' + _address + ':' + _port;
@@ -69,8 +70,8 @@ class _MyAppState extends State {
buildCupertinoButton(
'Start Test Session',
() => Adjust.getSdkVersion().then((sdkVersion) {
- // TestLib.addTestDirectory('deeplink-getter');
- // TestLib.addTest('Test_Event_Revenue_invalid');
+ // TestLib.addTestDirectory('event-callbacks');
+ // TestLib.addTest('Test_AttributionGetter_after_install');
TestLib.startTestSession(sdkVersion);
}))
])))
diff --git a/test/ios/AdjustTestLibrary.framework/AdjustTestLibrary b/test/ios/AdjustTestLibrary.framework/AdjustTestLibrary
deleted file mode 120000
index 3179117..0000000
--- a/test/ios/AdjustTestLibrary.framework/AdjustTestLibrary
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/AdjustTestLibrary
\ No newline at end of file
diff --git a/test/ios/AdjustTestLibrary.framework/AdjustTestLibrary b/test/ios/AdjustTestLibrary.framework/AdjustTestLibrary
new file mode 100644
index 0000000..c05ecb0
Binary files /dev/null and b/test/ios/AdjustTestLibrary.framework/AdjustTestLibrary differ
diff --git a/test/ios/AdjustTestLibrary.framework/Headers b/test/ios/AdjustTestLibrary.framework/Headers
deleted file mode 120000
index a177d2a..0000000
--- a/test/ios/AdjustTestLibrary.framework/Headers
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/Headers
\ No newline at end of file
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLBlockingQueue.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLBlockingQueue.h
new file mode 100644
index 0000000..d61fddb
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLBlockingQueue.h
@@ -0,0 +1,27 @@
+//
+// ATLBlockingQueue.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 11.01.18.
+// Copyright © 2018 adjust. All rights reserved.
+//
+
+#import
+#import "ATLUtil.h"
+
+@interface ATLBlockingQueue : NSObject
+
+/**
+ * Enqueues an object to the queue.
+ * @param object Object to enqueue
+ */
+- (void)enqueue:(id)object;
+
+/**
+ * Dequeues an object from the queue. This method will block.
+ */
+- (id)dequeue;
+
+- (void)teardown;
+
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLConstants.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLConstants.h
new file mode 100644
index 0000000..52add01
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLConstants.h
@@ -0,0 +1,30 @@
+//
+// ATLConstants.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 20.04.17.
+// Copyright © 2017 adjust. All rights reserved.
+//
+
+#ifndef ATLConstants_h
+#define ATLConstants_h
+
+static int const ONE_SECOND = 1000;
+static int const ONE_MINUTE = 60 * ONE_SECOND;
+
+static NSString * const TEST_LIBRARY_CLASSNAME = @"TestLibrary";
+static NSString * const ADJUST_CLASSNAME = @"Adjust";
+static NSString * const WAIT_FOR_CONTROL = @"control";
+static NSString * const WAIT_FOR_SLEEP = @"sleep";
+static NSString * const BASE_PATH_PARAM = @"basePath";
+static NSString * const TEST_NAME_PARAM = @"basePath";
+static NSString * const TEST_SESSION_ID_HEADER = @"Test-Session-Id";
+
+// web socket values
+static NSString * const SIGNAL_INFO = @"info";
+static NSString * const SIGNAL_INIT_TEST_SESSION = @"init-test-session";
+static NSString * const SIGNAL_END_WAIT = @"end-wait";
+static NSString * const SIGNAL_CANCEL_CURRENT_TEST = @"cancel-current-test";
+static NSString * const SIGNAL_UNKNOWN = @"unknown";
+
+#endif /* ATLConstants_h */
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLControlSignal.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLControlSignal.h
new file mode 100644
index 0000000..22f0ab7
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLControlSignal.h
@@ -0,0 +1,38 @@
+//
+// ATLControlSignal.h
+// AdjustTestLibrary
+//
+// Created by Serj on 20.02.19.
+// Copyright © 2019 adjust. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef enum {
+ ATLSignalTypeInfo = 1,
+ ATLSignalTypeInitTestSession = 2,
+ ATLSignalTypeEndWait = 3,
+ ATLSignalTypeCancelCurrentTest = 4,
+ ATLSignalTypeUnknown = 5
+} ATLSignalType;
+
+@interface ATLControlSignal : NSObject
+
+- (id)initWithSignalType:(ATLSignalType)signalType;
+
+- (id)initWithSignalType:(ATLSignalType)signalType
+ andSignalValue:(NSString*)signalValue;
+
+- (id)initWithJson:(NSString*)json;
+
+- (NSString*)toJson;
+
+- (NSString*)getValue;
+
+- (ATLSignalType)getType;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLControlWebSocketClient.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLControlWebSocketClient.h
new file mode 100644
index 0000000..0dd5e21
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLControlWebSocketClient.h
@@ -0,0 +1,26 @@
+//
+// ATLControlWebSocketClient.h
+// AdjustTestLibrary
+//
+// Created by Serj on 20.02.19.
+// Copyright © 2019 adjust. All rights reserved.
+//
+
+#import
+#import "PocketSocket/PSWebSocket.h"
+#import "ATLTestLibrary.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ATLControlWebSocketClient : NSObject
+
+- (void)initializeWebSocketWithControlUrl:(NSString*)controlUrl
+ andTestLibrary:(ATLTestLibrary*)testLibrary;
+
+- (void)reconnectIfNeeded;
+
+- (void)sendInitTestSessionSignal:(NSString*)testSessionId;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLNetworking.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLNetworking.h
new file mode 100644
index 0000000..90c2a10
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLNetworking.h
@@ -0,0 +1,39 @@
+//
+// ATLNetworking.h
+// AdjustTestLibrary
+//
+// Created by Pedro Silva on 24.05.24.
+// Copyright © 2024 adjust. All rights reserved.
+//
+
+#import
+
+@interface ATLHttpResponse : NSObject
+
+@property (nonatomic, nullable, strong) NSString * responseString;
+@property (nonatomic, nullable, strong) id jsonFoundation;
+@property (nonatomic, nullable, strong) NSDictionary *headerFields;
+@property (nonatomic, assign) NSInteger statusCode;
+
+@end
+
+@interface ATLHttpRequest : NSObject
+
+@property (nonatomic, nonnull, readonly, strong) NSString *path;
+@property (nonatomic, nullable, readonly, strong) NSString *base;
+@property (nonatomic, nullable, strong) NSString *bodyString;
+@property (nonatomic, nullable, strong) NSDictionary *headerFields;
+
+- (nonnull id)initWithPath:(nonnull NSString *)path
+ base:(nullable NSString *)base;
+@end
+
+typedef void (^httpResponseHandler)(ATLHttpResponse *_Nonnull httpResponse);
+
+@interface ATLNetworking : NSObject
+
+- (void)sendPostRequestWithData:(nonnull ATLHttpRequest *)requestData
+ baseUrl:(nonnull NSURL *)baseUrl
+ responseHandler:(nonnull httpResponseHandler)responseHandler;
+
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLTestLibrary.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLTestLibrary.h
new file mode 100644
index 0000000..14f763b
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLTestLibrary.h
@@ -0,0 +1,56 @@
+//
+// AdjustTestLibrary.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 18.04.17.
+// Copyright © 2017 adjust. All rights reserved.
+//
+
+#import
+#import "ATLNetworking.h"
+#import "ATLBlockingQueue.h"
+
+@protocol AdjustCommandDelegate
+@optional
+- (void)executeCommand:(NSString *)className
+ methodName:(NSString *)methodName
+ parameters:(NSDictionary *)parameters;
+
+- (void)executeCommand:(NSString *)className
+ methodName:(NSString *)methodName
+ jsonParameters:(NSString *)jsonParameters;
+
+- (void)executeCommandRawJson:(NSString *)json;
+@end
+
+@interface ATLTestLibrary : NSObject
+
+- (NSString *)currentBasePath;
+
+- (ATLBlockingQueue *)waitControlQueue;
+
+- (void)addTest:(NSString *)testName;
+
+- (void)addTestDirectory:(NSString *)testDirectory;
+
+- (void)startTestSession:(NSString *)clientSdk;
+
+- (void)resetTestLibrary;
+
+- (void)readResponse:(ATLHttpResponse *)httpResponse;
+
+- (void)addInfoToSend:(NSString *)key
+ value:(NSString *)value;
+
+- (void)sendInfoToServer:(NSString *)basePath;
+
+- (void)signalEndWaitWithReason:(NSString *)reason;
+
+- (void)cancelTestAndGetNext;
+
+- (void)doNotExitAfterEnd;
+
++ (ATLTestLibrary *)testLibraryWithBaseUrl:(NSString *)baseUrl
+ andControlUrl:(NSString *)controlUrl
+ andCommandDelegate:(NSObject *)commandDelegate;
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Headers/ATLUtil.h b/test/ios/AdjustTestLibrary.framework/Headers/ATLUtil.h
new file mode 100644
index 0000000..cffe946
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Headers/ATLUtil.h
@@ -0,0 +1,30 @@
+//
+// ATLUtil.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 18.04.17.
+// Copyright © 2017 adjust. All rights reserved.
+//
+
+#import
+
+typedef void (^selfInjectedBlock)(id);
+typedef void (^operationBlock)(NSBlockOperation *);
+
+@interface ATLUtil : NSObject
+
++ (void)debug:(NSString *)format, ...;
++ (void)launchInQueue:(dispatch_queue_t)queue
+ selfInject:(id)selfInject
+ block:(selfInjectedBlock)block;
++ (void)addOperationAfterLast:(NSOperationQueue *)operationQueue
+ block:(dispatch_block_t)block;
++ (void)addOperationAfterLast:(NSOperationQueue *)operationQueue
+ blockWithOperation:(operationBlock)blockWithOperation;
++ (BOOL)isNull:(id)value;
++ (NSString *)adjTrim:(NSString *)value;
++ (NSString *)formatDate:(NSDate *)value;
++ (NSString *)parseDictionaryToJsonString:(NSDictionary *) dictionary;
++ (NSString *)appendBasePath:(NSString *)basePath path:(NSString *)path;
++ (NSString *)queryString:(NSDictionary *)parameters;
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/A/AdjustTestLibrary b/test/ios/AdjustTestLibrary.framework/Versions/A/AdjustTestLibrary
index a590e5f..c05ecb0 100644
Binary files a/test/ios/AdjustTestLibrary.framework/Versions/A/AdjustTestLibrary and b/test/ios/AdjustTestLibrary.framework/Versions/A/AdjustTestLibrary differ
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLControlSignal.h b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLControlSignal.h
new file mode 100644
index 0000000..22f0ab7
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLControlSignal.h
@@ -0,0 +1,38 @@
+//
+// ATLControlSignal.h
+// AdjustTestLibrary
+//
+// Created by Serj on 20.02.19.
+// Copyright © 2019 adjust. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef enum {
+ ATLSignalTypeInfo = 1,
+ ATLSignalTypeInitTestSession = 2,
+ ATLSignalTypeEndWait = 3,
+ ATLSignalTypeCancelCurrentTest = 4,
+ ATLSignalTypeUnknown = 5
+} ATLSignalType;
+
+@interface ATLControlSignal : NSObject
+
+- (id)initWithSignalType:(ATLSignalType)signalType;
+
+- (id)initWithSignalType:(ATLSignalType)signalType
+ andSignalValue:(NSString*)signalValue;
+
+- (id)initWithJson:(NSString*)json;
+
+- (NSString*)toJson;
+
+- (NSString*)getValue;
+
+- (ATLSignalType)getType;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLNetworking.h b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLNetworking.h
new file mode 100644
index 0000000..90c2a10
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLNetworking.h
@@ -0,0 +1,39 @@
+//
+// ATLNetworking.h
+// AdjustTestLibrary
+//
+// Created by Pedro Silva on 24.05.24.
+// Copyright © 2024 adjust. All rights reserved.
+//
+
+#import
+
+@interface ATLHttpResponse : NSObject
+
+@property (nonatomic, nullable, strong) NSString * responseString;
+@property (nonatomic, nullable, strong) id jsonFoundation;
+@property (nonatomic, nullable, strong) NSDictionary *headerFields;
+@property (nonatomic, assign) NSInteger statusCode;
+
+@end
+
+@interface ATLHttpRequest : NSObject
+
+@property (nonatomic, nonnull, readonly, strong) NSString *path;
+@property (nonatomic, nullable, readonly, strong) NSString *base;
+@property (nonatomic, nullable, strong) NSString *bodyString;
+@property (nonatomic, nullable, strong) NSDictionary *headerFields;
+
+- (nonnull id)initWithPath:(nonnull NSString *)path
+ base:(nullable NSString *)base;
+@end
+
+typedef void (^httpResponseHandler)(ATLHttpResponse *_Nonnull httpResponse);
+
+@interface ATLNetworking : NSObject
+
+- (void)sendPostRequestWithData:(nonnull ATLHttpRequest *)requestData
+ baseUrl:(nonnull NSURL *)baseUrl
+ responseHandler:(nonnull httpResponseHandler)responseHandler;
+
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestInfo.h b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestInfo.h
deleted file mode 100644
index 06ac38a..0000000
--- a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestInfo.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// ATLTestInfo.h
-// AdjustTestLibrary
-//
-// Created by Pedro on 01.11.17.
-// Copyright © 2017 adjust. All rights reserved.
-//
-
-#import
-#import "ATLTestLibrary.h"
-
-@interface ATLTestInfo : NSObject
-
-- (id)initWithTestLibrary:(ATLTestLibrary *)testLibrary;
-
-- (void)teardown;
-
-- (void)addInfoToSend:(NSString *)key
- value:(NSString *)value;
-
-- (void)sendInfoToServer:(NSString *)currentBasePath;
-
-@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestLibrary.h b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestLibrary.h
index 099414d..14f763b 100644
--- a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestLibrary.h
+++ b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLTestLibrary.h
@@ -7,7 +7,7 @@
//
#import
-#import "ATLUtilNetworking.h"
+#import "ATLNetworking.h"
#import "ATLBlockingQueue.h"
@protocol AdjustCommandDelegate
@@ -29,10 +29,6 @@
- (ATLBlockingQueue *)waitControlQueue;
-- (id)initWithBaseUrl:(NSString *)baseUrl
- andControlUrl:(NSString *)controlUrl
- andCommandDelegate:(NSObject *)commandDelegate;
-
- (void)addTest:(NSString *)testName;
- (void)addTestDirectory:(NSString *)testDirectory;
@@ -57,7 +53,4 @@
+ (ATLTestLibrary *)testLibraryWithBaseUrl:(NSString *)baseUrl
andControlUrl:(NSString *)controlUrl
andCommandDelegate:(NSObject *)commandDelegate;
-
-+ (NSURL *)baseUrl;
-
@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLUtilNetworking.h b/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLUtilNetworking.h
deleted file mode 100644
index d7370b7..0000000
--- a/test/ios/AdjustTestLibrary.framework/Versions/A/Headers/ATLUtilNetworking.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// ATLUtilNetworking.h
-// AdjustTestLibrary
-//
-// Created by Pedro on 18.04.17.
-// Copyright © 2017 adjust. All rights reserved.
-//
-
-#import
-
-@interface ATLHttpResponse : NSObject
-
-@property (nonatomic, copy) NSString *responseString;
-@property (nonatomic, strong) id jsonFoundation;
-@property (nonatomic, strong) NSDictionary *headerFields;
-@property (nonatomic, assign) NSInteger statusCode;
-
-@end
-
-@interface ATLHttpRequest : NSObject
-
-@property (nonatomic, copy) NSString *path;
-@property (nonatomic, copy) NSString *bodyString;
-@property (nonatomic, strong) NSDictionary *headerFields;
-
-@end
-
-typedef void (^httpResponseHandler)(ATLHttpResponse* httpResponse);
-
-@interface ATLUtilNetworking : NSObject
-
-+ (void)sendPostRequest:(ATLHttpRequest *)requestData
- responseHandler:(httpResponseHandler) responseHandler;
-
-+ (NSString *)appendBasePath:(NSString *)basePath
- path:(NSString *)path;
-@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current b/test/ios/AdjustTestLibrary.framework/Versions/Current
deleted file mode 120000
index 8c7e5a6..0000000
--- a/test/ios/AdjustTestLibrary.framework/Versions/Current
+++ /dev/null
@@ -1 +0,0 @@
-A
\ No newline at end of file
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/AdjustTestLibrary b/test/ios/AdjustTestLibrary.framework/Versions/Current/AdjustTestLibrary
new file mode 100644
index 0000000..c05ecb0
Binary files /dev/null and b/test/ios/AdjustTestLibrary.framework/Versions/Current/AdjustTestLibrary differ
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLBlockingQueue.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLBlockingQueue.h
new file mode 100644
index 0000000..d61fddb
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLBlockingQueue.h
@@ -0,0 +1,27 @@
+//
+// ATLBlockingQueue.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 11.01.18.
+// Copyright © 2018 adjust. All rights reserved.
+//
+
+#import
+#import "ATLUtil.h"
+
+@interface ATLBlockingQueue : NSObject
+
+/**
+ * Enqueues an object to the queue.
+ * @param object Object to enqueue
+ */
+- (void)enqueue:(id)object;
+
+/**
+ * Dequeues an object from the queue. This method will block.
+ */
+- (id)dequeue;
+
+- (void)teardown;
+
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLConstants.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLConstants.h
new file mode 100644
index 0000000..52add01
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLConstants.h
@@ -0,0 +1,30 @@
+//
+// ATLConstants.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 20.04.17.
+// Copyright © 2017 adjust. All rights reserved.
+//
+
+#ifndef ATLConstants_h
+#define ATLConstants_h
+
+static int const ONE_SECOND = 1000;
+static int const ONE_MINUTE = 60 * ONE_SECOND;
+
+static NSString * const TEST_LIBRARY_CLASSNAME = @"TestLibrary";
+static NSString * const ADJUST_CLASSNAME = @"Adjust";
+static NSString * const WAIT_FOR_CONTROL = @"control";
+static NSString * const WAIT_FOR_SLEEP = @"sleep";
+static NSString * const BASE_PATH_PARAM = @"basePath";
+static NSString * const TEST_NAME_PARAM = @"basePath";
+static NSString * const TEST_SESSION_ID_HEADER = @"Test-Session-Id";
+
+// web socket values
+static NSString * const SIGNAL_INFO = @"info";
+static NSString * const SIGNAL_INIT_TEST_SESSION = @"init-test-session";
+static NSString * const SIGNAL_END_WAIT = @"end-wait";
+static NSString * const SIGNAL_CANCEL_CURRENT_TEST = @"cancel-current-test";
+static NSString * const SIGNAL_UNKNOWN = @"unknown";
+
+#endif /* ATLConstants_h */
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLControlSignal.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLControlSignal.h
new file mode 100644
index 0000000..22f0ab7
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLControlSignal.h
@@ -0,0 +1,38 @@
+//
+// ATLControlSignal.h
+// AdjustTestLibrary
+//
+// Created by Serj on 20.02.19.
+// Copyright © 2019 adjust. All rights reserved.
+//
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef enum {
+ ATLSignalTypeInfo = 1,
+ ATLSignalTypeInitTestSession = 2,
+ ATLSignalTypeEndWait = 3,
+ ATLSignalTypeCancelCurrentTest = 4,
+ ATLSignalTypeUnknown = 5
+} ATLSignalType;
+
+@interface ATLControlSignal : NSObject
+
+- (id)initWithSignalType:(ATLSignalType)signalType;
+
+- (id)initWithSignalType:(ATLSignalType)signalType
+ andSignalValue:(NSString*)signalValue;
+
+- (id)initWithJson:(NSString*)json;
+
+- (NSString*)toJson;
+
+- (NSString*)getValue;
+
+- (ATLSignalType)getType;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLControlWebSocketClient.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLControlWebSocketClient.h
new file mode 100644
index 0000000..0dd5e21
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLControlWebSocketClient.h
@@ -0,0 +1,26 @@
+//
+// ATLControlWebSocketClient.h
+// AdjustTestLibrary
+//
+// Created by Serj on 20.02.19.
+// Copyright © 2019 adjust. All rights reserved.
+//
+
+#import
+#import "PocketSocket/PSWebSocket.h"
+#import "ATLTestLibrary.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ATLControlWebSocketClient : NSObject
+
+- (void)initializeWebSocketWithControlUrl:(NSString*)controlUrl
+ andTestLibrary:(ATLTestLibrary*)testLibrary;
+
+- (void)reconnectIfNeeded;
+
+- (void)sendInitTestSessionSignal:(NSString*)testSessionId;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLNetworking.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLNetworking.h
new file mode 100644
index 0000000..90c2a10
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLNetworking.h
@@ -0,0 +1,39 @@
+//
+// ATLNetworking.h
+// AdjustTestLibrary
+//
+// Created by Pedro Silva on 24.05.24.
+// Copyright © 2024 adjust. All rights reserved.
+//
+
+#import
+
+@interface ATLHttpResponse : NSObject
+
+@property (nonatomic, nullable, strong) NSString * responseString;
+@property (nonatomic, nullable, strong) id jsonFoundation;
+@property (nonatomic, nullable, strong) NSDictionary *headerFields;
+@property (nonatomic, assign) NSInteger statusCode;
+
+@end
+
+@interface ATLHttpRequest : NSObject
+
+@property (nonatomic, nonnull, readonly, strong) NSString *path;
+@property (nonatomic, nullable, readonly, strong) NSString *base;
+@property (nonatomic, nullable, strong) NSString *bodyString;
+@property (nonatomic, nullable, strong) NSDictionary *headerFields;
+
+- (nonnull id)initWithPath:(nonnull NSString *)path
+ base:(nullable NSString *)base;
+@end
+
+typedef void (^httpResponseHandler)(ATLHttpResponse *_Nonnull httpResponse);
+
+@interface ATLNetworking : NSObject
+
+- (void)sendPostRequestWithData:(nonnull ATLHttpRequest *)requestData
+ baseUrl:(nonnull NSURL *)baseUrl
+ responseHandler:(nonnull httpResponseHandler)responseHandler;
+
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLTestLibrary.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLTestLibrary.h
new file mode 100644
index 0000000..14f763b
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLTestLibrary.h
@@ -0,0 +1,56 @@
+//
+// AdjustTestLibrary.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 18.04.17.
+// Copyright © 2017 adjust. All rights reserved.
+//
+
+#import
+#import "ATLNetworking.h"
+#import "ATLBlockingQueue.h"
+
+@protocol AdjustCommandDelegate
+@optional
+- (void)executeCommand:(NSString *)className
+ methodName:(NSString *)methodName
+ parameters:(NSDictionary *)parameters;
+
+- (void)executeCommand:(NSString *)className
+ methodName:(NSString *)methodName
+ jsonParameters:(NSString *)jsonParameters;
+
+- (void)executeCommandRawJson:(NSString *)json;
+@end
+
+@interface ATLTestLibrary : NSObject
+
+- (NSString *)currentBasePath;
+
+- (ATLBlockingQueue *)waitControlQueue;
+
+- (void)addTest:(NSString *)testName;
+
+- (void)addTestDirectory:(NSString *)testDirectory;
+
+- (void)startTestSession:(NSString *)clientSdk;
+
+- (void)resetTestLibrary;
+
+- (void)readResponse:(ATLHttpResponse *)httpResponse;
+
+- (void)addInfoToSend:(NSString *)key
+ value:(NSString *)value;
+
+- (void)sendInfoToServer:(NSString *)basePath;
+
+- (void)signalEndWaitWithReason:(NSString *)reason;
+
+- (void)cancelTestAndGetNext;
+
+- (void)doNotExitAfterEnd;
+
++ (ATLTestLibrary *)testLibraryWithBaseUrl:(NSString *)baseUrl
+ andControlUrl:(NSString *)controlUrl
+ andCommandDelegate:(NSObject *)commandDelegate;
+@end
diff --git a/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLUtil.h b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLUtil.h
new file mode 100644
index 0000000..cffe946
--- /dev/null
+++ b/test/ios/AdjustTestLibrary.framework/Versions/Current/Headers/ATLUtil.h
@@ -0,0 +1,30 @@
+//
+// ATLUtil.h
+// AdjustTestLibrary
+//
+// Created by Pedro on 18.04.17.
+// Copyright © 2017 adjust. All rights reserved.
+//
+
+#import
+
+typedef void (^selfInjectedBlock)(id);
+typedef void (^operationBlock)(NSBlockOperation *);
+
+@interface ATLUtil : NSObject
+
++ (void)debug:(NSString *)format, ...;
++ (void)launchInQueue:(dispatch_queue_t)queue
+ selfInject:(id)selfInject
+ block:(selfInjectedBlock)block;
++ (void)addOperationAfterLast:(NSOperationQueue *)operationQueue
+ block:(dispatch_block_t)block;
++ (void)addOperationAfterLast:(NSOperationQueue *)operationQueue
+ blockWithOperation:(operationBlock)blockWithOperation;
++ (BOOL)isNull:(id)value;
++ (NSString *)adjTrim:(NSString *)value;
++ (NSString *)formatDate:(NSDate *)value;
++ (NSString *)parseDictionaryToJsonString:(NSDictionary *) dictionary;
++ (NSString *)appendBasePath:(NSString *)basePath path:(NSString *)path;
++ (NSString *)queryString:(NSDictionary *)parameters;
+@end
diff --git a/test/ios/test_lib.podspec b/test/ios/test_lib.podspec
index ac4bfbd..2af1a1c 100644
--- a/test/ios/test_lib.podspec
+++ b/test/ios/test_lib.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'test_lib'
- s.version = '4.38.2'
+ s.version = '5.0.0'
s.summary = 'Adjust test library for iOS platform'
s.description = <<-DESC
Adjust test library for iOS platform.
diff --git a/test/pubspec.yaml b/test/pubspec.yaml
index e6f64f3..6db60fd 100644
--- a/test/pubspec.yaml
+++ b/test/pubspec.yaml
@@ -1,6 +1,6 @@
name: test_lib
description: Flutter plugin for Adjust Testing Library. Intended exclusively for internal use.
-version: 4.38.2
+version: 5.0.0
author: Adjust (sdk@adjust.com)
environment: