diff --git a/.npmignore b/.npmignore
index b931e201..f376a77d 100644
--- a/.npmignore
+++ b/.npmignore
@@ -4,10 +4,8 @@
.DS_Store
# Adjust SDK repository
-doc/
ext/
example-cordova/
example-ionic-capacitor/
ionic-native/
test/
-plugins/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d94007a..52b8b9e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,19 @@
+### Version 5.0.0 (14th September 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/cordova/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.1 (30th April 2024)
#### Added
- Added sending of the additional iOS SDK observability parameters for debugging purposes.
@@ -686,6 +702,7 @@
[ios_sdk_v4.37.0]: https://github.com/adjust/ios_sdk/tree/v4.37.0
[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_v5.0.0]: https://github.com/adjust/ios_sdk/tree/v5.0.0
[android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
@@ -719,4 +736,5 @@
[android_sdk_v4.35.0]: https://github.com/adjust/android_sdk/tree/v4.35.0
[android_sdk_v4.35.1]: https://github.com/adjust/android_sdk/tree/v4.35.1
[android_sdk_v4.38.0]: https://github.com/adjust/android_sdk/tree/v4.38.0
-[android_sdk_v4.38.3]: https://github.com/adjust/android_sdk/tree/v4.38.3
\ No newline at end of file
+[android_sdk_v4.38.3]: https://github.com/adjust/android_sdk/tree/v4.38.3
+[android_sdk_v5.0.0]: https://github.com/adjust/android_sdk/tree/v5.0.0
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index dbbc5460..334e607a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,21 +1,22 @@
-The Adjust SDK is licensed under the MIT License.
+The MIT License (MIT)
-Copyright (c) 2012-2022 Adjust GmbH, http://www.adjust.com
+Copyright (c) 2014-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.
+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 22d00806..02d652c9 100644
--- a/README.md
+++ b/README.md
@@ -1,1258 +1,7 @@
-## Summary
+# Adjust SDK for Cordova
-This is the Cordova SDK of Adjust™. You can read more about Adjust™ at [adjust.com](https://adjust.com).
+This is the [Adjust](https://adjust.com)™ SDK for Cordova. Documentation is available on our [developer docs](https://dev.adjust.com/en/sdk/cordova/?version=v5).
-N.B. At the moment, Cordova SDK supports Android platform version `4.0.0 and higher` and iOS platform version `3.0.0 and higher`.
+## License
-## Table of contents
-
-* [Example app](#example-app)
-* [Basic integration](#basic-integration)
- * [Get the SDK](#sdk-get)
- * [Add the SDK to your project](#sdk-add)
- * [Integrate the SDK into your app](#sdk-integrate)
- * [Adjust logging](#adjust-logging)
- * [Adjust project settings](#adjust-project-settings)
- * [Android permissions](#android-permissions)
- * [Google Play Services](#android-gps)
- * [Proguard settings](#android-proguard)
- * [Install referrer](#android-referrer)
- * [Google Play Referrer API](#android-referrer-gpr-api)
- * [Google Play Store intent](#android-referrer-gps-intent)
- * [Huawei Referrer API](#android-huawei-referrer-api)
- * [iOS frameworks](#ios-frameworks)
-* [Additional features](#additional-features)
- * [AppTrackingTransparency framework](#att-framework)
- * [App-tracking authorisation wrapper](#ata-wrapper)
- * [Get current authorisation status](#ata-getter)
- * [Check for ATT status change](#att-status-change)
- * [SKAdNetwork framework](#skadn-framework)
- * [Update SKAdNetwork conversion value](#skadn-update-conversion-value)
- * [Conversion value updated callback](#skadn-cv-updated-callback)
- * [Event tracking](#event-tracking)
- * [Revenue tracking](#revenue-tracking)
- * [Revenue deduplication](#revenue-deduplication)
- * [Callback parameters](#callback-parameters)
- * [Partner parameters](#partner-parameters)
- * [Callback identifier](#callback-id)
- * [Subscription tracking](#subscription-tracking)
- * [Session parameters](#session-parameters)
- * [Session callback parameters](#session-callback-parameters)
- * [Session partner parameters](#session-partner-parameters)
- * [Delay start](#delay-start)
- * [Attribution callback](#attribution-callback)
- * [Session and event callbacks](#session-event-callbacks)
- * [Disable tracking](#disable-tracking)
- * [Offline mode](#offline-mode)
- * [Event buffering](#event-buffering)
- * [GDPR right to be forgotten](#gdpr-forget-me)
- * [Third-party sharing](#third-party-sharing)
- * [Disable third-party sharing](#disable-third-party-sharing)
- * [Enable third-party sharing](#enable-third-party-sharing)
- * [Measurement consent](#measurement-consent)
- * [SDK signature](#sdk-signature)
- * [Background tracking](#background-tracking)
- * [Device IDs](#device-ids)
- * [iOS advertising identifier](#di-idfa)
- * [Google Play Services advertising identifier](#di-gps-adid)
- * [Amazon advertising identifier](#di-fire-adid)
- * [Adjust device identifier](#di-adid)
- * [Set external device ID](#set-external-device-id)
- * [User attribution](#user-attribution)
- * [Push token](#push-token)
- * [Pre-installed trackers](#pre-installed-trackers)
- * [Deep linking](#deeplinking)
- * [Standard deep linking scenario](#deeplinking-standard)
- * [Deep linking on Android & iOS 8 and earlier](#deeplinking-android-ios-old)
- * [Deep linking on iOS 9 and later](#deeplinking-ios-new)
- * [Deferred deep linking scenario](#deeplinking-deferred)
- * [Reattribution via deep links](#deeplinking-reattribution)
- * [Data residency](#data-residency)
- * [OAID plugin](#oaid-plugin)
- * [COPPA compliance](#coppa-compliance)
- * [Play Store Kids Apps](#play-store-kids-apps)
-* [License](#license)
-
-
-## Example app
-
-There is Cordova example app inside the [`example-cordova` directory](./example-cordova) and Ionic example app inside the [`example-ionic-capacitor` directory](./example-ionic-capacitor). In there you can check how to integrate the Adjust SDK into your app.
-
-## Basic integration
-
-These are the minimal steps required to integrate the Adjust SDK into your Cordova project.
-
-### Get the SDK
-
-You can get the latest version of the Adjust SDK from the `npm` [repository](https://www.npmjs.com/package/com.adjust.sdk) or download the it from our [releases page](https://github.com/adjust/cordova_sdk/releases).
-
-### Add the SDK to your project
-
-You can download our SDK directly as the plugin from `npm` repository. In order to do that, just execute this command in your project folder:
-
-```
-> cordova plugin add com.adjust.sdk
-Fetching plugin "com.adjust.sdk" via npm
-Installing "com.adjust.sdk" for android
-Installing "com.adjust.sdk" for ios
-```
-
-In case you are using Ionic to build your app, you can add our SDK from [`awesome-cordova-plugins`](https://github.com/danielsogl/awesome-cordova-plugins) repo:
-
-```
-> npm install @awesome-cordova-plugins/adjust --save
-> ionic cordova plugin add com.adjust.sdk
-```
-
-### Integrate the SDK into your app
-
-The Adjust SDK automatically registers with the Cordova events `deviceready`, `resume` and `pause`.
-
-In your `index.js` file after you have received the `deviceready` event, add the following code to initialize the Adjust SDK:
-
-```js
-var adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
-Adjust.create(adjustConfig);
-```
-
-Replace `{YourAppToken}` with your app token. You can find this in your [dashboard](http://dash.adjust.com).
-
-Depending on whether you build your app for testing or for production, you must set `environment` with one of these values:
-
-```javascript
-AdjustConfig.EnvironmentSandbox
-AdjustConfig.EnvironmentProduction
-```
-
-**Important:** This value should be set to `AdjustConfig.EnvironmentSandbox` if and only if you or someone else is testing your app. Make sure to set the environment to `AdjustConfig.EnvironmentProduction` just before you publish the app. Set it back to `AdjustConfig.EnvironmentSandbox` 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 very important that you keep this value meaningful at all times! This is especially important if you are tracking revenue.
-
-### Adjust logging
-
-You can increase or decrease the amount of logs you see in tests by calling `setLogLevel` on your `AdjustConfig` instance with one of the following parameters:
-
-```js
-adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // enable all logging
-adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug); // enable more logging
-adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo); // the default
-adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn); // disable info logging
-adjustConfig.setLogLevel(AdjustConfig.LogLevelError); // disable warnings as well
-adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert); // disable errors as well
-adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); // disable all logging
-```
-
-### Adjust project settings
-
-Once the Adjust SDK has been added to your app, certain tweeks are being performed so that the Adjust SDK can work properly. Everything that is being done in this process is written in the `plugin.xml` file of the Adjust SDK plugin. Below you can find a description of every additional thing that the Adjust SDK performs after you've added it to your app.
-
-### Android permissions
-
-The Adjust SDK adds three permissions to your Android manifest file: `INTERNET` and `ACCESS_NETWORK_STATE`. You can find this setting in the `plugin.xml` file of the Adjust SDK plugin:
-
-```xml
-
-
-
-
-```
-
-- `INTERNET` permission is the permission that our SDK might need at any point in time.
-- `ACCESS_NETWORK_STATE` is needed for reading MMC and MNC parameters.
-
-#### 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 `plugin.xml` to enable the permission:
-
-```xml
-
-
-
-```
-
-> **Important**: The Adjust SDK includes the `com.google.android.gms.AD_ID` permission by default in version 4.32.0 and above.
-
-You can remove the `com.google.android.gms.AD_ID` permission by adding a `remove` directive. Do this if need to make your app COPPA-compliant or if you do not target the Google Play Store.
-
-```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).
-
-### Google Play Services
-
-Since the August 1, 2014, apps in the Google Play Store must use the [Google Advertising ID](https://developer.android.com/google/play-services/id.html) to uniquely identify each device. To allow the Adjust SDK to use the Google Advertising ID, you must add the Google Play Services dependency which allows reading of this parameter.
-
-The Adjust SDK adds this dependency by default to your app. This is done with this line in the `plugin.xml` file:
-
-```xml
-
-```
-
-To check whether the analytics part of the Google Play Services library has been successfully added to your app so that the Adjust SDK can read it properly, you should start your app by configuring the SDK to run in `sandbox` mode and set the log level to `verbose`. After that, track a session or some events in your app and observe the list of parameters in the verbose logs which are being read once the session or event has been tracked. If you see a parameter called `gps_adid` in there, you have successfully added the analytics part of the Google Play Services library to your app and our SDK is reading the necessary information from it.
-
-### 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**, use the following `com.adjust.sdk` package rules:
-
-```
--keep public class com.adjust.sdk.** { *; }
-```
-
-### Install referrer
-
-In order to correctly attribute an install of your Android 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.
-
-#### Google Play Referrer API
-
-In order to support this in your app, the Adjust SDK adds support for it by default to your app. This is done with this line in the `plugin.xml` file:
-
-```xml
-
-```
-
-`installreferrer` library is part of Google Maven repository, so in order to be able to build your app, you need to add Google Maven repository to your app's `build.gradle` file if you haven't added it already:
-
-```gradle
-allprojects {
- repositories {
- jcenter()
- maven {
- url "https://maven.google.com"
- }
- }
-}
-```
-
-Also, make sure that you have paid attention to the [Proguard settings](#android-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.** { *; }
-```
-
-This feature is supported if you are using the **Adjust SDK v4.12.0 or above**.
-
-#### Google Play Store intent
-
-The Google Play Store `INSTALL_REFERRER` intent should be captured with a broadcast receiver. The Adjust install referrer broadcast receiver is added to your app by default. For more information, you can check our native [Android SDK README](https://github.com/adjust/android_sdk#gps-intent). You can find this setting in the `plugin.xml` file of the the Adjust SDK plugin:
-
-```xml
-
-
-
-
-
-
-
-```
-
-Please bear in mind that, if you are using your own broadcast receiver which handles the INSTALL_REFERRER intent, you don't need the Adjust broadcast receiver to be added to your manifest file. You can remove it, but inside your own receiver add the call to the Adjust broadcast receiver as described in our [Android guide](https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md).
-
-#### Huawei Referrer API
-
-As of **v4.21.1**, 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 frameworks
-
-Adjust SDK plugin adds these iOS frameworks to your generated Xcode project:
-
-- `AdSupport.framework` - This framework is needed so that SDK can access to IDFA value and (prior to iOS 14) LAT information.
-- `AdServices.framework` - For devices running iOS 14.3 or higher, this framework allows the SDK to automatically handle attribution for ASA campaigns. It is required when leveraging the Apple Ads Attribution API.
-- `StoreKit.framework` - This framework is needed for access to `SKAdNetwork` framework and for Adjust SDK to handle communication with it automatically in iOS 14 or later.
-- `AppTrackingTransparency.framework` - This framework is needed in iOS 14 and later for SDK to be able to wrap user's tracking consent dialog and access to value of the user's consent to be tracked or not.
-
-Settings for this can also be found in `plugin.xml` file of the Adjust SDK plugin:
-
-```xml
-
-
-
-
-```
-
-## Additional features
-
-You can take advantage of the following features once the Adjust SDK is integrated into your project.
-
-### 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:
-
-```js
-Adjust.requestTrackingAuthorizationWithCompletionHandler(function(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
-
-In cases where you are not using [Adjust app-tracking authorization wrapper](#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:
-
-```js
-Adjust.checkForNewAttStatus();
-```
-
-### SKAdNetwork framework
-
-**Note**: This feature exists only in iOS platform.
-
-If you have implemented the Adjust iOS 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:
-
-```js
-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:
-
-```js
-Adjust.updateConversionValue(6);
-```
-
-### Conversion value updated callback
-
-**Note**: This feature exists only in iOS platform.
-
-You can register callback to get notified each time when Adjust SDK updates conversion value for the user.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setConversionValueUpdatedCallbackListener(function(conversionValue) {
- console.log("Conversion value updated callback recveived");
- console.log("Conversion value: " + conversionValue);
- });
-
-Adjust.create(adjustConfig);
-```
-
-### Event tracking
-
-You can use Adjust to track all kinds of events. Let's say you want to track every tap on a button. Simply create a new event token in your [dashboard](http://dash.adjust.com). Let's say that event token is `abc123`. You can add the following line in your button’s click handler method to track the click:
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-Adjust.trackEvent(adjustEvent);
-```
-
-### Revenue tracking
-
-If your users can generate revenue by tapping on advertisements or making In-App Purchases, then you can track those revenues with events. Let's say a tap is worth €0.01. You could track the revenue event like this:
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.setRevenue(0.01, "EUR");
-Adjust.trackEvent(adjustEvent);
-```
-
-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](https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies).
-
-
-### Revenue deduplication
-
-You can also add an optional transaction ID to avoid tracking duplicate revenues. The last ten transaction IDs are remembered, and revenue events with duplicate 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 an item is purchased. That way you can avoid tracking revenue that is not actually being generated.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.setRevenue(0.01, "EUR");
-adjustEvent.setTransactionId("{YourTransactionId}");
-Adjust.trackEvent(adjustEvent);
-```
-
-**Note**: Transaction ID is the iOS term, unique identifier for successfully finished Android In-App-Purchases is named **Order ID**.
-
-### Callback parameters
-
-You can also register a callback URL for that event in your [dashboard](http://dash.adjust.com) and we will send a GET request to that URL whenever the event gets tracked. In that case you can also put some key-value pairs in an object and pass it to the `trackEvent` method. We will then append these named parameters to your callback URL.
-
-For example, suppose you have registered the URL `http://www.adjust.com/callback` for your event with event token `abc123` and execute the following lines:
-
-```js
-var 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:
-
-```
-http://www.adjust.com/callback?key=value&foo=bar
-```
-
-It should be mentioned that we support a variety of placeholders like `{idfa}` for iOS or `{gps_adid}` for Android that can be used as parameter values. In the resulting callback the `{idfa}` placeholder would be replaced with the ID for Advertisers of the current device for iOS and the `{gps_adid}` would be replaced with the Google Advertising ID of the current device for Android. 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](https://docs.adjust.com/en/callbacks).
-
-### Partner parameters
-
-Similarly to the callback parameters mentioned above, you can also add parameters that Adjust will transmit to the network partners of your choice. You can activate these networks in your Adjust dashboard.
-
-This works similarly to the callback parameters mentioned above, but can be added by calling the `addPartnerParameter` method on your `AdjustEvent` instance.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.addPartnerParameter("key", "value");
-adjustEvent.addPartnerParameter("foo", "bar");
-Adjust.trackEvent(adjustEvent);
-```
-
-You can read more about special partners and networks in our [guide to special partners](https://docs.adjust.com/en/special-partners).
-
-### 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 calling the `setCallbackId` method on your `AdjustEvent` instance:
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.setCallbackId("Your-Custom-Id");
-Adjust.trackEvent(adjustEvent);
-```
-
-### 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:**
-
-```js
-var subscription = new AdjustAppStoreSubscription(price, currency, transactionId, receipt);
-subscription.setTransactionDate(transactionDate);
-subscription.setSalesRegion(salesRegion);
-
-Adjust.trackAppStoreSubscription(subscription);
-```
-
-**For Play Store subscription:**
-
-```js
-var 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 Cordova 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:**
-
-```js
-var 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:**
-
-```js
-var 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);
-```
-
-### 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](#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 of the event callback parameters. Instead of adding the key and its value to an event, it's added through a call to method `addSessionCallbackParameter` of the `Adjust` instance:
-
-```js
-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 `removeSessionCallbackParameter` of the `Adjust` instance:
-
-```js
-Adjust.removeSessionCallbackParameter("foo");
-```
-
-If you wish to remove all key and values from the session callback parameters, you can reset it with the method `resetSessionCallbackParameters` of the `Adjust` instance:
-
-```js
-Adjust.resetSessionCallbackParameters();
-```
-
-### Session partner parameters
-
-In the same way that there are [session callback parameters](#session-callback-parameters) that are sent for every event or session of the Adjust SDK, there are also session partner parameters.
-
-These will be transmitted to network partners, for the integrations that have been activated in your Adjust [dashboard](http://dash.adjust.com).
-
-The session partner parameters have a similar interface to the event partner parameters. Instead of adding the key and its value to an event, it's added through a call to method `addSessionPartnerParameter` of the `Adjust` instance:
-
-```js
-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 `removeSessionPartnerParameter` of the `Adjust` instance:
-
-```js
-Adjust.removeSessionPartnerParameter("foo");
-```
-
-If you wish to remove all keys and values from the session partner parameters, you can reset it with the method `resetSessionPartnerParameters` of the `Adjust` instance:
-
-```js
-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 `setDelayStart` field of the `AdjustConfig` instance:
-
-```js
-adjustConfig.setDelayStart(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 `sendFirstPackages()` of the `Adjust` instance 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**.
-
-### Attribution callback
-
-You can register a listener to be notified of tracker attribution changes. Due to the different sources considered for attribution, this information cannot by provided synchronously. The simplest way is to create a single anonymous listener which is going to be called **each time your user's attribution value changes**:
-
-With the `AdjustConfig` instance, before starting the SDK, add the anonymous listener:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setAttributionCallbackListener(function(attribution) {
- // Printing all attribution properties.
- console.log("Attribution changed!");
- console.log(attribution.trackerToken);
- console.log(attribution.trackerName);
- console.log(attribution.network);
- console.log(attribution.campaign);
- console.log(attribution.adgroup);
- console.log(attribution.creative);
- console.log(attribution.clickLabel);
- console.log(attribution.adid);
- console.log(attribution.costType);
- console.log(attribution.costAmount);
- console.log(attribution.costCurrency);
-});
-
-Adjust.create(adjustConfig);
-```
-
-Within the listener function you have access to the `attribution` parameters. Here is a quick summary of its properties:
-
-- `trackerToken` the tracker token of the current attribution.
-- `trackerName` the tracker name of the current attribution.
-- `network` the network grouping level of the current attribution.
-- `campaign` the campaign grouping level of the current attribution.
-- `adgroup` the ad group grouping level of the current attribution.
-- `creative` the creative grouping level of the current attribution.
-- `clickLabel` the click label of the current attribution.
-- `adid` the Adjust device identifier.
-- `costType` the cost type.
-- `costAmount` the cost amount.
-- `costCurrency` the cost currency.
-
-Please make sure to consider our [applicable attribution data policies](https://github.com/adjust/sdks/blob/master/doc/attribution-data.md).
-
-**Note**: The cost data - `costType`, `costAmount` & `costCurrency` are only available when configured in `AdjustConfig` by calling `setNeedsCost` method. 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 above.
-
-### Session and event callbacks
-
-You can register a callback to be notified of successful and failed tracked events and/or sessions.
-
-Follow the same steps as for attribution callback to implement the following callback function for successfully tracked events:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setEventTrackingSucceededCallbackListener(function(eventSuccess) {
- // Printing all event success properties.
- console.log("Event tracking succeeded!");
- console.log(eventSuccess.message);
- console.log(eventSuccess.timestamp);
- console.log(eventSuccess.eventToken);
- console.log(eventSuccess.callbackId);
- console.log(eventSuccess.adid);
- console.log(eventSuccess.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-The following callback function for failed tracked events:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setEventTrackingFailedCallbackListener(function(eventFailure) {
- // Printing all event failure properties.
- console.log("Event tracking failed!");
- console.log(eventFailure.message);
- console.log(eventFailure.timestamp);
- console.log(eventFailure.eventToken);
- console.log(eventFailure.callbackId);
- console.log(eventFailure.adid);
- console.log(eventFailure.willRetry);
- console.log(eventFailure.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-For successfully tracked sessions:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setSessionTrackingSucceededCallbackListener(function(sessionSuccess) {
- // Printing all session success properties.
- console.log("Session tracking succeeded!");
- console.log(sessionSuccess.message);
- console.log(sessionSuccess.timestamp);
- console.log(sessionSuccess.adid);
- console.log(sessionSuccess.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-And for failed tracked sessions:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setSessionTrackingFailedCallbackListener(function(sessionFailure) {
- // Printing all session failure properties.
- console.log("Session tracking failed!");
- console.log(sessionFailure.message);
- console.log(sessionFailure.timestamp);
- console.log(sessionFailure.adid);
- console.log(sessionFailure.willRetry);
- console.log(sessionFailure.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-The callback functions will be called after the SDK tries to send a package to the server. Within the callback you have access to a response data object specifically for the callback. Here is a quick summary of the session response data properties:
-
-- `var message` the message from the server or the error logged by the SDK.
-- `var timestamp` timestamp from the server.
-- `var adid` a unique device identifier provided by Adjust.
-- `var jsonResponse` the JSON object with the response from the server.
-
-Both event response data objects contain:
-
-- `var eventToken` the event token, if the package tracked was an event.
-- `var callbackId` the custom defined callback ID set on event object.
-
-And both event and session failed objects also contain:
-
-- `var willRetry` indicates there will be an attempt to resend the package at a later time.
-
-### Disable tracking
-
-You can disable the Adjust SDK from tracking by invoking the method `setEnabled` of the `Adjust` instance with the enabled parameter as `false`. This setting is **remembered between sessions**, but it can only be activated after the first session.
-
-```js
-Adjust.setEnabled(false);
-```
-
-You can verify if the Adjust SDK is currently active with the method `isEnabled` of the `Adjust` instance. It is always possible to activate the Adjust SDK by invoking `setEnabled` with the parameter set to `true`.
-
-### 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. When 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 the method `setOfflineMode` of the `Adjust` instance with the parameter `true`.
-
-```js
-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 send 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.
-
-### 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 `AdjustConfig` instance by calling `setEventBufferingEnabled` method:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-adjustConfig.setEventBufferingEnabled(true);
-Adjust.create(adjustConfig);
-```
-
-### 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:
-
-```js
-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:
-
-```js
-var 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:
-
-```js
-var 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:
-
-```js
-var 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:
-
-```js
-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.
-
-### 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.
-
-### 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 `AdjustConfig` instance by calling `setSendInBackground` method:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-adjustConfig.setSendInBackground(true);
-Adjust.create(adjustConfig);
-```
-
-If nothing is set, sending in background is **disabled by default**.
-
-### Device IDs
-
-Certain services (such as Google Analytics) require you to coordinate Device and Client IDs in order to prevent duplicate reporting.
-
-### iOS Advertising Identifier
-
-To obtain the IDFA, call the `getIdfa` method of the `Adjust` instance. You need to pass a callback to that method in order to obtain the value:
-
-```js
-Adjust.getIdfa(function(idfa) {
- // Use idfa 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.
-
-If you need to obtain the Google Advertising ID, you can call the `getGoogleAdId` method of the `Adjust` instance. You need to pass a callback to that method in order to obtain the value:
-
-```js
-Adjust.getGoogleAdId(function(googleAdId) {
- // Use googleAdId value.
-});
-```
-
-Inside the callback method you will have access to the Google Advertising ID as the variable `googleAdId`.
-
-### Amazon advertising identifier
-
-If you need to obtain the Amazon advertising ID, you can call the `getAmazonAdId` method on `Adjust` instance:
-
-```js
-Adjust.getAmazonAdId(function(amazonAdId) {
- // Use amazonAdId value.
-});
-```
-
-Inside the callback method you will have access to the Amazon Advertising ID as the variable `amazonAdId`.
-
-### Adjust device identifier
-
-For every device with your app installed on it, the Adjust backend generates a unique **Adjust device identifier** (**adid**). In order to obtain this identifier, call the `getAdid` method of the `Adjust` instance. You need to pass a callback to that method in order to obtain the value:
-
-```js
-Adjust.getAdid(function(adid) {
- // Use adid value.
-});
-```
-
-**Note**: Information about the **adid** is only available after an app installation has been tracked by the Adjust backend. From that moment on, the Adjust SDK has information about the device **adid** and you can access it with this method. So, **it is not possible** to access the **adid** value before the SDK has been initialised and installation of your app has been successfully tracked.
-
-### 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.
-
-```js
-adjustConfig.setExternalDeviceId("{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](#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.
-
-### User attribution
-
-As described in the [attribution callback section](#attribution-callback), this callback is triggered, providing you with information about a new attribution whenever it changes. If you want to access information about a user's current attribution whenever you need it, you can make a call to the `getAttribution` method of the `Adjust` instance:
-
-```js
-Adjust.getAttribution(function(attribution) {
- // Use attribution object in same way like in attribution callback.
-});
-```
-
-**Note**: Information about current attribution is only available after an app installation has been tracked by the Adjust backend and the attribution callback has been triggered. From that moment on, the Adjust SDK has information about a user's attribution and you can access it with this method. So, **it is not possible** to access a user's attribution value before the SDK has been initialised and an attribution callback has been triggered.
-
-### Push token
-
-To send us the push notification token, add the following call to Adjust **whenever you get your token in the app or when it gets updated**:
-
-```js
-Adjust.setPushToken("YourPushNotificationsToken");
-```
-
-Push tokens are used for Audience Builder and client callbacks, and they are required for the uninstall tracking feature.
-
-### Pre-installed trackers
-
-If you want to use the Adjust SDK to recognize users that found your app pre-installed on their device, follow these steps.
-
-1. Create a new tracker in your [dashboard](http://dash.adjust.com).
-2. Open your app delegate and add set the default tracker of your `AdjustConfig` instance:
-
- ```js
- var adjustConfig = new AdjustConfig(appToken, environment);
- adjustConfig.setDefaultTracker("{TrackerToken}");
- Adjust.create(adjustConfig);
- ```
-
- Replace `{TrackerToken}` with the tracker token you created in step 2. Please note that the dashboard displays a tracker
- URL (including `http://app.adjust.com/`). In your source code, you should specify only the six-character token and not the
- entire URL.
-
-3. Build and run your app. You should see a line like the following in the app's log output:
-
- ```
- Default tracker: 'abc123'
- ```
-
-### Deep linking
-
-If you are using the Adjust tracker URL with an option to deep link into your app from the URL, there is the possibility to get info 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).
-
-### Standard deep linking scenario
-
-Standard deep linking scenario is a platform specific feature and in order to support it, you need to add some additional settings to your app. If your user already has the app installed and hits the tracker URL with deep link information in it, your application will be opened and the content of the deep link will be sent to your app so that you can parse it and decide what to do next.
-
-**Note for iOS**: With the introduction of iOS 9, Apple has changed the way deep linking is handled in the app. Depending on which scenario you want to use for your app (or if you want to use them both to support a wide range of devices), you need to set up your app to handle one or both of the following scenarios.
-
-### Deep linking on Android & iOS 8 and earlier
-
-To support deep linking handling in your app for Android and iOS 8 and earlier versions, you can use the `Custom URL Scheme` plugin which can be found [here](https://github.com/EddyVerbruggen/Custom-URL-scheme).
-
-After you successfully integrate this plugin, in the callback method used with the plugin described in this [section](https://github.com/EddyVerbruggen/Custom-URL-scheme#3-usage) you will have an access to the content of the URL which opened your app on user's device:
-
-```js
-function handleOpenURL(url) {
- setTimeout(function () {
- // Check content of the url object and get information about the URL.
- }, 300);
-};
-```
-
-By completing integration of this plugin, you should be able to handle deep linking in **Android and iOS 8 and lower**.
-
-### Deep linking on iOS 9 and later
-
-Starting from **iOS 9**, Apple has introduced suppressed support for old style deep linking with custom URL schemes like described above in favour of `universal links`. If you want to support deep linking in your app for iOS 9 and higher, you need to add support for universal links handling.
-
-First thing you need to do is to enable universal links for your app in the Adjust dashboard. Instructions on how to do that can be found in our native iOS SDK [README](https://github.com/adjust/ios_sdk#deeplinking-setup-new).
-
-After you have enabled universal links handling for your app in your dashboard, you need to add support for it in your app as well. You can achieve this by adding this [plugin](https://github.com/nordnet/cordova-universal-links-plugin) to your cordova app. Please, read the README of this plugin, because it precisely describes what should be done in order to properly integrate it.
-
-**Note**: You can disregard any information in the README that states that you need to have a domain and website or you need to upload a file to the root of your domain. Adjust is taking care of this instead of you and you can skip these parts of the README. Also, you don't need to follow the instructions of this plugin for the Android platform, because deep linking in Android is still being handled with `Custom URL scheme` plugin.
-
-To complete the integration of `Cordova Universal Links Plugin` after successfully enabling universal links for your app in the Adjust dashboard you must:
-
-### Edit your `config.xml` file
-
-You need to add following entry to your `config.xml` file:
-
-```xml
-
-
-
-
-
-```
-
-You should replace the `[hash]` value with the value you generated on the Adjust dashboard. You can name the event also how ever you like.
-
-### Check `ul_web_hooks/ios/` content of the plugin
-
-Go to the `Cordova Universal Links Plugin` install directory in your app and check the `ul_web_hooks/ios/` folder content. In there, you should see a generated file with the name `[hash].ulink.adjust.com#apple-app-site-association`. The content of that file should look like this:
-
-```
-{
- "applinks": {
- "apps": [],
- "details": [
- {
- "appID": ".com.adjust.examples",
- "paths": [
- "/ulink/*"
- ]
- }
- ]
- }
-}
-```
-
-### Integrate plugin to your `index.js` file
-
-After the `deviceready` event gets fired, you should subscribe to the event you have defined in your `config.xml` file, and define the callback method which gets fired once the event is triggered. Because you don't need this plugin to handle deep linking in Android, you can only need to subscribe to it if your app is running on an iOS device.
-
-```js
-// ...
-
-var app = {
- initialize: function() {
- this.bindEvents();
- },
-
- bindEvents: function() {
- document.addEventListener('deviceready', this.onDeviceReady, false);
- },
-
- onDeviceReady: function() {
- if (device.platform == "iOS") {
- universalLinks.subscribe('adjustDeepLinking', app.didLaunchAppFromLink);
- }
- },
-
- didLaunchAppFromLink: function(eventData) {
- // Check content of the eventData.url object and get information about the URL.
- }
-}
-// ...
-```
-
-By completing these steps, you have successfully added support for deep linking for iOS 9 and above as well.
-
-### Deferred deep linking scenario
-
-While deferred deep linking is not supported out of the box on Android and iOS, our Adjust SDK makes it possible.
-
-In order to get info about the URL content in a deferred deep linking scenario, you should set a callback method on the `AdjustConfig` object which will receive one parameter where the content of the URL will be delivered. You should set this method on the config object by calling the method `setDeferredDeeplinkCallbackListener`:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setDeferredDeeplinkCallbackListener(function(deeplink) {
- console.log("Deferred deep link URL content: " + deeplink);
-});
-
-Adjust.create(adjustConfig);
-```
-
-In deferred deep linking scenario, there is one additional setting which can be set on the `AdjustConfig` object. Once the Adjust SDK gets the deferred deep link info, we are offering you the possibility to choose whether our SDK should open this URL or not. You can choose to set this option by calling the `setShouldLaunchDeeplink` method on the config object:
-
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setShouldLaunchDeeplink(true);
-// or adjustConfig.setShouldLaunchDeeplink(false);
-
-adjustConfig.setDeferredDeeplinkCallbackListener(function(deeplink) {
- console.log("Deferred deep link URL content: " + deeplink);
-});
-
-Adjust.create(adjustConfig);
-```
-
-If nothing is set, **the Adjust SDK will always try to launch the URL by default**.
-
-### Reattribution via deep links
-
-Adjust enables you to run re-engagement campaigns by using deep links. For more information on this, please check our [official docs](https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link).
-
-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 `appWillOpenUrl` method of the `Adjust` instance. By making this call, the Adjust SDK will try to find if there is any new attribution info inside of the deep link and if 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 in it, you will see the [attribution callback](#attribution-callback) in your app being triggered with new attribution info for this user.
-
-In the code examples described above, a call to the `appWillOpenUrl` method should be done like this:
-
-```js
-function handleOpenURL(url) {
- setTimeout(function () {
- // Check content of the url object and get information about the URL.
- Adjust.appWillOpenUrl(url);
- }, 300);
-};
-```
-
-```js
-// ...
-
-var app = {
- initialize: function() {
- this.bindEvents();
- },
-
- bindEvents: function() {
- document.addEventListener('deviceready', this.onDeviceReady, false);
- },
-
- onDeviceReady: function() {
- if (device.platform == "iOS") {
- universalLinks.subscribe('adjustDeepLinking', app.didLaunchAppFromLink);
- }
- },
-
- didLaunchAppFromLink: function(eventData) {
- // Check content of the eventData.url object and get information about the URL.
- Adjust.appWillOpenUrl(eventData.url);
- }
-}
-// ...
-```
-
-### Data residency
-
-In order to enable data residency feature, make sure to call `setUrlStrategy` method of the `AdjustConfig` instance with one of the following constants:
-
-```js
-adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyEU); // for EU data residency region
-adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyTR); // for Turkey data residency region
-adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyUS); // for US data residency region
-```
-
-### OAID plugin
-
-You can enable **native** Adjust OAID plugin directly from Adjust Cordova SDK. In order to do that, first make sure to read [native OAID plugin docs](https://github.com/adjust/android_sdk/blob/master/doc/english/plugins/oaid.md). Since Adjust Cordova SDK is already adding the native Adjust SDK under the hood, only dependency you need to add to your app from OAID plugin docs is the OAID plugin dependency. After that has been done, you have an option to enable usage of native Adjust OAID plugin by calling `setOaidReadingEnabled` method of `AdjustConfig`:
-
-```js
-adjustConfig.setOaidReadingEnabled(true);
-```
-
-### 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 call `setCoppaCompliantEnabled` method of `AdjustConfig` instance with boolean parameter `true`:
-
-```js
-adjustConfig.setCoppaCompliantEnabled(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
-
-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 call `setPlayStoreKidsAppEnabled` method of `AdjustConfig` instance with boolean parameter `true`:
-
-```js
-adjustConfig.setPlayStoreKidsAppEnabled(true);
-```
-
-## License
-
-The Adjust SDK is licensed under the MIT License.
-
-Copyright (c) 2012-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:
-
-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 bcdb5803..0062ac97 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.38.1
+5.0.0
diff --git a/doc/korean/README.md b/doc/korean/README.md
deleted file mode 100644
index 00c259ff..00000000
--- a/doc/korean/README.md
+++ /dev/null
@@ -1,1077 +0,0 @@
-요약
----
-
-Adjust™의 Cordova SDK에 관한 설명서입니다. [adjust.com](http://adjust.com)에서 Adjust™에 대한 정보를 더 자세히 알아보세요.
-
-N.B. 현재 Cordova SDK는 안드로이드 플랫폼 `4.0.0 버전 이상`과 iOS 플랫폼 `3.0.0 버전 이상`을 지원합니다.
-
-목차
----
-
-* [예시 앱](#example-app)
-* [기본 연동](#basic-integration)
- * [SDK 설치](#sdk-get)
- * [프로젝트에 SDK 추가](#sdk-add)
- * [앱에 SDK 연동](#sdk-integrate)
- * [Adjust 로깅](#adjust-logging)
- * [Adjust 프로젝트 설정](#adjust-project-settings)
- * [Android 권한](#android-permissions)
- * [Google Play 서비스](#android-gps)
- * [Proguard 설정](#android-proguard)
- * [설치 참조자](#android-referrer)
- * [Google Play Referrer API](#android-referrer-gpr-api)
- * [Google Play 스토어 intent](#android-referrer-gps-intent)
- * [Huawei 리퍼러 API](#android-huawei-referrer-api)
-
- * [iOS 프레임워크](#ios-frameworks)
-
-* [부가 기능](#additional-features)
- * [AppTrackingTransparency 프레임워크](#att-framework)
- * [앱 트래킹 인증 래퍼](#ata-wrapper)
-
- * [SKAdNetwork 프레임워크](#skadn-framework)
- * [이벤트 추적](#event-tracking)
- * [매출 추적](#revenue-tracking)
- * [매출 중복 제거](#revenue-deduplication)
- * [인앱 결제 검증](#iap-verification)
- * [콜백 파라미터](#callback-parameters)
- * [파트너 파라미터](#partner-parameters)
- * [콜백 ID](#callback-id)
-
- * [구독 트래킹\(Subscription Tracking\)](#subscription-tracking)
- * [세션 파라미터](#session-parameters)
- * [세션 콜백 파라미터](#session-callback-parameters)
- * [세션 파트너 파라미터](#session-partner-parameters)
- * [시작 지연](#delay-start)
-
- * [어트리뷰션 콜백](#attribution-callback)
- * [세션 및 이벤트 콜백](#session-event-callbacks)
- * [추적 비활성화](#disable-tracking)
- * [오프라인 모드](#offline-mode)
- * [이벤트 버퍼링](#event-buffering)
- * [GDPR 잊혀질 권리](#gdpr-forget-me)
- * [제3자 공유 비활성화](#disable-third-party-sharing)
- * [SDK Signature\(SDK 서명\)](#sdk-signature)
- * [백그라운드 추적](#background-tracking)
- * [기기 ID](#device-ids)
- * [iOS 광고 ID](#di-idfa)
- * [Google Play 서비스 광고 ID](#di-gps-adid)
- * [Amazon 광고 ID](#di-fire-adid)
- * [Adjust 기기 식별자](#di-adid)
-
- * [사용자 어트리뷰션](#user-attribution)
- * [푸시 토큰](#push-token)
- * [사전 설치 트래커](#pre-installed-trackers)
- * [딥링크](#deeplinking)
- * [표준 딥링크 시나리오](#deeplinking-standard)
- * [안드로이드와 iOS 8 이하 버전에서의 딥링크](#deeplinking-android-ios-old)
- * [iOS 9 이상 버전에서의 딥링크](#deeplinking-ios-new)
- * [디퍼드 딥링크 시나리오](#deeplinking-deferred)
- * [딥링크를 통한 리어트리뷰션](#deeplinking-reattribution)
-
-* [라이센스](#license)
-
-예시 앱
-----
-
-[`example-cordova` 경로](./example-cordova)에는 Cordova 예시 앱이, [`example-ionic` 경로](./example-ionic)에는 Ionic 예시 앱이 들어있습니다. 이를 통해 Adjust SDK를 앱에 연동하는 방법을 확인할 수 있습니다.
-
-기본 연동
------
-
-Adjust SDK를 Cordova 프로젝트에 연동하는 데 필요한 최소한의 단계입니다.
-
-### SDK 설치
-
-`npm` [리퍼지토리](https://www.npmjs.com/package/com.adjust.sdk)나 Adjust의 [출시 페이지](https://github.com/adjust/cordova_sdk/releases)에서 Adjust SDK의 최신 버전을 다운로드할 수 있습니다.
-
-### 프로젝트에 SDK 추가
-
-`npm` 리퍼지토리에서 Adjust의 SDK를 플러그인으로 직접 다운로드할 수 있습니다. 이를 위해서는 프로젝트 폴더에 다음의 명령어를 실행해야 합니다.
-
- > cordova plugin add com.adjust.sdk
- Fetching plugin "com.adjust.sdk" via npm
- Installing "com.adjust.sdk" for android
- Installing "com.adjust.sdk" for ios
-
-Adjust의 출시 페이지에서 Adjust SDK를 다운로드한 경우에는 원하는 폴더에 아카이브를 추출한 뒤 프로젝트 폴더에 다음의 명령어를 실행해야 합니다.
-
- > cordova plugin add path_to_folder/cordova_sdk/plugin
- Installing "com.adjust.sdk" for android
- Installing "com.adjust.sdk" for ios
-
-Ionic Native를 사용하는 경우, `ionic-native` 리포지터리에서 Adjust SDK를 추가할 수 있습니다.
-
- > npm install @ionic-native/adjust --save
- > ionic cordova plugin add com.adjust.sdk
-
-### 앱에 SDK 연동
-
-Adjust SDK는 `deviceready(준비)`, `resume(재실행)`, `pause(대기)`와 같은 Cordova 이벤트 발생 시 자동으로 등록됩니다.
-
-`deviceready` 이벤트 발생 후, `index.js` 파일에 다음의 코드를 입력하면 Adjust SDK를 초기화할 수 있습니다.
-
-```js
-var adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
-Adjust.create(adjustConfig);
-```
-
-`{YourAppToken}`을 사용 중인 앱 토큰으로 교체한 다음, [대시보드](http://adjust.com)에서 확인할 수 있습니다.
-
-테스트 또는 배포 등 어떤 목적으로 앱을 빌드하는지에 따라, 다음의 값 중 하나를 `environment`로 설정해야 합니다.
-
-```javascript
-AdjustConfig.EnvironmentSandbox
-AdjustConfig.EnvironmentProduction
-```
-
-**중요** : 앱을 테스트해야 하는 경우, 해당 값을 `AdjustConfig.EnvironmentSandbox`로 설정해야 합니다. 앱을 퍼블리시할 준비가 완료되면 환경 설정을 `AdjustConfig.EnvironmentProduction`으로 변경하고, 앱 개발 및 테스트를 새로 시작한다면 `AdjustConfig.EnvironmentSandbox`로 다시 설정하세요.
-
-테스트 기기로 인해 발생하는 테스트 트래픽과 실제 트래픽을 구분하기 위해 다른 환경을 사용하고 있으니, 상황에 알맞은 설정을 적용하시기 바랍니다. 이는 매출을 추적하는 경우에 특히 중요합니다.
-
-### Adjust 로깅
-
-다음 파라미터 중 하나를 사용하여 `AdjustConfig` 인스턴스에 `setLogLevel`을 호출함으로써 테스트에서 확인하는 로그 수를 늘리거나 줄일 수 있습니다.
-
-```js
-adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // enable all logging
-adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug); // enable more logging
-adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo); // the default
-adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn); // disable info logging
-adjustConfig.setLogLevel(AdjustConfig.LogLevelError); // disable warnings as well
-adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert); // disable errors as well
-adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); // disable all logging
-```
-
-### Adjust 프로젝트 설정
-
-Adjust SDK가 앱에 추가되고 나면, Adjust SDK가 올바르게 작동하도록 하는 특정 동작이 수행됩니다. 이 과정에서 발생하는 모든 실행은 Adjust SDK 플러그인의 `plugin.xml` 파일에서 확인할 수 있습니다. 아래는 Adjust SDK를 앱에 추가한 이후의 추가적인 실행과 관련된 내용입니다.
-
-### Android 권한
-
-Adjust SDK는 안드로이드 매니페스트 파일에 다음의 3개 권한을 추가합니다: `INTERNET`, `ACCESS_WIFI_STATE`, `ACCESS_NETWORK_STATE` Adjust SDK 플러그인의 `plugin.xml` 파일에서 이러한 세팅을 확인할 수 있습니다.
-
-```xml
-
-
-
-
-
-```
-
-`INTERNET`은 Adjust SDK가 추후 필요할 수 있는 권한입니다. `ACCESS_WIFI_STATE`는 앱이 Google Play 스토어를 타겟팅하지 않으며, Google Play 서비스를 사용하지 않는 경우 Adjust SDK가 필요로 하는 권한입니다. Google Play 스토어를 타겟팅하며 Google Play 서비스를 사용하고 있는 경우에는 Adjust SDK가 이 권한을 필요로 하지 않으며, 앱 어디에서도 이 권한이 필요하지 않은 경우에는 삭제해도 됩니다. `ACCESS_NETWORK_STATE`는 MMC와 MNC 파라미터 읽기에 필요한 권합입니다.
-
-### Google Play 서비스
-
-2014년 8월 1일부터 고유 기기 식별을 위해 Google Play 스토어 앱에 대해 [Google 광고 ID](https://developer.android.com/google/play-services/id.html) 사용이 의무화되었습니다. Adjust SDK가 Google 광고 ID를 사용하도록 허용하려면 [Google Play 서비스](http://developer.android.com/google/play-services/index.html)를 연동해야 합니다.
-
-Adjust SDK는 앱에 디폴트로 Google Play 서비스를 추가합니다. 이는 `plugin.xml` 파일에 아래의 라인으로 수행됩니다.
-
-```xml
-
-```
-
-기타 Cordova 플러그인을 사용하는 경우, 앱에 Google Play 서비스가 디폴트로 또 추가될 수 있습니다. 이러한 경우, Adjust SDK의 Google Play 서비스가 기타 플러그인과 충돌하여 빌드타임 에러가 발생할 수 있습니다. Google Play 서비스가 Adjust SDK를 통해서만 앱에 연동되어 있어야 하는 것은 아닙니다. 앱에 **Google Play 서비스 라이브러리의 분석이 연동되어있는 한** , Adjust SDK는 필요한 모든 정보를 읽을 수 있습니다. 기타 Cordova 플러그인을 통해 앱에 Google Play 서비스를 추가하고자 하는 경우, Adjust SDK의 `plugin.xml` 파일에서 위 라인을 삭제하면 됩니다.
-
-Google Play 서비스의 애널리틱스 부분이 앱에 성공적으로 설치되어 Adjust SDK가 올바르게 읽을 수 있는지 확인하려면, SDK가 `sandbox` 모드에서 실행되도록 설정하고 로그 레벨을 `verbose`로 설정하여 앱을 시작해야 합니다. 그런 다음 세션이나 앱 내 특정 이벤트를 트래킹하고, 트래킹이 완료되면 verbose 로그에서 읽어들이는 파라미터 리스트를 확인합니다. `gps_adid`라는 파라미터가 확인되면 Google Play 서비스 라이브러리의 애널리틱스 파트가 앱에 성공적으로 추가되었다는 것을 확인하실 수 있고, 이제 Adjust SDK가 이로부터 필요한 정보를 읽을 수 있습니다.
-
-### Proguard 설정
-
-Proguard를 사용하는 경우, Proguard 파일에 다음 줄을 추가하세요.
-
- -keep public 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.** { *; }
-
-### 설치 참조자
-
-Android 앱의 설치를 소스에 올바르게 어트리뷰션하려면 Adjust에 **설치 참조자** 에 대한 정보를 제공해야 합니다. 이를 위해 **Google Play Referrer API** 를 사용하거나 **Google Play 스토어 intent** 브로드캐스트 리시버를 캐치할 수 있습니다.
-
-**중요** : Google Play Referrer API는 설치 참조자 정보를 더욱 신뢰할 수 있고 안전한 방법으로 제공하고 어트리뷰션 공급자가 클릭 인젝션에 대응할 수 있도록 하기 위한 목적으로 Google에서 새롭게 도입한 기능입니다. 애플리케이션에서 이를 지원하도록 할 것을 **강력히 권장드립니다** . Google Play 스토어 intent는 설치 참조자 정보를 획득할 수 있는 비교적 덜 안전한 방식입니다. 당분간은 새로운 Google Play Referrer API와 함께 사용 가능하지만, 향후에 지원이 중단될 예정입니다.
-
-#### Google Play Referrer API
-
-앱에서 이를 지원하기 위해 Adjust SDK는 앱에 디폴트로 지원을 추가합니다. 이는 `plugin.xml` 파일에 아래의 라인을 통해 수행됩니다.
-
-```xml
-
-```
-
-`installreferrer` 라이브러리는 Google Maven 리포지토리의 일부입니다. 따라서 앱을 빌드하려면 Google Maven 리포지토리를 앱의 `build.gradle` 파일에 추가해야 합니다. \(한번도 이를 추가하지 않았다면\) :
-
-```gradle
-allprojects {
- repositories {
- jcenter()
- maven {
- url "https://maven.google.com"
- }
- }
-}
-```
-
-또한 [Proguard 설정](#android-proguard) 챕터의 내용을 숙지하고, 해당 챕터에서 언급한 모든 규칙을 비롯하여 특히 다음 기능을 위해 필요한 규칙을 추가했는지 확인하십시오.
-
- -keep public class com.android.installreferrer.** { *; }
-
-**Adjust SDK v4\.12\.0 이상** 버전을 사용 중인 경우 이 기능이 지원됩니다.
-
-#### Google Play 스토어 intent
-
-Google Play 스토어 `INSTALL_REFERRER` intent는 브로드캐스트 리시버에 의해 캡처됩니다. Adjust 설치 리퍼러 브로드캐스트 리시버는 앱에 디폴트로 추가됩니다. 자세한 내용은 Adjust의 [Android SDK README](https://github.com/adjust/android_sdk#gps-intent)에서 확인하시기 바랍니다. Adjust SDK 플러그인의 `plugin.xml` 파일에서 이러한 세팅을 확인할 수 있습니다.
-
-```xml
-
-
-
-
-
-
-
-```
-
-INSTALL\_REFERRER intent를 처리하는 자체 브로드캐스트 리시버를 사용하는 경우, Adjust 브로드캐스트 리시버를 매니페스트 파일에 추가할 필요가 없습니다. 이를 삭제할 수 있지만, [Android 가이드](https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md)에 설명된 대로 자체 리시버 내에서 Adjust 브로드캐스트 리시버에 호출을 추가해야 합니다.
-
-#### Huawei 리퍼러 API
-
-Adjust SDK 4\.21\.1 버전부터는 Huawei 앱 갤러리 버전이 10\.4 이상인 Huawei 기기에 설치 추적을 지원합니다. Huawei 리퍼러 API를 사용하기 위해 추가적인 연동 단계를 수행하지 않아도 됩니다.
-
-### iOS 프레임워크
-
-Adjust SDK 플러그인은 생성된 Xcode 프로젝트에 다음의 3개 iOS 프레임워크를 추가합니다.
-
-* `iAd.framework` \- iAd 캠페인을 실행 중인 경우
-* `AdSupport.framework` \- iOS 광고 Id \(IDFA\) 읽기용
-* `CoreTelephony.framework` \- MCC 및 MNC 정보 읽기용
-* `StoreKit.framework` \- SKAdNetwork 프레임워크와의 커뮤니케이션용
-* `AppTrackingTransparency.framework` \- 트래킹에 대한 사용자의 동의 여부를 묻고 동의 의사를 취득하기 위해
-* `AdjustSdk.framework` \- Adjust 자체 iOS SDK 프레임워크
-
-이러한 세팅은 Adjust SDK 플러그인의 `plugin.xml` 파일에서 확인할 수 있습니다.
-
-```xml
-
-
-
-
-
-
-
-```
-
-iAd 캠페인을 실행하고 있지 않은 경우, `iAd.framework` dependency\(의존성\)을 삭제할 수 있습니다. SKAdNetwork 프레임워크를 사용하지 않는 경우, `StoreKit.framework` dependency를 삭제할 수 있습니다. \(단, 기타 목적을 위해 필요한 경우 제외\)
-
-**참고** : iOS 14 베타 버전에서는 `AppTrackingTransparency.framework`의 추가가 자동적으로 수행되지 않습니다. Xcode 베타 버전을 사용하지 않는 경우 컴파일 타임 에러가 발생할 수 있기 때문입니다. 따라서, Adjust SDK의 iOS 14 기능을 사용하고 싶은 경우에는 Xcode 베타 버전을 사용해야 하며, 이 라인을 `plugin.xml` 파일에서 언커멘트하거나 직접 Xcode 프로젝트에 `AppTrackingTransparency.framework`를 추가해야 합니다.
-
-부가 기능
------
-
-Adjust SDK가 프로젝트에 연동되면 다음과 같은 기능의 장점을 활용할 수 있습니다.
-
-### AppTrackingTransparency 프레임워크
-
-**참고** : 본 기능은 iOS 플랫폼에서만 사용할 수 있습니다.
-
-전송된 각 패키지에 대해 Adjust 백엔드는 사용자 또는 기기를 추적하는 데 사용할 수 있는 앱 관련 데이터에 대한 액세스 동의를 다음 네 가지 상태 중 하나로 수신합니다.
-
-* Authorized\(승인됨\)
-* Denied\(거부됨\)
-* Not Determined\(결정되지 않음\)
-* Restricted\(제한됨\)
-
-기기가 사용자 기기 추적에 사용되는 앱 관련 데이터에 대한 액세스를 승인하는 인증 요청을 수신한 후에는 Authorized 또는 Denied 상태가 반환됩니다.
-
-기기가 사용자 또는 기기를 추적하는 데 사용되는 앱 관련 데이터에 대한 액세스 인증 요청을 수신하기 전에는 Not Determined 상태가 반환됩니다.
-
-앱 추적 데이터 인증 권한이 제한되면 Restricted 상태가 반환됩니다.
-
-사용자에게 표시되는 대화 상자 팝업을 맞춤 설정하지 않으려는 경우, SDK에는 사용자가 대화 상자 팝업에 응답하면 업데이트된 상태를 수신하는 자체 메커니즘이 있습니다. 새로운 동의 상태를 백엔드에 편리하고 효율적으로 전달하기 위해 Adjust SDK는 다음 챕터 '앱 트래킹 인증 래퍼'에 설명된 앱 트래킹 인 메서드와 관련한 래퍼를 제공합니다.
-
-### 앱 트래킹 인증 래퍼
-
-**참고** : 본 기능은 iOS 플랫폼에서만 사용할 수 있습니다.
-
-Adjust SDK는 앱 관련 데이터 액세스에 대한 사용자의 허용을 요청하기 위한 래퍼를 제공합니다. Adjust SDK는 [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) 메서드 상에 빌드된 래퍼가 있습니다. 여기서 사용자의 선택에 관한 정보를 얻기 위해 콜백 메서드를 정의할 수 있습니다. 또한 이 래퍼를 사용하면 사용자가 팝업 대화 상자에 응답하는 즉시 콜백 메서드를 사용하여 다시 전달됩니다. 또한 SDK는 사용자의 선택 정보를 백엔드에 알립니다. Integer 값은 다음과 같은 의미로 콜백 메서드를 통해 전달됩니다.
-
-* 0: `ATTrackingManagerAuthorizationStatusNotDetermined`
-* 1: `ATTrackingManagerAuthorizationStatusRestricted`
-* 2: `ATTrackingManagerAuthorizationStatusDenied`
-* 3: `ATTrackingManagerAuthorizationStatusAuthorized`
-
-이 래퍼를 사용하려면 다음과 같이 호출하면 됩니다:
-
-```js
-Adjust.requestTrackingAuthorizationWithCompletionHandler(function(status) {
- switch (status) {
- case 0:
- // ATTrackingManagerAuthorizationStatusNotDetermined case
- break;
- case 1:
- // ATTrackingManagerAuthorizationStatusRestricted case
- break;
- case 2:
- // ATTrackingManagerAuthorizationStatusDenied case
- break;
- case 3:
- // ATTrackingManagerAuthorizationStatusAuthorized case
- break;
- }
-});
-```
-
-### SKAdNetwork 프레임워크
-
-**참고** : 본 기능은 iOS 플랫폼에서만 사용할 수 있습니다.
-
-Adjust iOS SDK v4\.23\.0 이상을 설치했으며 iOS 14에서 앱을 실행하는 경우, SKAdNetwork와의 통신이 기본적으로 활성화되며 비활성화하도록 설정할 수 있습니다. 활성화하면 SDK가 실행될때 SKAdNetwork 어트리뷰션에 대해 Adjust가 자동으로 등록합니다. 이벤트가 Adjust 대시보드에서 전환 값을 수신하도록 설정된 경우, Adjust 백엔드가 전환 값 데이터를 SDK로 전송합니다. 그런 다음 SDK가 전환 값을 설정합니다. Adjust가 SKAdNetwork 콜백 데이터를 수신한 후에는 해당 정보가 대시보드에 표시됩니다.
-
-Adjust SDK가 SKAdNetwork와 자동으로 통신하지 않도록 하려면 구성 객체에 대해 다음 메서드를 호출하여 해당 메서드를 사용하지 않도록 설정할 수 있습니다:
-
-```js
-adjustConfig.deactivateSKAdNetworkHandling();
-```
-
-### 이벤트 추적
-
-Adjust를 사용하여 모든 유형의 이벤트를 추적할 수 있습니다. 버튼을 누르는 동작을 모두 트래킹 원하신다면 [대시보드](http://adjust.com)에서 새 이벤트 토큰을 생성하면 됩니다. 이벤트 토큰이 `abc123`이라고 가정해 보겠습니다. 버튼의 클릭 핸들러 메서드에 다음 줄을 추가하여 클릭을 추적할 수 있습니다.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-Adjust.trackEvent(adjustEvent);
-```
-
-### 매출 추적
-
-사용자가 광고를 누르거나 앱 내 구매를 진행하여 매출을 창출할 수 있다면 해당 매출과 이벤트를 추적할 수 있습니다. 광고를 한 번 누르는 행위에 €0\.01의 매출 금액이 발생한다고 가정해 보겠습니다. 매출 이벤트를 다음과 같이 추적할 수 있습니다.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.setRevenue(0.01, "EUR");
-Adjust.trackEvent(adjustEvent);
-```
-
-사용자가 통화 토큰을 설정하면 Adjust는 사용자의 선택에 따라 발생 매출을 보고 매출로 자동 전환합니다. [여기에서 통화 전환](https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies)에 대해 자세히 알아보세요.
-
-### 매출 중복 제거
-
-중복되는 매출을 추적하는 것을 방지하기 위해 트랜잭션 ID를 선택적으로 추가할 수 있습니다. 마지막 열 개의 트랜잭션 ID가 보관되며, 중복되는 트랜잭션 ID가 있는 매출 이벤트는 건너뛰게 됩니다. 이러한 방식은 인앱 구매 추적에 특히 유용합니다. 아래 예시를 참조하세요.
-
-앱 내 구매를 추적하려는 경우, 트랜잭션이 완료되고 품목이 구매되었을 때만 `TrackEvent`를 호출하십시오. 이렇게 하면 실제로 발생하지 않은 매출을 추적하는 것을 방지할 수 있습니다.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.setRevenue(0.01, "EUR");
-adjustEvent.setTransactionId("{YourTransactionId}");
-Adjust.trackEvent(adjustEvent);
-```
-
-**참고** : Transaction ID\(트랜젝션 ID\)는 iOS 용어입니다. 완료된 Android 인앱 구매를 위한 고유 ID는 **Order ID\(주문 ID\)** 라고 합니다.
-
-### 인앱 결제 검증
-
-인앱 결제를 검증하고 싶은 경우, 서버에서 결제 수신 정보를 검증하는 툴인 Adjust의 Purchase Verification 제품을 사용할 수 있습니다. Adjust의 Cordova 구매 SDK에 대한 자세한 내용은 [여기](https://github.com/adjust/cordova_purchase_sdk)에서 확인할 수 있습니다.
-
-### 콜백 파라미터
-
-[대시보드](http://adjust.com)에서 이러한 이벤트에 대한 콜백 URL을 등록할 수 있으며, 이벤트가 추적될 때마다 Adjust가 해당 URL에 GET 요청을 전송합니다. 이러한 경우 개체에 키\-값 쌍\(key\-value pair\)을 입력하고 `trackEvent` 메서드에 전달할 수도 있습니다. 이후 Adjust는 이름이 지정된 이러한 파라미터를 사용자의 콜백 URL에 추가합니다.
-
-예를 들어, 사용자가 이벤트를 위해 `http://www.adjust.com/callback` URL을 등록했으며 이벤트 토큰 `abc123`을 추가하고 다음 줄을 실행했다고 가정해 보겠습니다.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.addCallbackParameter("key", "value");
-adjustEvent.addCallbackParameter("foo", "bar");
-Adjust.trackEvent(adjustEvent);
-```
-
-이 경우, Adjust가 이벤트를 추적하여 다음으로 요청을 전송합니다.
-
- http://www.adjust.com/callback?key=value&foo=bar
-
-Adjust는 iOS용 `{idfa}`나 Android용 `{gps_adid}` 등 파라미터 값으로 사용될 수 있는 다양한 자리 표시자를 지원합니다. 결과 콜백에서 `{idfa}` 자리 표시자는 현재 iOS 기기의 광고주를 위한 ID로 대체되며 `{gps_adid}`는 현재 Android 기기의 Google 광고 ID로 대체됩니다. Adjust는 사용자의 맞춤 파라미터를 저장하지 않으며 콜백에 추가하기만 합니다. 또한 이벤트를 위한 콜백을 등록하지 않은 경우에는 이러한 파라미터를 읽지도 않습니다.
-
-Adjust [콜백 가이드](https://docs.adjust.com/en/callbacks)에서 사용 가능한 값의 전체 목록을 비롯하여 URL 콜백을 사용하는 방법을 자세히 알아보실 수 있습니다.
-
-### 파트너 파라미터
-
-앞서 언급한 콜백 파라미터와 유사하게, 사용자가 선택한 네트워크 파트너에 Adjust가 전송할 파라미터를 추가할 수 있습니다. Adjust 대시보드에서 이러한 네트워크를 활성화할 수 있습니다.
-
-이는 상기 콜백 파라미터와 유사한 방식으로 이루어지지만, `AdjustEvent` 인스턴스의 `addPartnerParameter` 파라미터를 호출하여 추가할 수 있습니다.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.addPartnerParameter("key", "value");
-adjustEvent.addPartnerParameter("foo", "bar");
-Adjust.trackEvent(adjustEvent);
-```
-
-Adjust의 [특별 파트너 가이드](https://docs.adjust.com/en/special-partners)에서 특별 파트너에 대한 자세한 내용을 알아보실 수 있습니다.
-
-### 콜백 ID
-
-추적할 각 이벤트에 맞춤 문자열 ID를 추가할 수도 있습니다. 이 ID는 이후에 이벤트 성공 및/또는 이벤트 실패 콜백에서 보고되며, 이를 통해 성공적으로 추적된 이벤트와 그렇지 않은 이벤트를 확인할 수 있습니다. `AdjustEvent` 인스턴스에 `setCallbackId` 메서드를 호출하여 이 ID를 설정할 수 있습니다.
-
-```js
-var adjustEvent = new AdjustEvent("abc123");
-adjustEvent.setCallbackId("Your-Custom-Id");
-Adjust.trackEvent(adjustEvent);
-```
-
-### 구독 트래킹
-
-**참고** : 이 기능은 SDK 4\.22\.0 버전 이상에서만 사용할 수 있습니다.
-
-App Store 및 Play 스토어 구독을 추적한 후 Adjust SDK로 유효성을 검증할 수 있습니다. 구독 항목이 구매되면 다음을 Adjust SDK로 호출하세요.
-
-**앱스토어 구독용**
-
-```js
-var subscription = new AdjustAppStoreSubscription(price, currency, transactionId, receipt);
-subscription.setTransactionDate(transactionDate);
-subscription.setSalesRegion(salesRegion);Adjust.trackAppStoreSubscription(subscription);
-```
-
-**플레이 스토어 구독용**
-
-```js
-var subscription = new AdjustPlayStoreSubscription(price, currency, sku, orderId, signature, purchaseToken);
-subscription.setPurchaseTime(purchaseTime);
-
-Adjust.trackPlayStoreSubscription(subscription);
-```
-
-App Store 구독에 대한 구독 추적 파라미터
-
-* [가격](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc)
-* 통화 \(개체 [currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc)의 [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc)를 전달해야 함\)
-* [트랜잭션 ID](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\(판매 지역\)\(개체 [countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc)의 [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) 를 전달해야 함\)
-
-Play 스토어 구독에 대한 구독 추적 파라미터
-
-* [가격](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros)
-* [통화](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode)
-* [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku)
-* [주문 ID](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid)
-* [서명](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)
-
-**참고:** Adjust SDK의 구독 추적 API를 사용하려면 모든 파라미터가 `string`값으로 전달되어야 합니다. 위에 기술한 파라미터는 구독 추적 이전에 구독 개체로 전달되어야 합니다. Cordova에는 인앱 구매를 처리하는 다양한 라이브러리가 있으며, 구독 구매가 완료된 후 각각 위에 기술된 정보를 특정 형태로 반환해야 합니다. 인앱 구매를 위해 사용하고 있는 라이브러리에서 얻은 응답으로 이 파라미터가 어디에 있는지 확인한 후 그 값을 추출하고, Adjust API에 문자열 값으로 전달해야 합니다.
-
-이벤트 추적과 마찬가지로 콜백 및 파트너 파라미터를 구독 객체에 연결할 수 있습니다.
-
-**앱스토어 구독용**
-
-```js
-var 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);
-```
-
-**플레이 스토어 구독용**
-
-```js
-var 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);
-```
-
-### 세션 파라미터
-
-일부 파라미터는 저장되어 Adjust SDK의 모든 이벤트 및 세션에 전송됩니다. 이러한 파라미터를 한 번 추가하면 로컬로 저장되기 때문에 매번 추가할 필요가 없습니다. 동일한 파라미터를 다시 추가해도 아무 일도 일어나지 않습니다.
-
-이러한 세션 파라미터는 설치 중에도 전송될 수 있도록 Adjust SDK가 실행되기 전에 호출될 수 있습니다. 설치 시에 파라미터를 전송해야 하지만 필요한 값을 실행 이후에만 확보할 수 있는 경우, 이러한 동작이 가능하게 하려면 Adjust SDK의 첫 실행을 [연기](#delay-start)하면 됩니다.
-
-### 세션 콜백 파라미터
-
-Adjust SDK의 모든 이벤트 또는 세션에서 전송될 [이벤트](#callback-parameters)를 위해 등록된 동일한 콜백 파라미터를 저장할 수 있습니다.
-
-세션 콜백 파라미터는 이벤트 콜백 파라미터와 유사한 인터페이스를 가집니다. 키와 값을 이벤트에 추가하는 대신, `Adjust` 인스턴스의 `addSessionCallbackParameter`로의 호출을 통해 추가합니다.
-
-```js
-Adjust.addSessionCallbackParameter("foo", "bar");
-```
-
-세션 콜백 파라미터는 콜백 파라미터와 병합되며 이벤트에 추가됩니다. 이벤트에 추가된 콜백 파라미터는 세션 콜백 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 콜백 파라미터를 이벤트에 추가하면 이벤트에 추가된 콜백 파라미터의 값이 우선시됩니다.
-
-원하는 키를 `Adjust` 인스턴스의 `removeSessionCallbackParameter` 메서드에 전달하여 특정 세션 콜백 파라미터를 삭제할 수 있습니다.
-
-```js
-Adjust.removeSessionCallbackParameter("foo");
-```
-
-세션 콜백 파라미터에서 모든 키와 값을 삭제하려면 `Adjust` 인스턴스의 `resetSessionCallbackParameters` 메서드로 재설정하면 됩니다.
-
-```js
-Adjust.resetSessionCallbackParameters();
-```
-
-### 세션 파트너 파라미터
-
-Adjust SDK의 모든 이벤트 또는 세션마다 전송되는 [세션 콜백 파라미터](#session-callback-parameters)가 있는 것처럼, 세션 파트너 파라미터도 있습니다.
-
-이러한 파라미터는 사용자의 Adjust [대시보드](http://adjust.com)에서 활성화된 네트워크 파트너 연동에 전송됩니다.
-
-세션 파트너 파라미터는 이벤트 파트너 파라미터와 유사한 인터페이스를 가집니다. 키와 값을 이벤트에 추가하는 대신, `Adjust` 인스턴스의 `addSessionPartnerParameter`로의 호출을 통해 추가합니다.
-
-```js
-Adjust.addSessionPartnerParameter("foo", "bar");
-```
-
-세션 파트너 파라미터는 이벤트에 추가된 파트너 파라미터와 병합됩니다. 이벤트에 추가된 파트너 파라미터는 세션 파트너 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 파트너 파라미터를 이벤트에 추가하면 이벤트에 추가된 파트너 파라미터의 값이 우선시됩니다.
-
-원하는 키를 `Adjust` 인스턴스의 `removeSessionPartnerParameter` 메서드에 전달하여 특정 세션 파트너 파라미터를 삭제할 수 있습니다.
-
-```js
-Adjust.removeSessionPartnerParameter("foo");
-```
-
-세션 파트너 파라미터에서 모든 키와 값을 삭제하려면 `Adjust` 인스턴스의 `resetSessionPartnerParameters` 메서드로 재설정하면 됩니다.
-
-```js
-Adjust.resetSessionPartnerParameters();
-```
-
-### 시작 지연
-
-Adjust SDK의 시작을 지연시키면 앱이 고유 ID와 같은 세션 파라미터를 획득할 시간이 확보되므로, 세션 파라미터를 설치 시에 전송할 수 있게 됩니다.
-
-`AdjustConfig` 인스턴스의 `setDelayStart` 필드로 초기 지연 시간을 초 단위로 설정하세요.
-
-```js
-adjustConfig.setDelayStart(5.5);
-```
-
-이렇게 설정하면 Adjust SDK가 초기 설치 세션과 5\.5초 이내로 생성된 이벤트를 전송하지 않습니다. 이 시간이 만료되거나 그동안 `Adjust` 클래스의 `sendFirstPackages()`를 호출하면 모든 세션 파라미터가 지연된 설치 세션 및 이벤트에 추가되며 Adjust SDK가 평소대로 되돌아갑니다.
-
-**Adjust SDK의 최대 시작 지연 시간은 10초입니다** .
-
-### 어트리뷰션 콜백
-
-리스너를 등록하여 트래커 어트리뷰션의 변경 사항에 대한 알림을 받을 수 있습니다. 어트리뷰션에는 다양한 소스가 관련되어 있기 때문에 이 정보는 즉각적으로 제공될 수 없습니다. 가장 간단한 방법은 단일 익명 수신기를 생성하여 **사용자의 어트리뷰션 값이 변경될 때마다** 호출되도록 하는 것입니다.
-
-SDK를 시작하기 전에 `AdjustConfig` 인스턴스를 사용하여 익명 리스너를 추가합니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setAttributionCallbackListener(function(attribution) {
-// Printing all attribution properties.
- console.log("Attribution changed!");
- console.log(attribution.trackerToken);
- console.log(attribution.trackerName);
- console.log(attribution.network);
- console.log(attribution.campaign);
- console.log(attribution.adgroup);
- console.log(attribution.creative);
- console.log(attribution.clickLabel);
- console.log(attribution.adid);
-});
-
-Adjust.create(adjustConfig);
-```
-
-리스너 함수 내에서 `attribution` 파라미터에 액세스할 수 있습니다. 그 속성에 대한 요약 정보는 다음과 같습니다.
-
-* `trackerToken` 현재 어트리뷰션의 트래커 토큰.
-* `trackerToken` 현재 어트리뷰션의 트래커 토큰.
-* `network` 현재 어트리뷰션의 네트워크 그룹화 수준.
-* `campaign` 현재 어트리뷰션의 캠페인 그룹화 수준.
-* `network` 현재 어트리뷰션의 광고 그룹 그룹화 수준.
-* `network` 현재 어트리뷰션의 크리에이티브 그룹화 수준.
-* `clickLabel` 현재 어트리뷰션의 클릭 레이블.
-* `adid` Adjust 기기 식별자.
-
-[해당되는 어트리뷰션 데이터 정책](https://github.com/adjust/sdks/blob/master/doc/attribution-data.md)을 고려해야 합니다.
-
-### 세션 및 이벤트 콜백
-
-콜백을 등록하여 성공적으로 추적되었거나 추적에 실패한 이벤트 및/또는 세션에 대한 알림을 받을 수 있습니다.
-
-성공적으로 추적된 이벤트에 대한 콜백 함수를 구현하려면 어트리뷰션 콜백과 동일한 단계를 따르세요.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setEventTrackingSucceededCallbackListener(function(eventSuccess) {
-// Printing all event success properties.
- console.log("Event tracking succeeded!");
- console.log(eventSuccess.message);
- console.log(eventSuccess.timestamp);
- console.log(eventSuccess.eventToken);
- console.log(eventSuccess.callbackId);
- console.log(eventSuccess.adid);
- console.log(eventSuccess.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-다음 콜백 함수는 실패한 이벤트에 사용됩니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setEventTrackingFailedCallbackListener(function(eventFailure) {
-// Printing all event failure properties.
- console.log("Event tracking failed!");
- console.log(eventFailure.message);
- console.log(eventFailure.timestamp);
- console.log(eventFailure.eventToken);
- console.log(eventFailure.callbackId);
- console.log(eventFailure.adid);
- console.log(eventFailure.willRetry);
- console.log(eventFailure.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-성공적으로 추적된 세션의 경우:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setSessionTrackingSucceededCallbackListener(function(sessionSuccess) {
-// Printing all session success properties.
- console.log("Session tracking succeeded!");
- console.log(sessionSuccess.message);
- console.log(sessionSuccess.timestamp);
- console.log(sessionSuccess.adid);
- console.log(sessionSuccess.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-추적에 실패한 세션의 경우:
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setSessionTrackingFailedCallbackListener(function(sessionFailure) {
-// Printing all session failure properties.
- console.log("Session tracking failed!");
- console.log(sessionFailure.message);
- console.log(sessionFailure.timestamp);
- console.log(sessionFailure.adid);
- console.log(sessionFailure.willRetry);
- console.log(sessionFailure.jsonResponse);
-});
-
-Adjust.create(adjustConfig);
-```
-
-SDK가 패키지를 서버로 전송하려고 시도한 후에 콜백 함수가 호출됩니다. 콜백 내에서 콜백에 대한 반응 데이터 개체에 액세스할 수 있습니다. 세션 반응 데이터 속성에 대한 요약 정보는 다음과 같습니다.
-
-* `var message` 서버로부터의 메시지 또는 SDK에 의해 로깅된 오류.
-* `var timestamp` 서버의 타임스탬프.
-* `var adid` Adjust에서 제공하는 고유 기기 식별자.
-* `var jsonResponse` 서버로부터의 응답을 포함하는 JSON 개체.
-
-두 이벤트 응답 데이터 개체는 다음을 포함합니다.
-
-* `var eventToken` 추적된 패키지가 이벤트인 경우 해당 이벤트 토큰.
-* `var callbackId` 이벤트 오브젝트에 맞춤 설정된 콜백 ID.
-
-두 이벤트 및 세션 실패 개체는 다음을 포함합니다.
-
-* `var willRetry` 이후 패키지 재전송 시도가 있을 것임을 알립니다.
-
-### 추적 비활성화
-
-`Adjust` 인스턴스의 `setEnabled` 메서드를 호출하고 활성화된 파라미터를 `false`로 설정하여 Adjust SDK의 추적을 비활성화할 수 있습니다. 이 설정은 **세션 간에 유지되지만** , 첫 세션 이후에만 활성화될 수 있습니다.
-
-```js
-Adjust.setEnabled(false);
-```
-
-Adjust SDK가 `Adjust` 인스턴스의 `IsEnabled` 메서드를 사용하여 현재 활성화된 경우 검증할 수 있습니다. 언제든지 `setEnabled` 메서드를 호출하고 파라미터를 `true`로 설정하여 Adjust SDK를 활성화할 수 있습니다.
-
-### 오프라인 모드
-
-Adjust 서버에 대한 전송을 연기하고 추적된 데이터가 이후에 전송되도록 유지함으로써 Adjust SDK를 오프라인 모드로 설정할 수 있습니다. 오프라인 모드에서는 모든 정보가 파일에 저장되기 때문에 너무 많은 이벤트를 발생시키지 않도록 주의해야 합니다.
-
-`Adjust` 인스턴스의 `setOfflineMode` 메서드를 호출하고 파라미터를 `true`로 설정하여 오프라인 모드를 활성화할 수 있습니다.
-
-```js
-Adjust.setOfflineMode(true);
-```
-
-반대로 `setOfflineMode`를 `false`로 호출하여 오프라인 모드를 비활성화할 수 있습니다. Adjust SDK가 다시 온라인 모드가 되면 저장된 모든 정보가 정확한 시간 정보와 함께 Adjust 서버로 전송됩니다.
-
-추적 비활성화와는 다르게 **이 설정은 세션 간에 유지되지 않습니다** . 즉, 앱이 오프라인 모드에서 종료되었더라도 Adjust SDK는 항상 온라인 모드로 시작됩니다.
-
-### 이벤트 버퍼링
-
-앱이 이벤트 추적을 많이 사용하는 경우, 일부 HTTP 요청을 연기하여 HTTP 요청을 1분에 한 번씩 일괄로 보내고자 할 수 있습니다. `setEventBufferingEnabled` 메서드를 호출하여 `AdjustConfig` 인스턴스를 통해 이벤트 버퍼링을 활성화할 수 있습니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-adjustConfig.setEventBufferingEnabled(true);
-Adjust.create(adjustConfig);
-```
-
-### GDPR 잊혀질 권리
-
-EU의 개인정보보호법\(GDPR\) 제 17조에 따라, 사용자는 잊혀질 권리\(Right to be Forgotten\)를 행사했음을 Adjust에 알릴 수 있습니다. 다음 메서드를 호출하면 Adjust SDK가 잊혀질 권리에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다.
-
-```js
-Adjust.gdprForgetMe();
-```
-
-이 정보를 수신한 후 Adjust는 해당 사용자의 데이터를 삭제하며 Adjust SDK는 해당 사용자에 대한 추적을 중지합니다. 이 기기로부터의 요청은 향후 Adjust에 전송되지 않습니다.
-
-### \#\#\# 특정 사용자의 경우 제3자 공유 비활성화
-
-이제 사용자가 마케팅 목적으로 파트너와 데이터가 공유되지 않도록 중단할 수 있는 권리를 행사했으나 통계 목적으로는 공유할 수 있도록 허용한 경우, 이를 Adjust에 알릴 수 있습니다.
-
-다음 메서드를 호출하여 Adjust SDK가 데이터 공유 비활성화에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다:
-
-```cs
-Adjust.disableThirdPartySharing();
-```
-
-이 정보를 수신하면 Adjust는 특정 사용자의 데이터를 파트너와 공유하는 것을 차단하고 Adjust SDK는 계속 정상적으로 작동합니다.
-
-### SDK Signature\(SDK 서명\)
-
-계정 관리자는 Adjust SDK 서명을 활성화해야 합니다. 이 기능의 사용에 관심이 있는 경우 Adjust 고객 지원팀\([support@adjust.com](mailto:support@adjust.com)\)에 문의하시기 바랍니다.
-
-SDK 서명이 이미 계정에서 활성화되어 있으며 Adjust 대시보드의 App Secret에 액세스할 수 있는 경우, 아래 방법을 사용하여 SDK 서명을 앱에 연동하세요.
-
-App Secret은 모든 비밀 파라미터\(`secretId`, `info1`, `info2`, `info3`, `info4`\)를 `AdjustConfig` 인스턴스의 `setAppSecret` 메서드에 전달하여 설정됩니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-adjustConfig.setAppSecret(secretId, info1, info2, info3, info4);
-Adjust.create(adjustConfig);
-```
-
-### 백그라운드 추적
-
-Adjust SDK는 기본적으로 **앱이 백그라운드에서 작동하는 동안 HTTP 요청 전송을 일시 중지** 하도록 설정되어 있습니다. 이 설정은 `setSendInBackground` 메서드를 호출하여 `AdjustConfig` 인스턴스에서 변경할 수 있습니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-adjustConfig.setSendInBackground(true);
-Adjust.create(adjustConfig);
-```
-
-아무 것도 설정되지 않으면 백그라운드 전송이 **기본적으로 비활성화됩니다** .
-
-### 기기 ID
-
-특정 서비스\(예: Google Analytics\)는 중복 보고를 방지하기 위해 기기 및 클라이언트 ID 통합을 요청합니다.
-
-### iOS 광고 ID
-
-IDFA를 획득하려면 `Adjust` 인스턴스의 `getIdfat` 메서드를 호출합니다. 값을 획득하려면 해당 메서드로 콜백을 전달해야 합니다.
-
-```js
-Adjust.getIdfa(function(idfa) {
- // Use idfa value.
-});
-```
-
-### Google Play 서비스 광고 ID
-
-Google 광고 ID를 획득하려면 `Adjust` 인스턴스의 `getGoogleAdId` 메서드를 호출하면 됩니다. 값을 획득하려면 해당 메서드로 콜백을 전달해야 합니다.
-
-```js
-Adjust.getGoogleAdId(function(googleAdId) {
- // Use googleAdId value.
-});
-```
-
-콜백 메서드에서 `googleAdId` 변수로 Google 광고 ID에 액세스할 수 있습니다.
-
-### Amazon 광고 ID
-
-Amazon 광고 ID를 획득하려면 `Adjust` 인스턴스의 `getAmazonAdID` 메서드를 호출하면 됩니다.
-
-```js
-Adjust.getAmazonAdId(function(amazonAdId) {
- // Use amazonAdId value.
-});
-```
-
-콜백 메서드에서 `amazonAdId` 변수로 Amazon 광고 ID에 액세스할 수 있습니다.
-
-### Adjust 기기 식별자
-
-앱이 설치된 모든 기기에 대해 Adjust 백엔드는 고유한 **Adjust 기기 식별자** \( **adid** \)를 생성합니다. 이 식별자를 획득하려면 `Adjust` 인스턴스의 `getAdid` 메서드를 호출하면 됩니다. 값을 획득하려면 해당 메서드로 콜백을 전달해야 합니다.
-
-```js
-Adjust.getAdid(function(adid) {
- // Use adid value.
-});
-```
-
-**참고** : **adid** 정보는 Adjust 백엔드가 앱의 설치를 추적한 다음에만 확보할 수 있습니다. 그 다음부터는 Adjust SDK가 기기 **adid** 정보를 보유하게 되며, 이 메서드를 사용하여 해당 정보에 액세스할 수 있습니다. 따라서 SDK가 초기화되고 앱 설치가 추적되기 전까지는 **adid** 값에 액세스할 수 **없습니다** .
-
-### 사용자 어트리뷰션
-
-
-
-이 콜백은 [어트리뷰션 콜백 섹션](#attribution-callback)에 설명된 대로 실행되며, 변경될 때마다 새 어트리뷰션에 대한 정보를 제공합니다. 사용자의 현재 애트리뷰션에 대해 언제든지 액세스하고 싶다면, `Adjust` 인스턴스의 `getAttribution` 메서드를 호출하면 됩니다.
-
-```js
-Adjust.getAttribution(function(attribution) {
- // Use attribution object in same way like in attribution callback.
-});
-```
-
-**참고** : 사용자의 현재 어트리뷰션 상태에 대한 정보는 Adjust 백엔드가 앱의 설치를 추적하고 어트리뷰션 콜백이 실행된 다음에만 사용할 수 있습니다. 그 다음부터는 Adjust SDK가 사용자의 어트리뷰션 상태를 보유하게 되며, 이 메서드를 사용하여 해당 정보에 액세스할 수 있습니다. 따라서 SDK가 초기화되고 어트리뷰션 콜백이 실행되기 전까지는 사용자의 어트리뷰션 값에 액세스할 수 **없습니다** .
-
-### 푸시 토큰
-
-Adjust에 푸시 알림 토큰을 전송하려면 **앱이 토큰을 수신하거나 업데이트될 때** 다음 호출을 Adjust에 추가하세요.
-
-```js
-Adjust.setPushToken("YourPushNotificationToken");
-```
-
-푸시 토큰은 Audience Builder 및 클라이언트 콜백에 사용되며 향후 출시될 삭제 추적 기능에 필요합니다.
-
-### 사전 설치 트래커
-
-Adjust SDK를 사용하여 본인의 앱을 발견하고 기기에 사전 설치한 사용자를 식별하려면 다음 단계를 따르세요.
-
-1. [대시보드](http://adjust.com)에서 새 트래커를 생성합니다.
-
-2. 앱 델리게이트를 열고 `AdjustConfig` 인스턴스의 기본 트래커를 설정합니다.
-
- ```js
- var adjustConfig = new AdjustConfig(appToken, environment);
- adjustConfig.setDefaultTracker("{TrackerToken}");
- Adjust.create(adjustConfig);
- ```
-
-`{TrackerToken}`을 2단계에서 생성한 트래커 토큰으로 교체합니다. 대시보드에는 트래커 URL이 표시됩니다\(`http://app.adjust.com/` 포함\). 소스 코드에서 전체 URL이 아닌 6글자의 토큰만 지정해야 합니다.
-
-1. 앱을 빌드하고 실행합니다. 앱의 로그 출력에서 다음과 같은 라인이 표시됩니다.
-
- Default tracker: 'abc123'
-
-### 딥링크
-
-Adjust 트래커 URL을 사용하며 URL로부터 앱으로 딥링킹하는 옵션을 설정한 경우, 딥링크 및 그 콘텐츠에 대한 정보를 얻을 수 있습니다. 사용자가 앱을 이미 설치한 경우\(표준 딥링크 시나리오\) 또는 기기에 앲이 없는 경우\(지연 딥링크 시나리오\)에 URL 조회가 발생할 수 있습니다.
-
-### 표준 딥링크 시나리오
-
-표준 딥링크 시나리오는 플랫폼에 특화된 기능으로, 이를 지원하려면 앱에 추가적인 설정을 더해야 합니다. 만일 사용자가 이미 앱을 설치하였고 딥링크 정보가 담긴 트래커 URL에 도달하였다면, 앱이 열리고 딥링크의 내용이 앱으로 전송되어 파싱 및 다음 작업을 결정할 수 있습니다.
-
-**iOS용 참고** : iOS 9가 나오면서 Apple은 에서 딥링크 처리 방식을 변경했습니다. 앱에 사용하려는 시나리오\(또는 다양한 기기를 지원하기 위해 둘 다 사용하려는 경우\)에 따라 다음 시나리오 중 하나 또는 둘 다를 처리하도록 앱을 설정해야합니다.
-
-### 안드로이드와 iOS 8 이하 버전에서의 딥링크
-
-안드로이드와 iOS 8 이하 버전에서 딥링크 처리를 지원하려면 `커스텀 URL 스킴` 플러그인을 [여기](https://github.com/EddyVerbruggen/Custom-URL-scheme)에서 사용하면 됩니다..
-
-해당 플러그인을 성공적으로 연동 후, 본 [섹션](https://github.com/EddyVerbruggen/Custom-URL-scheme#3-usage)에서 언급된 플러그인에 사용되었던 콜백 메서드를 통해 사용자의 기기에서 앱을 열은 URL 내용에 액세스할 수 있습니다.
-
-```js
-function handleOpenURL(url) {
- setTimeout(function () {
- // Check content of the url object and get information about the URL.
- }, 300);
-};
-```
-
-이 플러그인의 연동이 완료되면, **안드로이드와 iOS 8 이하** 에서도 딥링크를 처리할 수 있습니다.
-
-### iOS 9 이상 버전에서의 딥링크
-
-**iOS 9** 가 나오면서 Apple은 위에 기술된 기존의 커스텀 URL 스킴을 더 이상 지원하지 않으며, `유니버설 링크`를 사용해야 합니다. iOS 9 이상 버전에서 앱에 딥링크를 지원하고 싶은 경우, 유니버설 링크 처리에 대한 지원을 추가해야 합니다.
-
-우선 Adjust 대시보드에서 앱의 유니버설 링크를 활성화해야 합니다. 이에 대한 정보는 Adjust의 iOS SDK [설명서](https://github.com/adjust/ios_sdk#deeplinking-setup-new)에서 확인할 수 있습니다.
-
-대시보드에서 앱의 유니버설 링크 처리를 활성화한 이후, 앱에도 이에 대한 지원을 추가해야 합니다. 이는 Cordova 앱에 본 [플러그인](https://github.com/nordnet/cordova-universal-links-plugin)을 추가하면 됩니다. 본 플러그인의 설명서에는 성공적인 통합을 위해 수행되어야 하는 과정들이 자세히 명시되어 있으니 꼭 읽기 바랍니다.
-
-**참고** : 본 설명서에서 도메인/웹사이트가 있어야 하거나 루트 도메인에 파일을 업로드해야한다는 내용은 무시해도 됩니다. 이 부분은 Adjust가 관리하고 있으니, 설명서의 이 부분은 건너뛰어도 됩니다. 또한, 안드로이드 플랫폼에서는 본 플러그인의 설명을 따르지 않아도 됩니다. 안드로이드의 딥링크는 여전히 `커스텀 URL 스킴` 플러그인을 통해 처리되기 때문입니다.
-
-Adjust의 대시보드에서 앱의 유니버설 링크를 활성화한 이후 `Cordova 유니버설 링크 플러그인`의 연동을 완료하려면 다음의 과정이 반드시 수행되어아 합니다.
-
-### `config.xml`파일 수정
-
-`config.xml` 파일에 다음의 엔트리를 추가해야 합니다.
-
-```xml
-
-
-
-
-
-```
-
-`[hash]` 값은 Adjust 대시보드에서 생성한 값으로 바꿔야 합니다. 또한 원하는 이름으로 이벤트 이름을 변경할 수 있습니다.
-
-### 플러그인의 내용은 `ul_web_hooks/ios/`에서 확인할 수 있습니다.
-
-앱의 `Cordova 유니버설 링크 플러그인` 설치 경로에서 `ul_web_hooks/ios/` 폴더의 내용을 확인하기 바랍니다. 해당 폴더에는 `[hash].ulink.adjust.com#apple-app-site-association`라는 이름으로 생성된 파일이 있습니다. 해당 파일의 내용은 다음와 같아야 합니다.
-
- {
- "applinks": {
- "apps": [],
- "details": [
- {
- "appID": ".com.adjust.examples",
- "paths": [
- "/ulink/*"
- ]
- }
- ]
- }
- }
-
-### `index.js` 파일에 플러그인 통합
-
-`deviceready` 이벤트의 발생 이후, `config.xml` 파일에서 정의한 이벤트를 구독해야 하며, 해당 이벤트가 발생할 때 실행되는 콜백 메서드를 정의해야 합니다. 안드로이드에서는 딥링크를 처리하기 위한 본 플러그인이 필요하지 않으며, 앱이 iOS 기기에서 시행되는 경우에만 이를 구독해야 합니다.
-
-```js
-// ...
-
-var app = {
- initialize: function() {
- this.bindEvents();
- },
-
- bindEvents: function() {
- document.addEventListener('deviceready', this.onDeviceReady, false);
- },
-
- onDeviceReady: function() {
- if (device.platform == "iOS") {
- universalLinks.subscribe('adjustDeepLinking', app.didLaunchAppFromLink);
- }
- },
-
- didLaunchAppFromLink: function(eventData) {
- // Check content of the eventData.url object and get information about the URL.
- }
-}
-// ...
-```
-
-본 과정이 완료되면 iOS 9 이상 버전에서 딥링크에 대한 지원이 성공적으로 추가됩니다.
-
-### 디퍼드 딥링크 시나리오
-
-Android와 iOS에서 지연 딥링크가 바로 지원되지 않지만, Adjust SDK를 통해 지연 딥링크를 사용할 수 있습니다.
-
-디퍼드 딥링크 시나리오에서 URL 콘텐츠에 대한 정보를 얻으려면 URL 콘텐츠가 전달되는 파라미터 하나를 수신하는 `AdjustConfig` 개체에 콜백 메서드를 설정해야 합니다. `setDeeplinkCallbackListener` 메서드를 호출하여 설정 개체에 이 메서드를 설정해야 합니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setDeferredDeeplinkCallbackListener(function(deeplink) {
- console.log("Deferred deep link URL content: " + deeplink);
-});
-
-Adjust.create(adjustConfig);
-```
-
-디퍼드 딥링크 시나리오에서 `AdjustConfig` 개체에 설정할 수 있는 추가 설정이 하나 있습니다. Adjust SDK가 디퍼드 딥링크 정보를 획득하면 SDK가 이 URL을 열도록 할지 선택할 수 있습니다. 설정 개체의 `setShouldLaunchDeeplink` 메서드를 호출하여 이 옵션을 설정할 수 있습니다.
-
-```js
-var adjustConfig = new AdjustConfig(appToken, environment);
-
-adjustConfig.setShouldLaunchDeeplink(true);
-// or adjustConfig.setShouldLaunchDeeplink(false);adjustConfig.setDeeplinkCallbackListener(function(deeplink) {
- console.log("Deferred deep link URL content: " + deeplink);
-});
-
-Adjust.create(adjustConfig);
-```
-
-아무 것도 설정되지 않은 경우 **Adjust SDK는 기본적으로 항상 URL 실행을 시도합니다** .
-
-### 딥링크를 통한 리어트리뷰션
-
-Adjust를 사용하면 딥링크를 사용하여 리타겟팅 캠페인을 실행할 수 있습니다. 이에 대한 자세한 정보는 [공식 문서](https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link)에서 참조하실 수 있습니다.
-
-이 기능을 사용하는 경우, 사용자에 대한 리어트리뷰션이 적절히 이루어지려면 앱에서 Adjust SDK에 대한 추가적인 호출을 수행해야 합니다.
-
-앱의 딥링크 콘텐츠 정보를 수신했으면 `Adjust` 인스턴스의 `appWillOpenUrl` 메서드에 호출을 추가합니다. 이 호출을 수행함으로써 Adjust SDK는 딥링크 내부에서 새 어트리뷰션 정보를 찾으며, 정보가 있는 경우에는 Adjust 백앤드에 전송됩니다. 딥링크 콘텐츠를 포함하는 Adjust 트래커 URL에 대한 클릭으로 인해 사용자에 대한 리어트리뷰션이 이루어져야 하는 경우, 앱에서 해당 사용자에 대한 새 어트리뷰션 정보와 함께 [어트리뷰션 콜백](#attribution-callback)이 실행되는 것을 볼 수 있습니다.
-
-위에 명시된 코드 예시에서 `appWillOpenUrl` 메서드의 호출은 다음과 같이 수행되어야 합니다.
-
-```js
-function handleOpenURL(url) {
- setTimeout(function () {
- // Check content of the url object and get information about the URL.
- Adjust.appWillOpenUrl(url);
- }, 300);
-};
-```
-
-```js
-// ...
-
-var app = {
- initialize: function() {
- this.bindEvents();
- },
-
- bindEvents: function() {
- document.addEventListener('deviceready', this.onDeviceReady, false);
- },
-
- onDeviceReady: function() {
- if (device.platform == "iOS") {
- universalLinks.subscribe('adjustDeepLinking', app.didLaunchAppFromLink);
- }
- },
-
- didLaunchAppFromLink: function(eventData) {
- // Check content of the eventData.url object and get information about the URL.
- Adjust.appWillOpenUrl(eventData.url);
- }
-}
-// ...
-```
-
-라이선스
-----
-
-Adjust SDK는 MIT 라이센스 하에 사용이 허가됩니다.
-
-Copyright \(c\) 2012\-2018 Adjust GmbH, http://www.adjust.com
-
-다음 조건하에서 본 소프트웨어와 관련 문서 파일\(이하 "소프트웨어"\)의 사본을 보유한 제3자에게 소프트웨어의 사용, 복사, 수정, 병합, 게시, 배포, 재실시권 및/또는 사본의 판매 등을 포함하여 소프트웨어를 제한 없이 사용할 수 있는 권한을 무료로 부여하며, 해당 제3자는 소프트웨어를 보유한 이에게 이러한 이용을 허가할 수 있습니다.
-
-본 소프트웨어의 모든 사본 또는 상당 부분에 위 저작권 공고와 본 권한 공고를 포함해야 합니다.
-
-소프트웨어는 "있는 그대로" 제공되며, 소프트웨어의 상품성과 특정 목적에의 적합성 및 비 침해성에 대해 명시적이거나 묵시적인 일체의 보증을 하지 않습니다. 저자 또는 저작권자는 본 소프트웨어와 이의 사용 또는 기타 소프트웨어 관련 거래로 인해 발생하는 모든 클레임, 손해 또는 기타 법적 책임에 있어서 계약 또는 불법 행위와 관련된 소송에 대해 어떠한 책임도 부담하지 않습니다.
-
diff --git a/doc/migrate.md b/doc/migrate.md
deleted file mode 100644
index 50533914..00000000
--- a/doc/migrate.md
+++ /dev/null
@@ -1,104 +0,0 @@
-## Migrate your Adjust SDK for Cordova to 4.38.1 from 3.4.1
-
-### Migration procedure
-
-Go to your project's folder and remove any previous version of the adjust SDK plugin you have.
-
-```
-> cordova plugins rm com.adjust.sdk
-Uninstalling com.adjust.sdk from android
-Uninstalling com.adjust.sdk from ios
-```
-
-After you have successfully removed previous version of plugin, install latest version of plugin.
-
-```
-> cordova plugin add path_to_folder/cordova_sdk
-Installing "com.adjust.sdk" for android
-Installing "com.adjust.sdk" for ios
-```
-
-In previous versions, you had to copy the adjust `hooks` folder to your project's root folder. By
-doing this, you had `hooks/after_prepare/replace_adjust.js` in your project's folder. If
-`after_prepare/replace_adjust.js` is the only content of your `hooks` folder, you can delete entire
-`hooks` folder. If you have some other hooks you are using in your app, then delete just
-`replace_adjust.js` file from `hooks/after_prepare` folder.
-
-### SDK initialization
-
-We have changed how you configure and start the adjust SDK. All initial setup is now done with a new
-instance of the `AdjustConfig` object. The following steps should now be taken to configure the adjust SDK:
-
-1. Create an instance of an `AdjustConfig` config object with the app token and environment.
-2. Optionally, you can now call methods of the `AdjustConfig` object to specify available options.
-3. Launch the SDK by invoking `Adjust.create` with the config object.
-
-Here is an example of how the setup might look before and after the migration:
-
-##### Before
-
-You needed to edit `adjust.json` file and to replace predefined properties with your own.
-
-```javascript
-{
- "appToken" : "{yourAppToken}",
- "environment" : "sandbox",
- "logLevel" : "info",
- "enableEventBuffering" : "false"
-}
-```
-
-`replace_adjust.js` was taking care that values you set in this file be used when your app starts
-and the adjust instance was automatically initialized with these values for you.
-
-##### After
-
-```cs
-var adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
-adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose);
-
-Adjust.create(adjustConfig);
-```
-
-### Event tracking
-
-We also introduced proper event objects that are set up before they are tracked. Again, an example of how it
-might look like before and after:
-
-##### Before
-
-```javascript
-Adjust.trackEvent('{EventToken}');
-```
-
-##### After
-
-```javascript
-var adjustEvent = new AdjustEvent("{EventToken}");
-Adjust.trackEvent(adjustEvent);
-```
-
-### Revenue tracking
-
-Revenues are now handled like normal events. You just set a revenue and a currency to track revenues.
-Note that it is no longer possible to track revenues without associated event tokens. You might need
-to create an additional event token in your dashboard.
-
-*Please note* - the revenue format has been changed from a cent float to a whole currency-unit float.
-Current revenue tracking must be adjusted to whole currency units (i.e., divided by 100) in order to
-remain consistent.
-
-##### Before
-
-```cs
-Adjust.trackRevenue(1.0, "{EventToken}");
-```
-
-##### After
-
-```cs
-var adjustEvent = new AdjustEvent("{EventToken}");
-adjustEvent.setRevenue(0.01, "EUR");
-
-Adjust.trackEvent(adjustEvent);
-```
diff --git a/example-cordova/package-lock.json b/example-cordova/package-lock.json
index a266e4bd..cd926a6d 100644
--- a/example-cordova/package-lock.json
+++ b/example-cordova/package-lock.json
@@ -13,8 +13,8 @@
},
"devDependencies": {
"com.adjust.sdk": "file:../temp_plugin",
- "cordova-android": "^12.0.1",
- "cordova-ios": "^7.1.0",
+ "cordova-android": "^13.0.0",
+ "cordova-ios": "^7.1.1",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-customurlscheme": "^5.0.2",
"cordova-plugin-device": "github:apache/cordova-plugin-device",
@@ -25,7 +25,7 @@
},
"../temp_plugin": {
"name": "com.adjust.sdk",
- "version": "4.38.1",
+ "version": "5.0.0",
"dev": true,
"engines": [
{
@@ -108,9 +108,9 @@
}
},
"node_modules/android-versions": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.9.0.tgz",
- "integrity": "sha512-13O2B6PQMEM4ej9n13ePRQeckrCoKbZrvuzlLvK+9s2QmncpHDbYzZxhgapN32sJNoifN6VAHexLnd/6CYrs7Q==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-2.0.0.tgz",
+ "integrity": "sha512-07fhKL8EjV+ORQggGHcKmhLECwxBlRFimfvsjhfUCYqNDAbcH4qaEaN0AO3DnWtgHqRNfWAxhnWOpx+ZpRMymw==",
"dev": true,
"dependencies": {
"semver": "^7.5.2"
@@ -220,24 +220,24 @@
"dev": true
},
"node_modules/cordova-android": {
- "version": "12.0.1",
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-12.0.1.tgz",
- "integrity": "sha512-6fXWoYb/X5AJlluhBg5RvOaX6iRxsvNH7yEOiXzUmLIflf5Ho7LtYCSKZaWMHh3f5cJe/sPCBKmFFBS+EWepVg==",
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-13.0.0.tgz",
+ "integrity": "sha512-uQG+cSyrB1NMi2aIzihldIupHB9WGpZVvrMMMAAtnyc6tDlEk7gweSSaFsEONyGAnteRYpIvrzg/YwDW08PcUg==",
"dev": true,
"dependencies": {
- "android-versions": "^1.8.1",
+ "android-versions": "^2.0.0",
"cordova-common": "^5.0.0",
- "dedent": "^1.0.1",
+ "dedent": "^1.5.3",
"execa": "^5.1.1",
- "fast-glob": "^3.2.12",
- "fs-extra": "^11.1.1",
+ "fast-glob": "^3.3.2",
+ "fs-extra": "^11.2.0",
"is-path-inside": "^3.0.3",
- "nopt": "^7.1.0",
- "properties-parser": "^0.3.1",
- "semver": "^7.3.8",
+ "nopt": "^7.2.1",
+ "properties-parser": "^0.6.0",
+ "semver": "^7.6.2",
"string-argv": "^0.3.1",
"untildify": "^4.0.0",
- "which": "^3.0.0"
+ "which": "^4.0.0"
},
"engines": {
"node": ">=16.13.0"
@@ -257,19 +257,28 @@
}
}
},
+ "node_modules/cordova-android/node_modules/isexe": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
+ "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=16"
+ }
+ },
"node_modules/cordova-android/node_modules/which": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
- "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
"dev": true,
"dependencies": {
- "isexe": "^2.0.0"
+ "isexe": "^3.1.1"
},
"bin": {
"node-which": "bin/which.js"
},
"engines": {
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ "node": "^16.13.0 || >=18.0.0"
}
},
"node_modules/cordova-common": {
@@ -301,9 +310,9 @@
}
},
"node_modules/cordova-ios": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.0.tgz",
- "integrity": "sha512-9/vPU+GWRdfxNIkAc9Gq6yejMIgpy59ycP8WyVJJ7HfuPSTBUQT8AS2h5ZJOeN4Y/URyEwxQCrAqSADDBVCESA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.1.tgz",
+ "integrity": "sha512-JwTyPxWcAZlbIOR5QO6TaJzkoSzfrp7jrlX01bWZ7Sxp0PYXejAJbA6J0W4u11M+atrQRNimNltZDyAlSBW2tw==",
"dev": true,
"dependencies": {
"cordova-common": "^5.0.0",
@@ -372,16 +381,19 @@
]
},
"node_modules/cordova-plugin-device": {
- "version": "2.2.0-dev",
- "resolved": "git+ssh://git@github.com/apache/cordova-plugin-device.git#3e199bfe3eda15b06e9654c787845d814bae595a",
+ "version": "3.0.1-dev",
+ "resolved": "git+ssh://git@github.com/apache/cordova-plugin-device.git#8685a7ae93be23309fb56bc8d496f4af8d7df9ec",
"dev": true,
- "license": "Apache-2.0",
"engines": {
"cordovaDependencies": {
"2.1.0": {
"cordova-electron": ">=3.0.0"
},
"3.0.0": {
+ "cordova-android": ">=7.0.0",
+ "cordova-electron": ">=3.0.0"
+ },
+ "4.0.0": {
"cordova": ">100"
}
}
@@ -728,12 +740,15 @@
}
},
"node_modules/is-core-module": {
- "version": "2.13.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
- "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
+ "version": "2.15.1",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
+ "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==",
"dev": true,
"dependencies": {
- "hasown": "^2.0.0"
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -838,18 +853,6 @@
"integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==",
"dev": true
},
- "node_modules/lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "dev": true,
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -912,9 +915,9 @@
"dev": true
},
"node_modules/nopt": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz",
- "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==",
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
+ "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
"dev": true,
"dependencies": {
"abbrev": "^2.0.0"
@@ -1046,13 +1049,10 @@
}
},
"node_modules/properties-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
- "integrity": "sha512-AkSQxQAviJ89x4FIxOyHGfO3uund0gvYo7lfD0E+Gp7gFQKrTNgtoYQklu8EhrfHVZUzTwKGZx2r/KDSfnljcA==",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.6.0.tgz",
+ "integrity": "sha512-qvr2cSmoA0dln0MARAKwBzPkkXn7FqwX+RVVNpMdMJc7rt9mqO2cXwluxtux9fHrLhjnPFaQkS8BM0kFrTCnSw==",
"dev": true,
- "dependencies": {
- "string.prototype.codepointat": "^0.2.0"
- },
"engines": {
"node": ">= 0.3.1"
}
@@ -1184,13 +1184,10 @@
"dev": true
},
"node_modules/semver": {
- "version": "7.5.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
- "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"dev": true,
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
"bin": {
"semver": "bin/semver.js"
},
@@ -1293,12 +1290,6 @@
"node": ">=0.6.19"
}
},
- "node_modules/string.prototype.codepointat": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
- "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
- "dev": true
- },
"node_modules/strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
@@ -1470,12 +1461,6 @@
"engines": {
"node": ">=10.0.0"
}
- },
- "node_modules/yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
- "dev": true
}
},
"dependencies": {
@@ -1529,9 +1514,9 @@
"dev": true
},
"android-versions": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.9.0.tgz",
- "integrity": "sha512-13O2B6PQMEM4ej9n13ePRQeckrCoKbZrvuzlLvK+9s2QmncpHDbYzZxhgapN32sJNoifN6VAHexLnd/6CYrs7Q==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-2.0.0.tgz",
+ "integrity": "sha512-07fhKL8EjV+ORQggGHcKmhLECwxBlRFimfvsjhfUCYqNDAbcH4qaEaN0AO3DnWtgHqRNfWAxhnWOpx+ZpRMymw==",
"dev": true,
"requires": {
"semver": "^7.5.2"
@@ -1614,24 +1599,24 @@
"dev": true
},
"cordova-android": {
- "version": "12.0.1",
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-12.0.1.tgz",
- "integrity": "sha512-6fXWoYb/X5AJlluhBg5RvOaX6iRxsvNH7yEOiXzUmLIflf5Ho7LtYCSKZaWMHh3f5cJe/sPCBKmFFBS+EWepVg==",
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-13.0.0.tgz",
+ "integrity": "sha512-uQG+cSyrB1NMi2aIzihldIupHB9WGpZVvrMMMAAtnyc6tDlEk7gweSSaFsEONyGAnteRYpIvrzg/YwDW08PcUg==",
"dev": true,
"requires": {
- "android-versions": "^1.8.1",
+ "android-versions": "^2.0.0",
"cordova-common": "^5.0.0",
- "dedent": "^1.0.1",
+ "dedent": "^1.5.3",
"execa": "^5.1.1",
- "fast-glob": "^3.2.12",
- "fs-extra": "^11.1.1",
+ "fast-glob": "^3.3.2",
+ "fs-extra": "^11.2.0",
"is-path-inside": "^3.0.3",
- "nopt": "^7.1.0",
- "properties-parser": "^0.3.1",
- "semver": "^7.3.8",
+ "nopt": "^7.2.1",
+ "properties-parser": "^0.6.0",
+ "semver": "^7.6.2",
"string-argv": "^0.3.1",
"untildify": "^4.0.0",
- "which": "^3.0.0"
+ "which": "^4.0.0"
},
"dependencies": {
"dedent": {
@@ -1641,13 +1626,19 @@
"dev": true,
"requires": {}
},
+ "isexe": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
+ "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
+ "dev": true
+ },
"which": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
- "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
"dev": true,
"requires": {
- "isexe": "^2.0.0"
+ "isexe": "^3.1.1"
}
}
}
@@ -1678,9 +1669,9 @@
}
},
"cordova-ios": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.0.tgz",
- "integrity": "sha512-9/vPU+GWRdfxNIkAc9Gq6yejMIgpy59ycP8WyVJJ7HfuPSTBUQT8AS2h5ZJOeN4Y/URyEwxQCrAqSADDBVCESA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.1.tgz",
+ "integrity": "sha512-JwTyPxWcAZlbIOR5QO6TaJzkoSzfrp7jrlX01bWZ7Sxp0PYXejAJbA6J0W4u11M+atrQRNimNltZDyAlSBW2tw==",
"dev": true,
"requires": {
"cordova-common": "^5.0.0",
@@ -1724,9 +1715,9 @@
"dev": true
},
"cordova-plugin-device": {
- "version": "git+ssh://git@github.com/apache/cordova-plugin-device.git#3e199bfe3eda15b06e9654c787845d814bae595a",
+ "version": "git+ssh://git@github.com/apache/cordova-plugin-device.git#8685a7ae93be23309fb56bc8d496f4af8d7df9ec",
"dev": true,
- "from": "cordova-plugin-device@https://github.com/apache/cordova-plugin-device.git"
+ "from": "cordova-plugin-device@github:apache/cordova-plugin-device"
},
"cordova-plugin-dialogs": {
"version": "2.0.2",
@@ -1981,12 +1972,12 @@
}
},
"is-core-module": {
- "version": "2.13.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
- "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
+ "version": "2.15.1",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
+ "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==",
"dev": true,
"requires": {
- "hasown": "^2.0.0"
+ "hasown": "^2.0.2"
}
},
"is-extglob": {
@@ -2068,15 +2059,6 @@
"integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==",
"dev": true
},
- "lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "dev": true,
- "requires": {
- "yallist": "^4.0.0"
- }
- },
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -2127,9 +2109,9 @@
"dev": true
},
"nopt": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz",
- "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==",
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
+ "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
"dev": true,
"requires": {
"abbrev": "^2.0.0"
@@ -2222,13 +2204,10 @@
}
},
"properties-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
- "integrity": "sha512-AkSQxQAviJ89x4FIxOyHGfO3uund0gvYo7lfD0E+Gp7gFQKrTNgtoYQklu8EhrfHVZUzTwKGZx2r/KDSfnljcA==",
- "dev": true,
- "requires": {
- "string.prototype.codepointat": "^0.2.0"
- }
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.6.0.tgz",
+ "integrity": "sha512-qvr2cSmoA0dln0MARAKwBzPkkXn7FqwX+RVVNpMdMJc7rt9mqO2cXwluxtux9fHrLhjnPFaQkS8BM0kFrTCnSw==",
+ "dev": true
},
"q": {
"version": "1.5.1",
@@ -2303,13 +2282,10 @@
"dev": true
},
"semver": {
- "version": "7.5.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
- "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
- "dev": true,
- "requires": {
- "lru-cache": "^6.0.0"
- }
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
+ "dev": true
},
"shebang-command": {
"version": "2.0.0",
@@ -2387,12 +2363,6 @@
"integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
"dev": true
},
- "string.prototype.codepointat": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
- "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
- "dev": true
- },
"strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
@@ -2514,12 +2484,6 @@
"version": "git+ssh://git@github.com/xmldom/xmldom.git#c568938641cc1f121cef5b4df80fcfda1e489b6e",
"integrity": "sha512-XKfWBSJe4BGKsn67Hypmdfj4fI75a6EsptbrzXzNxKqokfDT3zItQl4xxA1rFvcDBZOBvfDR9tkqlow5xa3AIA==",
"from": "xmldom@github:xmldom/xmldom#0.7.0"
- },
- "yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
- "dev": true
}
}
}
diff --git a/example-cordova/package.json b/example-cordova/package.json
index 364192fd..b38a9d9f 100644
--- a/example-cordova/package.json
+++ b/example-cordova/package.json
@@ -14,8 +14,8 @@
"license": "Apache-2.0",
"devDependencies": {
"com.adjust.sdk": "file:../temp_plugin",
- "cordova-android": "^12.0.1",
- "cordova-ios": "^7.1.0",
+ "cordova-android": "^13.0.0",
+ "cordova-ios": "^7.1.1",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-customurlscheme": "^5.0.2",
"cordova-plugin-device": "github:apache/cordova-plugin-device",
@@ -36,8 +36,8 @@
"com.adjust.sdk": {}
},
"platforms": [
- "ios",
- "android"
+ "android",
+ "ios"
]
},
"dependencies": {
diff --git a/example-cordova/www/js/index.js b/example-cordova/www/js/index.js
index e8db8c0f..37a6b2c8 100644
--- a/example-cordova/www/js/index.js
+++ b/example-cordova/www/js/index.js
@@ -12,28 +12,10 @@ var app = {
onDeviceReady: function() {
app.receivedEvent('deviceready');
- // // Register for universal links
- // if (device.platform == 'iOS') {
- // universalLinks.subscribe('adjustDeepLinking', app.didLaunchAppFromLink);
- // }
-
var adjustConfig = new AdjustConfig("2fm9gkqubvpc", AdjustConfig.EnvironmentSandbox);
-
adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose);
- // adjustConfig.setShouldLaunchDeeplink(true);
- // adjustConfig.setDelayStart(3.0);
- // adjustConfig.setSendInBackground(true);
- // adjustConfig.setEventBufferingEnabled(true);
- // adjustConfig.setDeviceKnown(true);
- // adjustConfig.setUserAgent("Custom Adjust User Agent");
- // adjustConfig.setNeedsCost(true);
- // adjustConfig.setOaidReadingEnabled(true);
- // adjustConfig.setCoppaCompliantEnabled(true);
- // adjustConfig.setPlayStoreKidsAppEnabled(true);
- // adjustConfig.setAttConsentWaitingInterval(16);
- // adjust.setFbAppId("your-fb-app-id");
-
- adjustConfig.setAttributionCallbackListener(function(attribution) {
+
+ adjustConfig.setAttributionCallback(function(attribution) {
console.log("[AdjustExample]: Attribution callback received.");
console.log("[AdjustExample]: Tracker token = " + attribution.trackerToken);
console.log("[AdjustExample]: Tracker name = " + attribution.trackerName);
@@ -45,7 +27,7 @@ var app = {
console.log("[AdjustExample]: Adid = " + attribution.adid);
});
- adjustConfig.setEventTrackingSucceededCallbackListener(function(eventSuccess) {
+ adjustConfig.setEventTrackingSucceededCallback(function(eventSuccess) {
console.log("[AdjustExample]: Event tracking succeeded callback received.");
console.log("[AdjustExample]: Message: " + eventSuccess.message);
console.log("[AdjustExample]: Timestamp: " + eventSuccess.timestamp);
@@ -55,7 +37,7 @@ var app = {
console.log("[AdjustExample]: JSON response: " + eventSuccess.jsonResponse);
});
- adjustConfig.setEventTrackingFailedCallbackListener(function(eventFailed) {
+ adjustConfig.setEventTrackingFailedCallback(function(eventFailed) {
console.log("[AdjustExample]: Event tracking failed callback received.");
console.log("[AdjustExample]: Message: " + eventFailed.message);
console.log("[AdjustExample]: Timestamp: " + eventFailed.timestamp);
@@ -66,7 +48,7 @@ var app = {
console.log("[AdjustExample]: JSON response: " + eventFailed.jsonResponse);
});
- adjustConfig.setSessionTrackingSucceededCallbackListener(function(sessionSuccess) {
+ adjustConfig.setSessionTrackingSucceededCallback(function(sessionSuccess) {
console.log("[AdjustExample]: Session tracking succeeded callback received.");
console.log("[AdjustExample]: Message: " + sessionSuccess.message);
console.log("[AdjustExample]: Timestamp: " + sessionSuccess.timestamp);
@@ -74,7 +56,7 @@ var app = {
console.log("[AdjustExample]: JSON response: " + sessionSuccess.jsonResponse);
});
- adjustConfig.setSessionTrackingFailedCallbackListener(function(sessionFailed) {
+ adjustConfig.setSessionTrackingFailedCallback(function(sessionFailed) {
console.log("[AdjustExample]: Session tracking failed callback received.");
console.log("[AdjustExample]: Message: " + sessionFailed.message);
console.log("[AdjustExample]: Timestamp: " + sessionFailed.timestamp);
@@ -83,49 +65,38 @@ var app = {
console.log("[AdjustExample]: JSON response: " + sessionFailed.jsonResponse);
});
- adjustConfig.setDeferredDeeplinkCallbackListener(function(uri) {
+ adjustConfig.setDeferredDeeplinkCallback(function(uri) {
console.log("[AdjustExample]: Deferred Deeplink Callback received.");
console.log("[AdjustExample]: URL: " + uri);
});
- adjustConfig.setConversionValueUpdatedCallbackListener(function(conversionValue) {
- console.log("[AdjustExample]: Conversion value updated!");
- console.log("[AdjustExample]: Conversion value = " + conversionValue);
- });
-
- adjustConfig.setSkad4ConversionValueUpdatedCallbackListener(function(skad4data) {
- console.log("[AdjustExample]: SKAdNetwork 4 conversion value updated!");
- console.log("[AdjustExample]: Fine value = " + skad4data.fineValue);
- console.log("[AdjustExample]: Coarse value = " + skad4data.coarseValue);
- console.log("[AdjustExample]: Lock window = " + skad4data.lockWindow);
+ adjustConfig.setSkanUpdatedCallback(function(skanData) {
+ console.log("[AdjustExample]: SKAdNetwork conversion data updated!");
+ console.log("[AdjustExample]: Conversion Value = " + skanData.conversionValue);
+ console.log("[AdjustExample]: Coarse Value = " + skanData.coarseValue);
+ console.log("[AdjustExample]: Lock Window = " + skanData.lockWindow);
+ console.log("[AdjustExample]: Error = " + skanData.error);
});
- Adjust.addSessionCallbackParameter("dummy_foo", "dummy_bar");
- Adjust.addSessionCallbackParameter("dummy_foo_foo", "dummy_bar");
+ Adjust.addGlobalCallbackParameter("dummy_foo", "dummy_bar");
+ Adjust.addGlobalCallbackParameter("dummy_foo_foo", "dummy_bar");
- Adjust.addSessionPartnerParameter("dummy_foo", "dummy_bar");
- Adjust.addSessionPartnerParameter("dummy_foo_foo", "dummy_bar");
+ Adjust.addGlobalPartnerParameter("dummy_foo", "dummy_bar");
+ Adjust.addGlobalPartnerParameter("dummy_foo_foo", "dummy_bar");
- Adjust.removeSessionCallbackParameter("dummy_foo");
- Adjust.removeSessionPartnerParameter("dummy_foo");
+ Adjust.removeGlobalCallbackParameter("dummy_foo");
+ Adjust.removeGlobalPartnerParameter("dummy_foo");
- // Adjust.requestTrackingAuthorizationWithCompletionHandler(function(status) {
- // console.log("ATT status after dialog = " + status);
- // });
+ // Adjust.removeGlobalCallbackParameters();
+ // Adjust.removeGlobalPartnerParameters();
- // Adjust.resetSessionCallbackParameters();
- // Adjust.resetSessionPartnerParameters();
- // Adjust.checkForNewAttStatus();
-
- Adjust.create(adjustConfig);
+ Adjust.requestAppTrackingAuthorization(function(status) {
+ console.log("ATT status = " + status);
+ });
- // Adjust.sendFirstPackages();
+ Adjust.initSdk(adjustConfig);
},
- // didLaunchAppFromLink: function(eventData) {
- // Adjust.appWillOpenUrl(eventData.url);
- // },
-
// Update DOM on a Received Event
receivedEvent: function(id) {
console.log('[AdjustExample]: Received Event: ' + id);
@@ -170,19 +141,19 @@ var app = {
}, false);
btnEnableOfflineMode.addEventListener('click', function() {
- Adjust.setOfflineMode(true);
+ Adjust.switchToOfflineMode();
}, false);
btnDisableOfflineMode.addEventListener('click', function() {
- Adjust.setOfflineMode(false);
+ Adjust.switchBackToOnlineMode();
}, false);
btnEnableSdk.addEventListener('click', function() {
- Adjust.setEnabled(true);
+ Adjust.enable();
}, false);
btnDisableSdk.addEventListener('click', function() {
- Adjust.setEnabled(false);
+ Adjust.disable();
}, false);
btnIsSdkEnabled.addEventListener('click', function() {
@@ -200,16 +171,20 @@ var app = {
console.log("[AdjustExample]: IDFA = " + idfa);
});
+ Adjust.getIdfv(function(idfv) {
+ console.log("[AdjustExample]: IDFV = " + idfv);
+ });
+
Adjust.getGoogleAdId(function(gpsAdId) {
console.log("[AdjustExample]: Google Ad Id = " + gpsAdId);
});
- Adjust.getAmazonAdId(function(gpsAdId) {
- console.log("[AdjustExample]: Amazon Ad Id = " + gpsAdId);
+ Adjust.getAmazonAdId(function(amazonAdId) {
+ console.log("[AdjustExample]: Amazon Ad Id = " + amazonAdId);
});
Adjust.getAdid(function(adid) {
- console.log("[AdjustExample]: Adid = " + adid);
+ console.log("[AdjustExample]: Adjust Id = " + adid);
});
Adjust.getAttribution(function(attribution) {
@@ -220,7 +195,9 @@ var app = {
console.log("[AdjustExample]: Adgroup = " + attribution.adgroup);
console.log("[AdjustExample]: Creative = " + attribution.creative);
console.log("[AdjustExample]: Click label = " + attribution.clickLabel);
- console.log("[AdjustExample]: Adid = " + attribution.adid);
+ console.log("[AdjustExample]: Cost Type = " + attribution.costType);
+ console.log("[AdjustExample]: Cost Amount = " + attribution.costAmount);
+ console.log("[AdjustExample]: Cost Currency = " + attribution.costCurrency);
});
}, false);
diff --git a/ext/android/sdk b/ext/android/sdk
index 65b3b8a1..2fa1a0a4 160000
--- a/ext/android/sdk
+++ b/ext/android/sdk
@@ -1 +1 @@
-Subproject commit 65b3b8a1f4277a756cdf0f53760225db2ec642ed
+Subproject commit 2fa1a0a4fcaf6adbe045faa9822f0bb46bbf911e
diff --git a/ext/ios/sdk b/ext/ios/sdk
index 2fd82b11..21fbb82d 160000
--- a/ext/ios/sdk
+++ b/ext/ios/sdk
@@ -1 +1 @@
-Subproject commit 2fd82b11e329e9c8357eaa77e28799ca2d629ab5
+Subproject commit 21fbb82d8f7d0386658623a00a22e7345fa5e3d9
diff --git a/ext/scripts b/ext/scripts
index 607e054b..505ed5b8 160000
--- a/ext/scripts
+++ b/ext/scripts
@@ -1 +1 @@
-Subproject commit 607e054b2ac8e72b283b1fe35496fddf88d825cd
+Subproject commit 505ed5b8ec5cbb7e00c52a34cdd9b5900bce2c2a
diff --git a/ionic-native/index.ts b/ionic-native/index.ts
index 6f4294a0..ee1d18e9 100644
--- a/ionic-native/index.ts
+++ b/ionic-native/index.ts
@@ -1,311 +1,266 @@
import { Injectable } from '@angular/core';
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
-export class AdjustEvent {
- private eventToken: string;
- private revenue: number;
- private currency: string;
- private receipt: string;
- private productId: string;
- private transactionId: string;
- private purchaseToken: string;
- private callbackId: string;
- private callbackParameters: string[] = [];
- private partnerParameters: string[] = [];
-
- constructor(eventToken: string) {
- this.eventToken = eventToken;
- }
-
- setRevenue(revenue: number, currency: string): void {
- this.revenue = revenue;
- this.currency = currency;
- }
-
- addCallbackParameter(key: string, value: string): void {
- this.callbackParameters.push(key);
- this.callbackParameters.push(value);
- }
-
- addPartnerParameter(key: string, value: string): void {
- this.partnerParameters.push(key);
- this.partnerParameters.push(value);
- }
-
- setTransactionId(transactionId: string) {
- this.transactionId = transactionId;
- }
-
- setCallbackId(callbackId: string) {
- this.callbackId = callbackId;
- }
-
- setReceipt(receipt: string) {
- this.receipt = receipt;
- }
-
- setProductId(productId: string) {
- this.productId = productId;
- }
-
- setPurchaseToken(purchaseToken: string) {
- this.purchaseToken = purchaseToken;
- }
-}
-
export class AdjustConfig {
private appToken: string;
private environment: AdjustEnvironment;
private sdkPrefix: string;
- private delayStart = 0.0;
private logLevel: AdjustLogLevel = null;
private defaultTracker: string = null;
- private urlStrategy: AdjustUrlStrategy = null;
private externalDeviceId: string = null;
- private sendInBackground: boolean = null;
- private shouldLaunchDeeplink: boolean = null;
- private eventBufferingEnabled: boolean = null;
- private userAgent: string = null;
- private isDeviceKnown: boolean = null;
- private needsCost: boolean = null;
- private secretId: number = null;
- private info1: number = null;
- private info2: number = null;
- private info3: number = null;
- private info4: number = null;
- private processName: string = null; // Android only
- private preinstallTrackingEnabled: boolean = null; // Android only
- private preinstallFilePath: string = null; // Android only
- private fbAppId: string = null; // Android only
- private oaidReadingEnabled: boolean = null; // Android only
- private allowiAdInfoReading: boolean = null; // iOS only
- private allowIdfaReading: boolean = null; // iOS only
- private allowAdServicesInfoReading: boolean = null; // iOS only
- private coppaCompliantEnabled: boolean = null;
- private readDeviceInfoOnceEnabled: boolean = null;
- private playStoreKidsAppEnabled: boolean = null; // Android only
- private linkMeEnabled: boolean = null; // iOS only
- private finalAndroidAttributionEnabled: boolean = null; // Android only
- private attConsentWaitingInterval: number = null; // iOS only
-
+ private isSendingInBackgroundEnabled: boolean = null;
+ private isDeferredDeeplinkOpeningEnabled: boolean = null;
+ private isCostDataInAttributionEnabled: boolean = null;
+ private isCoppaComplianceEnabled: boolean = null;
+ private isDeviceIdsReadingOnceEnabled: boolean = null;
+ private eventDeduplicationIdsMaxSize: number = null;
+ private urlStrategyDomains: string[] = [];
+ private useSubdomains: boolean = null;
+ private isDataResidency: boolean = null;
+
+ // android only
+ private processName: string = null;
+ private isPreinstallTrackingEnabled: boolean = null;
+ private preinstallFilePath: string = null;
+ private isPlayStoreKidsComplianceEnabled: boolean = null;
+ private fbAppId: string = null;
+
+ // ios only
+ private isAdServicesEnabled: boolean = null;
+ private isIdfaReadingEnabled: boolean = null;
+ private isIdfvReadingEnabled: boolean = null;
+ private isSkanAttributionEnabled: boolean = null;
+ private isLinkMeEnabled: boolean = null;
+ private attConsentWaitingInterval: number = null;
+
+ // callbacks
private attributionCallback: (attribution: AdjustAttribution) => void = null;
private eventTrackingSucceededCallback: (event: AdjustEventSuccess) => void = null;
private eventTrackingFailedCallback: (event: AdjustEventFailure) => void = null;
private sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void = null;
private sessionTrackingFailedCallback: (session: AdjustSessionFailure) => void = null;
private deferredDeeplinkCallback: (uri: string) => void = null;
- private conversionValueUpdatedCallback: (conversionValue: number) => void = null;
- private skad4ConversionValueUpdatedCallback: (skad4Data: AdjustSkad4Data) => void = null;
+ private skanUpdatedCallback: (skad4Data: AdjustSkanData) => void = null;
constructor(appToken: string, environment: AdjustEnvironment) {
this.appToken = appToken;
this.environment = environment;
}
- setAppSecret(secretId: number, info1: number, info2: number, info3: number, info4: number): void {
- this.secretId = secretId;
- this.info1 = info1;
- this.info2 = info2;
- this.info3 = info3;
- this.info4 = info4;
- }
-
- setDelayStart(delayStart: number) {
- this.delayStart = delayStart;
- }
-
- setLogLevel(logLevel: AdjustLogLevel) {
+ setLogLevel(logLevel: AdjustLogLevel): void {
this.logLevel = logLevel;
}
- setDefaultTracker(defaultTracker: string) {
+ setDefaultTracker(defaultTracker: string): void {
this.defaultTracker = defaultTracker;
}
- setExternalDeviceId(externalDeviceId: string) {
+ setExternalDeviceId(externalDeviceId: string): void {
this.externalDeviceId = externalDeviceId;
}
- setUrlStrategy(urlStrategy: AdjustUrlStrategy) {
+ setUrlStrategy(urlStrategyDomains: string[], useSubdomains: boolean, isDataResidency: boolean): void {
this.urlStrategy = urlStrategy;
}
- setSendInBackground(sendInBackground: boolean) {
- this.sendInBackground = sendInBackground;
- }
-
- setShouldLaunchDeeplink(shouldLaunchDeeplink: boolean) {
- this.shouldLaunchDeeplink = shouldLaunchDeeplink;
- }
-
- setEventBufferingEnabled(eventBufferingEnabled: boolean) {
- this.eventBufferingEnabled = eventBufferingEnabled;
+ enableSendingInBackground(): void {
+ this.isSendingInBackgroundEnabled = true;
}
- setCoppaCompliantEnabled(coppaCompliantEnabled: boolean) {
- this.coppaCompliantEnabled = coppaCompliantEnabled;
+ disableDeferredDeeplinkOpening(): void {
+ this.isDeferredDeeplinkOpeningEnabled = false;
}
- setReadDeviceInfoOnceEnabled(readDeviceInfoOnceEnabled: boolean) {
- this.readDeviceInfoOnceEnabled = readDeviceInfoOnceEnabled;
+ enableCoppaCompliance(): void {
+ this.isCoppaComplianceEnabled = true;
}
- setPlayStoreKidsAppEnabled(playStoreKidsAppEnabled: boolean) {
- this.playStoreKidsAppEnabled = playStoreKidsAppEnabled;
+ enableDeviceIdsReadingOnce(): void {
+ this.isDeviceIdsReadingOnceEnabled = true;
}
- setUserAgent(userAgent: string) {
- this.userAgent = userAgent;
+ enablePlayStoreKidsCompliance(): void {
+ this.isPlayStoreKidsComplianceEnabled = true;
}
- setDeviceKnown(isDeviceKnown: boolean) {
- this.isDeviceKnown = isDeviceKnown;
- }
-
- setNeedsCost(needsCost: boolean) {
- this.needsCost = needsCost;
+ enableCostDataInAttribution(): void {
+ this.isCostDataInAttributionEnabled = true;
}
setProcessName(processName: string) {
this.processName = processName;
}
- setPreinstallTrackingEnabled(preinstallTrackingEnabled: boolean) {
- this.preinstallTrackingEnabled = preinstallTrackingEnabled;
+ enablePreinstallTracking(): void {
+ this.isPreinstallTrackingEnabled = true;
}
- setPreinstallFilePath(preinstallFilePath: string) {
+ setPreinstallFilePath(preinstallFilePath: string): void {
this.preinstallFilePath = preinstallFilePath;
}
- setFbAppId(fbAppId: string) {
+ setFbAppId(fbAppId: string): void {
this.fbAppId = fbAppId;
}
- setOaidReadingEnabled(enableOaidReading: boolean) {
- this.oaidReadingEnabled = enableOaidReading;
- }
-
- setAllowiAdInfoReading(allowiAdInfoReading: boolean) {
- this.allowiAdInfoReading = allowiAdInfoReading;
+ disableIdfaReading(): void {
+ this.isIdfaReadingEnabled = false;
}
- setAllowIdfaReading(allowIdfaReading: boolean) {
- this.allowIdfaReading = allowIdfaReading;
+ disableIdfvReading(): void {
+ this.isIdfvReadingEnabled = false;
}
- setAllowAdServicesInfoReading(allowAdServicesInfoReading: boolean) {
- this.allowAdServicesInfoReading = allowAdServicesInfoReading;
+ disableAdServices(): void {
+ this.isAdServicesEnabled = false;
}
- setLinkMeEnabled(linkMeEnabled: boolean) {
- this.linkMeEnabled = linkMeEnabled;
+ enableLinkMe(): void {
+ this.isLinkMeEnabled = true;
}
- setFinalAndroidAttributionEnabled(finalAndroidAttributionEnabled: boolean) {
- this.finalAndroidAttributionEnabled = finalAndroidAttributionEnabled;
+ disableSkanAttribution(): void {
+ this.isSkanAttributionEnabled = false;
}
- setAttConsentWaitingInterval(attConsentWaitingInterval: number) {
+ setAttConsentWaitingInterval(attConsentWaitingInterval: number): void {
this.attConsentWaitingInterval = attConsentWaitingInterval;
}
- setAttributionCallbackListener(attributionCallback: (attribution: AdjustAttribution) => void) {
+ setAttributionCallback(attributionCallback: (attribution: AdjustAttribution) => void): void {
this.attributionCallback = attributionCallback;
}
- setEventTrackingSucceededCallbackListener(eventTrackingSucceededCallback: (event: AdjustEventSuccess) => void) {
+ setEventTrackingSucceededCallback(eventTrackingSucceededCallback: (event: AdjustEventSuccess) => void): void {
this.eventTrackingSucceededCallback = eventTrackingSucceededCallback;
}
- setEventTrackingFailedCallbackListener(eventTrackingFailedCallback: (event: AdjustEventFailure) => void) {
+ setEventTrackingFailedCallback(eventTrackingFailedCallback: (event: AdjustEventFailure) => void): void {
this.eventTrackingFailedCallback = eventTrackingFailedCallback;
}
- setSessionTrackingSucceededCallbackListener(
- sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void
- ) {
+ setSessionTrackingSucceededCallback(sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void): void {
this.sessionTrackingSucceededCallback = sessionTrackingSucceededCallback;
}
- setSessionTrackingFailedCallbackListener(sessionTrackingFailedCallback: (session: AdjustSessionFailure) => void) {
+ setSessionTrackingFailedCallback(sessionTrackingFailedCallback: (session: AdjustSessionFailure) => void): void {
this.sessionTrackingFailedCallback = sessionTrackingFailedCallback;
}
- setDeferredDeeplinkCallbackListener(deferredDeeplinkCallback: (uri: string) => void) {
+ setDeferredDeeplinkCallback(deferredDeeplinkCallback: (deeplink: string) => void): void {
this.deferredDeeplinkCallback = deferredDeeplinkCallback;
}
- setConversionValueUpdatedCallbackListener(conversionValueUpdatedCallback: (conversionValue: number) => void) {
- this.conversionValueUpdatedCallback = conversionValueUpdatedCallback;
- }
-
- setSkad4ConversionValueUpdatedCallbackListener(skad4ConversionValueUpdatedCallback: (skad4Data: AdjustSkad4Data) => void) {
- this.skad4ConversionValueUpdatedCallback = skad4ConversionValueUpdatedCallback;
+ setSkanUpdatedCallback(skanUpdatedCallback: (skanData: AdjustSkanData) => void): void {
+ this.skanUpdatedCallback = skanUpdatedCallback;
}
- private getAttributionCallback() {
+ private getAttributionCallback(): void {
return this.attributionCallback;
}
- private getEventTrackingSucceededCallback() {
+ private getEventTrackingSucceededCallback(): void {
return this.eventTrackingSucceededCallback;
}
- private getEventTrackingFailedCallback() {
+ private getEventTrackingFailedCallback(): void {
return this.eventTrackingFailedCallback;
}
- private getSessionTrackingSucceededCallback() {
+ private getSessionTrackingSucceededCallback(): void {
return this.sessionTrackingSucceededCallback;
}
- private getSessionTrackingFailedCallback() {
+ private getSessionTrackingFailedCallback(): void {
return this.sessionTrackingFailedCallback;
}
- private getDeferredDeeplinkCallback() {
+ private getDeferredDeeplinkCallback(): void {
return this.deferredDeeplinkCallback;
}
- private getConversionValueUpdatedCallback() {
- return this.conversionValueUpdatedCallback;
+ private getSkanUpdatedCallback(): void {
+ return this.skanUpdatedCallback;
}
- private getSkad4ConversionValueUpdatedCallback() {
- return this.skad4ConversionValueUpdatedCallback;
- }
-
- private hasAttributionListener() {
+ private hasAttributionCallback(): void {
return this.attributionCallback !== null;
}
- private hasEventTrackingSucceededListener() {
+ private hasEventTrackingSucceededCallback(): void {
return this.eventTrackingSucceededCallback !== null;
}
- private hasEventTrackingFailedListener() {
+ private hasEventTrackingFailedCallback(): void {
return this.eventTrackingFailedCallback !== null;
}
- private hasSessionTrackingSucceededListener() {
+ private hasSessionTrackingSucceededCallback(): void {
return this.sessionTrackingSucceededCallback !== null;
}
- private hasSessionTrackingFailedListener() {
+ private hasSessionTrackingFailedCallback(): void {
return this.sessionTrackingFailedCallback !== null;
}
- private hasDeferredDeeplinkCallbackListener() {
+ private hasDeferredDeeplinkCallback(): void {
return this.deferredDeeplinkCallback !== null;
}
- private hasConversionValueUpdatedCallbackListener() {
- return this.conversionValueUpdatedCallback !== null;
+ private hasSkanUpdatedCallback(): void {
+ return this.skanUpdatedCallback !== null;
}
+}
- private hasSkad4ConversionValueUpdatedCallbackListener() {
- return this.skad4ConversionValueUpdatedCallback !== null;
+export class AdjustEvent {
+ private eventToken: string;
+ private revenue: number;
+ private currency: string;
+ private productId: string;
+ private transactionId: string;
+ private deduplicationId: string;
+ private purchaseToken: string;
+ private callbackId: string;
+ private callbackParameters: string[] = [];
+ private partnerParameters: string[] = [];
+
+ constructor(eventToken: string) {
+ this.eventToken = eventToken;
+ }
+
+ setRevenue(revenue: number, currency: string): void {
+ this.revenue = revenue;
+ this.currency = currency;
+ }
+
+ addCallbackParameter(key: string, value: string): void {
+ this.callbackParameters.push(key);
+ this.callbackParameters.push(value);
+ }
+
+ addPartnerParameter(key: string, value: string): void {
+ this.partnerParameters.push(key);
+ this.partnerParameters.push(value);
+ }
+
+ setTransactionId(transactionId: string): void {
+ this.transactionId = transactionId;
+ }
+
+ setDeduplicationId(deduplicationId: string): void {
+ this.deduplicationId = deduplicationId;
+ }
+
+ setCallbackId(callbackId: string): void {
+ this.callbackId = callbackId;
+ }
+
+ setProductId(productId: string): void {
+ this.productId = productId;
+ }
+
+ setPurchaseToken(purchaseToken: string): void {
+ this.purchaseToken = purchaseToken;
}
}
@@ -313,17 +268,15 @@ export class AdjustAppStoreSubscription {
private price: string;
private currency: string;
private transactionId: string;
- private receipt: string;
private transactionDate: string;
private salesRegion: string;
private callbackParameters: string[] = [];
private partnerParameters: string[] = [];
- constructor(price: string, currency: string, transactionId: string, receipt: string) {
+ constructor(price: string, currency: string, transactionId: string) {
this.price = price;
this.currency = currency;
this.transactionId = transactionId;
- this.receipt = receipt;
}
setTransactionDate(transactionDate: string): void {
@@ -381,11 +334,11 @@ export class AdjustPlayStoreSubscription {
}
export class AdjustThirdPartySharing {
- private isEnabled: boolean;
+ private isEnabled: boolean | null;
private granularOptions: string[] = [];
private partnerSharingSettings: any[] = [];
- constructor(isEnabled: boolean) {
+ constructor(isEnabled: boolean | null) {
this.isEnabled = isEnabled;
}
@@ -432,30 +385,28 @@ export class AdjustAdRevenue {
this.partnerParameters.push(value);
}
- setAdImpressionsCount(adImpressionsCount: number) {
+ setAdImpressionsCount(adImpressionsCount: number): void {
this.adImpressionsCount = adImpressionsCount;
}
- setAdRevenueNetwork(adRevenueNetwork: string) {
+ setAdRevenueNetwork(adRevenueNetwork: string): void {
this.adRevenueNetwork = adRevenueNetwork;
}
- setAdRevenueUnit(adRevenueUnit: string) {
+ setAdRevenueUnit(adRevenueUnit: string): void {
this.adRevenueUnit = adRevenueUnit;
}
- setAdRevenuePlacement(adRevenuePlacement: string) {
+ setAdRevenuePlacement(adRevenuePlacement: string): void {
this.adRevenuePlacement = adRevenuePlacement;
}
}
export class AdjustAppStorePurchase {
- private receipt: string;
private productId: string;
private transactionId: string;
- constructor(receipt: string, productId: string, transactionId: string) {
- this.receipt = receipt;
+ constructor(productId: string, transactionId: string) {
this.productId = productId;
this.transactionId = transactionId;
}
@@ -471,6 +422,14 @@ export class AdjustPlayStorePurchase {
}
}
+export class AdjustDeeplink {
+ private deeplink: string;
+
+ constructor(deeplink: string) {
+ this.deeplink = deeplink;
+ }
+}
+
export interface AdjustAttribution {
trackerToken: string;
trackerName: string;
@@ -483,7 +442,7 @@ export interface AdjustAttribution {
costType: string;
costAmount: string;
costCurrency: string;
- fbInstallReferrer: string; // Android only
+ fbInstallReferrer: string; // android only
}
export interface AdjustSessionSuccess {
@@ -520,13 +479,14 @@ export interface AdjustEventFailure {
jsonResponse: string;
}
-export interface AdjustSkad4Data {
- fineValue: number;
+export interface AdjustSkadData {
+ conversionValue: number;
coarseValue: string;
lockWindow: boolean;
+ error: string;
}
-export interface AdjustPurchaseVerificationInfo {
+export interface AdjustPurchaseVerificationResult {
verificationStatus: string;
code: number;
message: string;
@@ -547,29 +507,6 @@ export enum AdjustLogLevel {
Suppress = 'SUPPRESS',
}
-export enum AdjustUrlStrategy {
- India = 'india',
- China = 'china',
- Cn = 'cn',
- CnOnly = 'cn-only',
- DataResidencyEU = 'data-residency-eu',
- DataResidencyTR = 'data-residency-tr',
- DataResidencyUS = 'data-residency-us',
-}
-
-export enum AdjustAdRevenueSource {
- AdRevenueSourceAppLovinMAX = 'applovin_max_sdk',
- AdRevenueSourceMopub = 'mopub',
- AdRevenueSourceAdMob = 'admob_sdk',
- AdRevenueSourceIronSource = 'ironsource_sdk',
- AdRevenueSourceAdMost = "admost_sdk",
- AdRevenueSourceUnity = "unity_sdk",
- AdRevenueSourceHeliumChartboost = "helium_chartboost_sdk",
- AdRevenueSourcePublisher = "publisher_sdk",
- AdRevenueSourceTopOn = "topon_sdk",
- AdRevenueSourceAdx = "adx_sdk",
-}
-
/**
* @name Adjust
* @description
@@ -585,10 +522,10 @@ export enum AdjustAdRevenueSource {
*
* ...
*
- * const config = new AdjustConfig('APP-TOKEN-HERE', AdjustEnvironment.Sandbox);
- * config.logLevel = AdjustLogLevel.Verbose;
- * // Set other config properties.
- * adjust.create(config);
+ * const adjustConfig = new AdjustConfig('YourAppToken', AdjustEnvironment.Sandbox);
+ * adjustConfig.logLevel = AdjustLogLevel.Verbose;
+ * // set other config properties ...
+ * adjust.initSdk(adjustConfig);
*
* ```
* @interfaces
@@ -597,22 +534,21 @@ export enum AdjustAdRevenueSource {
* AdjustSessionFailure
* AdjustEventSuccess
* AdjustEventFailure
- * AdjustSkad4Data
- * AdjustPurchaseVerificationInfo
+ * AdjustSkadData
+ * AdjustPurchaseVerificationResult
* @classes
- * AdjustEvent
* AdjustConfig
+ * AdjustEvent
* AdjustAppStoreSubscription
* AdjustPlayStoreSubscription
* AdjustThirdPartySharing
* AdjustAdRevenue
* AdjustAppStorePurchase
* AdjustPlayStorePurchase
+ * AdjustDeeplink
* @enums
* AdjustEnvironment
* AdjustLogLevel
- * AdjustUrlStrategy
- * AdjustAdRevenueSource
*/
@Plugin({
pluginName: 'Adjust',
@@ -623,65 +559,53 @@ export enum AdjustAdRevenueSource {
})
@Injectable()
export class Adjust extends AwesomeCordovaNativePlugin {
-
/**
* This method initializes Adjust SDK
*
- * @param {AdjustConig} config Adjust config object used as starting options
+ * @param {AdjustConig} adjustConfig Adjust config object used as starting options
*/
@Cordova({ sync: true })
- create(config: AdjustConfig): void {}
+ initSdk(adjustConfig: AdjustConfig): void {}
/**
* This method tracks an event
*
- * @param {AdjustEvent} event Adjust event object to be tracked
+ * @param {AdjustEvent} adjustEvent Adjust event object to be tracked
*/
@Cordova({ sync: true })
- trackEvent(event: AdjustEvent): void {}
+ trackEvent(adjustEvent: AdjustEvent): void {}
/**
* This method tracks App Store subscription
*
- * @param {AdjustAppStoreSubscription} subscription Adjust App Store subscription object to be tracked
+ * @param {AdjustAppStoreSubscription} adjustAppStoreSubscription Adjust App Store subscription object to be tracked
*/
@Cordova({ sync: true })
- trackAppStoreSubscription(subscription: AdjustAppStoreSubscription): void {}
+ trackAppStoreSubscription(adjustAppStoreSubscription: AdjustAppStoreSubscription): void {}
/**
* This method tracks Play Store subscription
*
- * @param {AdjustPlayStoreSubscription} subscription Adjust Play Store subscription object to be tracked
+ * @param {AdjustPlayStoreSubscription} adjustPlayStoreSubscription Adjust Play Store subscription object to be tracked
*/
@Cordova({ sync: true })
- trackPlayStoreSubscription(subscription: AdjustPlayStoreSubscription): void {}
+ trackPlayStoreSubscription(adjustPlayStoreSubscription: AdjustPlayStoreSubscription): void {}
/**
* This method tracks third party sharing choice
*
- * @param {AdjustThirdPartySharing} thirdPartySharing Adjust third party sharing object to be tracked
+ * @param {AdjustThirdPartySharing} adjustThirdPartySharing Adjust third party sharing object to be tracked
*/
@Cordova({ sync: true })
- trackThirdPartySharing(thirdPartySharing: AdjustThirdPartySharing): void {}
+ trackThirdPartySharing(adjustThirdPartySharing: AdjustThirdPartySharing): void {}
/**
* This method tracks ad revenue data
*
- * @param {AdjustAdRevenueSource} source Ad revenue source
- * @param {string} payload Ad revenue JSON string payload
+ * @param {AdjustAdRevenue} adjustAdRevenue Adjust ad revenue object
*/
- trackAdRevenue(source: AdjustAdRevenueSource, payload: string): void;
-
- /**
- * This method tracks ad revenue data
- *
- * @param {AdjustAdRevenue} adRevenue Adjust ad revenue object
- */
- trackAdRevenue(adRevenue: AdjustAdRevenue): void;
-
- // And typescript hides this, so the client will be able call only methods above
@Cordova({ sync: true })
- trackAdRevenue(sourceOrAdRevenue: any, payload?: any): void {}
+ trackAdRevenue(adjustAdRevenue: AdjustAdRevenue): void {}
/**
* This method tracks measurement consent choice
@@ -692,34 +616,53 @@ export class Adjust extends AwesomeCordovaNativePlugin {
trackMeasurementConsent(measurementConsent: boolean): void {}
/**
- * This method sets offline mode on or off
- *
- * @param {boolean} enabled set to true for offline mode on
+ * This method sets offline mode ON
+ */
+ @Cordova({ sync: true })
+ switchToOfflineMode(): void {}
+
+ /**
+ * This method sets offline mode OFF
*/
@Cordova({ sync: true })
- setOfflineMode(enabled: boolean): void {}
+ switchBackToOnlineMode(): void {}
/**
* By making this call, the Adjust SDK will try to find if there is any new attribution info inside of the deep link and if any, it will be sent to the Adjust backend.
*
- * @param {string} url URL of the deeplink
+ * @param {AdjustDeeplink} adjustDeeplink AdjustDeeplink instance
*/
@Cordova({ sync: true })
- appWillOpenUrl(url: string): void {}
+ processDeeplink(adjustDeeplink: AdjustDeeplink): void {}
/**
- * You can disable/enable the Adjust SDK from tracking by invoking this method
+ * This method is used to send and potentially resolve shortened deep links
*
- * @param {boolean} enabled set to false to disable SDK
+ * @param {AdjustDeeplink} adjustDeeplink AdjustDeeplink instance containing shortened deep link that has opened your app
+ * @returns {Promise} Returns a promise with either resolved (if it was resolved) or echoed deep link
+ */
+ @Cordova()
+ processAndResolveDeeplink(adjustDeeplink: AdjustDeeplink): Promise {
+ return;
+ }
+
+ /**
+ * This method enables Adjust SDK
*/
@Cordova({ sync: true })
- setEnabled(enabled: boolean): void {}
+ enable(): void {}
+
+ /**
+ * This method disables Adjust SDK
+ */
+ @Cordova({ sync: true })
+ disable(): void {}
/**
* To send us the push notification token, add the following call to Adjust whenever you get your token in the app or when it gets updated.
* Push tokens are used for Audience Builder and client callbacks, and they are required for the upcoming uninstall tracking feature.
*
- * @param {string} pushToken push token value
+ * @param {string} pushToken Push token value
*/
@Cordova({ sync: true })
setPushToken(pushToken: string): void {}
@@ -741,17 +684,10 @@ export class Adjust extends AwesomeCordovaNativePlugin {
@Cordova({ sync: true })
gdprForgetMe(): void {}
- /**
- * You can now notify Adjust when a user has exercised their right to stop sharing their data with partners for marketing purposes, but has allowed it to be shared for statistics purposes.
- * Calling the following method will instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend
- */
- @Cordova({ sync: true })
- disableThirdPartySharing(): void {}
-
/**
* Function used to get Google AdId
*
- * @returns {Promise} Returns a promise with google AdId value
+ * @returns {Promise} Returns a promise with Google advertising ID value
*/
@Cordova()
getGoogleAdId(): Promise {
@@ -759,9 +695,9 @@ export class Adjust extends AwesomeCordovaNativePlugin {
}
/**
- * If you need to obtain the Amazon Advertising ID, you can make a call to this function.
+ * If you need to obtain the Amazon Fire Advertising ID, you can make a call to this function.
*
- * @returns {Promise} Returns a promise with anazib adv. ID
+ * @returns {Promise} Returns a promise with Amazon Fire advertising ID
*/
@Cordova()
getAmazonAdId(): Promise {
@@ -778,6 +714,16 @@ export class Adjust extends AwesomeCordovaNativePlugin {
return;
}
+ /**
+ * To obtain the IDFV, call this function
+ *
+ * @returns {Promise} Returns a promise with IDFV string value
+ */
+ @Cordova()
+ getIdfv(): Promise {
+ return;
+ }
+
/**
* For every device with your app installed on it, the Adjust backend generates a unique Adjust device identifier (adid).
* In order to obtain this identifier, call this function
@@ -789,12 +735,6 @@ export class Adjust extends AwesomeCordovaNativePlugin {
return;
}
- /**
- * Instruct to Adjust SDK to check current state of att_status
- */
- @Cordova({ sync: true })
- checkForNewAttStatus(): void {}
-
/**
* If you want to access information about a user's current attribution whenever you need it, you can make a call to this function
*
@@ -808,7 +748,7 @@ export class Adjust extends AwesomeCordovaNativePlugin {
/**
* Get the information about version of the SDK used
*
- * @returns {Promise} Returns a promise with sdk version information
+ * @returns {Promise} Returns a promise with SDK version information
*/
@Cordova()
getSdkVersion(): Promise {
@@ -816,56 +756,50 @@ export class Adjust extends AwesomeCordovaNativePlugin {
}
/**
- * Method used to add session callback parameters
+ * Method used to add global callback parameters
*
* @param key key
* @param value value
*/
@Cordova({ sync: true })
- addSessionCallbackParameter(key: string, value: string): void {}
+ addGlobalCallbackParameter(key: string, value: string): void {}
/**
- * Remove a specific session callback parameter by passing the desiring key to this method
+ * Remove a specific global callback parameter by passing the desiring key to this method
*
* @param key key
*/
@Cordova({ sync: true })
- removeSessionCallbackParameter(key: string): void {}
+ removeGlobalCallbackParameter(key: string): void {}
/**
- * If all keys and values from the session callback parameters have to be removed, call this method
+ * If all keys and values from the global callback parameters have to be removed, call this method
*/
@Cordova({ sync: true })
- resetSessionCallbackParameters(): void {}
+ removeGlobalPartnerParameter(): void {}
/**
- * Method used to add session partner parameters
+ * Method used to add global partner parameters
*
* @param key key
* @param value value
*/
@Cordova({ sync: true })
- addSessionPartnerParameter(key: string, value: string): void {}
+ addGlobalPartnerParameter(key: string, value: string): void {}
/**
- * Remove a specific session partner parameter by passing the desiring key to this method
+ * Remove a specific global partner parameter by passing the desiring key to this method
*
* @param key key
*/
@Cordova({ sync: true })
- removeSessionPartnerParameter(key: string): void {}
+ removeGlobalPartnerParameter(key: string): void {}
/**
- * If all keys and values from the session partner parameters have to be removed, call this method
+ * If all keys and values from the global partner parameters have to be removed, call this method
*/
@Cordova({ sync: true })
- resetSessionPartnerParameters(): void {}
-
- /**
- * This method call will make the Adjust SDK send the initial install session and any events created, if they were not sent after delay start was set and it's delay expired.
- */
- @Cordova({ sync: true })
- sendFirstPackages(): void {}
+ removeGlobalPartnerParameters(): void {}
/**
* Request Adjust SDK to show pop up dialog for asking user's consent to be tracked.
@@ -874,17 +808,19 @@ export class Adjust extends AwesomeCordovaNativePlugin {
* @returns {Promise} Returns a promise with user's consent value
*/
@Cordova()
- requestTrackingAuthorizationWithCompletionHandler(): Promise {
+ requestAppTrackingAuthorization(): Promise {
return;
}
/**
* You can update SKAdNetwork conversion value with calling this method
*
- * @param {number} conversionValue conversion value for the user
+ * @param {Promise} Returns a promisse with error information in case error happened
*/
- @Cordova({ sync: true })
- updateConversionValue(conversionValue: number): void {}
+ @Cordova()
+ updateSkanConversionValue(conversionValue: number, coarseValue: string, lockWindow: boolean): Promise {
+ return;
+ }
/**
* To obtain the app tracking authorization status in iOS, call this function
@@ -897,9 +833,9 @@ export class Adjust extends AwesomeCordovaNativePlugin {
}
/**
- * To obtain the last deep link which has opened your iOS app, call this function
+ * To obtain the last deep link which has opened your app, call this function
*
- * @returns {Promise} Returns a promise with iOS deep link string value
+ * @returns {Promise} Returns a promise with last opened deep link string value
*/
@Cordova()
getLastDeeplink(): Promise {
@@ -909,33 +845,22 @@ export class Adjust extends AwesomeCordovaNativePlugin {
/**
* This method is used to verify the App Store purchase
*
- * @param {AdjustAppStorePurchase} purchase Adjust App Store purchase object to be verified
- * @returns {Promise} Returns a promise with purchase verification outcome
+ * @param {AdjustAppStorePurchase} adjustAppStorePurchase Adjust App Store purchase object to be verified
+ * @returns {Promise} Returns a promise with purchase verification outcome
*/
@Cordova()
- verifyAppStorePurchase(purchase: AdjustAppStorePurchase): Promise {
+ verifyAppStorePurchase(adjustAppStorePurchase: AdjustAppStorePurchase): Promise {
return;
}
/**
* This method is used to verify the Play Store purchase
*
- * @param {AdjustPlayStorePurchase} purchase Adjust Play Store purchase object to be verified
- * @returns {Promise} Returns a promise with purchase verification outcome
- */
- @Cordova()
- verifyPlayStorePurchase(purchase: AdjustPlayStorePurchase): Promise {
- return;
- }
-
- /**
- * This method is used to send and potentially resolve shortened deep links
- *
- * @param {string} deeplink Potentially shortened deep link that has opened your app
- * @returns {Promise} Returns a promise with either resolved (if it was resolved) or echoed deep link
+ * @param {AdjustPlayStorePurchase} adjustPlayStorePurchase Adjust Play Store purchase object to be verified
+ * @returns {Promise} Returns a promise with purchase verification outcome
*/
@Cordova()
- processDeeplink(deeplink: string): Promise {
+ verifyPlayStorePurchase(adjustPlayStorePurchase: AdjustPlayStorePurchase): Promise {
return;
}
}
\ No newline at end of file
diff --git a/package.json b/package.json
index db984dc5..a3060882 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "version": "4.38.1",
+ "version": "5.0.0",
"name": "com.adjust.sdk",
"cordova_name": "Adjust SDK Cordova Plugin",
"description": "Cordova plugin for the Adjust SDK",
diff --git a/plugin.xml b/plugin.xml
index 48a3657d..77a36966 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -2,8 +2,8 @@
-
+ version="5.0.0">
+
Adjust
Adjust plugin for Cordova
MIT License
@@ -42,12 +42,14 @@
-
+
+
+
+
-
@@ -72,18 +74,20 @@
-
+
+
+
@@ -96,10 +100,10 @@
-
+
-
+
diff --git a/src/android/AdjustCordova.java b/src/android/AdjustCordova.java
index 8da5617e..b88a3dea 100644
--- a/src/android/AdjustCordova.java
+++ b/src/android/AdjustCordova.java
@@ -1,11 +1,13 @@
package com.adjust.sdk;
import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
+
import android.net.Uri;
-import android.util.Log;
+
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONException;
@@ -13,35 +15,29 @@
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.PluginResult.Status;
+
import static com.adjust.sdk.AdjustCordovaUtils.*;
-public class AdjustCordova extends CordovaPlugin implements OnAttributionChangedListener,
- OnEventTrackingSucceededListener,
- OnEventTrackingFailedListener,
- OnSessionTrackingSucceededListener,
- OnSessionTrackingFailedListener,
- OnDeeplinkResponseListener,
- OnDeviceIdsRead {
- private boolean shouldLaunchDeeplink = true;
+public class AdjustCordova extends CordovaPlugin implements
+ OnAttributionChangedListener,
+ OnEventTrackingSucceededListener,
+ OnEventTrackingFailedListener,
+ OnSessionTrackingSucceededListener,
+ OnSessionTrackingFailedListener,
+ OnDeferredDeeplinkResponseListener {
+ private boolean isDeferredDeeplinkOpeningEnabled = true;
private CallbackContext attributionCallbackContext;
private CallbackContext eventTrackingSucceededCallbackContext;
private CallbackContext eventTrackingFailedCallbackContext;
private CallbackContext sessionTrackingSucceededCallbackContext;
private CallbackContext sessionTrackingFailedCallbackContext;
private CallbackContext deferredDeeplinkCallbackContext;
- private CallbackContext conversionValueUpdatedCallbackContext;
- private CallbackContext skad4ConversionValueUpdatedCallbackContext;
- private CallbackContext getAdidCallbackContext;
- private CallbackContext getIdfaCallbackContext;
- private CallbackContext getGoogleAdIdCallbackContext;
- private CallbackContext getAmazonAdidCallbackContext;
- private CallbackContext getAttributionCallbackContext;
- private CallbackContext getIdfvCallbackContext;
@Override
public boolean execute(String action, final JSONArray args, CallbackContext callbackContext) throws JSONException {
- if (action.equals(COMMAND_CREATE)) {
- executeCreate(args);
+
+ if (action.equals(COMMAND_INIT_SDK)) {
+ executeInitSdk(args);
} else if (action.equals(COMMAND_SET_ATTRIBUTION_CALLBACK)) {
attributionCallbackContext = callbackContext;
} else if (action.equals(COMMAND_SET_EVENT_TRACKING_SUCCEEDED_CALLBACK)) {
@@ -54,146 +50,67 @@ public boolean execute(String action, final JSONArray args, CallbackContext call
sessionTrackingFailedCallbackContext = callbackContext;
} else if (action.equals(COMMAND_SET_DEFERRED_DEEPLINK_CALLBACK)) {
deferredDeeplinkCallbackContext = callbackContext;
- } else if (action.equals(COMMAND_SET_CONVERSION_VALUE_UPDATED_CALLBACK)) {
- conversionValueUpdatedCallbackContext = callbackContext;
- } else if (action.equals(COMMAND_SET_SKAD4_CONVERSION_VALUE_UPDATED_CALLBACK)) {
- skad4ConversionValueUpdatedCallbackContext = callbackContext;
- } else if (action.equals(COMMAND_GET_GOOGLE_AD_ID)) {
- getGoogleAdIdCallbackContext = callbackContext;
- if (getGoogleAdIdCallbackContext != null) {
- Adjust.getGoogleAdId(this.cordova.getActivity().getApplicationContext(), this);
- }
- } else if (action.equals(COMMAND_GET_AMAZON_AD_ID)) {
- getAmazonAdidCallbackContext = callbackContext;
- if (getAmazonAdidCallbackContext != null) {
- String amazonAdId = Adjust.getAmazonAdId(this.cordova.getActivity().getApplicationContext());
- if (amazonAdId == null) {
- amazonAdId = "";
- }
- PluginResult pluginResult = new PluginResult(Status.OK, amazonAdId);
- pluginResult.setKeepCallback(true);
- getAmazonAdidCallbackContext.sendPluginResult(pluginResult);
- }
- } else if (action.equals(COMMAND_GET_ADID)) {
- getAdidCallbackContext = callbackContext;
- if (getAdidCallbackContext != null) {
- final String adid = Adjust.getAdid();
- PluginResult pluginResult = new PluginResult(Status.OK, adid);
- pluginResult.setKeepCallback(true);
- getAdidCallbackContext.sendPluginResult(pluginResult);
- }
- } else if (action.equals(COMMAND_GET_ATTRIBUTION)) {
- getAttributionCallbackContext = callbackContext;
- if (getAttributionCallbackContext != null) {
- final AdjustAttribution attribution = Adjust.getAttribution();
- JSONObject attributionJsonData = new JSONObject(getAttributionMap(attribution));
- PluginResult pluginResult = new PluginResult(Status.OK, attributionJsonData);
- pluginResult.setKeepCallback(true);
- getAttributionCallbackContext.sendPluginResult(pluginResult);
- }
- } else if (action.equals(COMMAND_GET_IDFA)) {
- getIdfaCallbackContext = callbackContext;
- final String idfa = "";
- PluginResult pluginResult = new PluginResult(Status.OK, idfa);
- pluginResult.setKeepCallback(true);
- getIdfaCallbackContext.sendPluginResult(pluginResult);
- } else if (action.equals(COMMAND_GET_IDFV)) {
- getIdfvCallbackContext = callbackContext;
- final String idfv = "";
- PluginResult pluginResult = new PluginResult(Status.OK, idfv);
- pluginResult.setKeepCallback(true);
- getIdfvCallbackContext.sendPluginResult(pluginResult);
- } else if (action.equals(COMMAND_GET_SDK_VERSION)) {
- String sdkVersion = Adjust.getSdkVersion();
- if (sdkVersion == null) {
- sdkVersion = "";
- }
- PluginResult pluginResult = new PluginResult(Status.OK, sdkVersion);
- callbackContext.sendPluginResult(pluginResult);
- } else if (action.equals(COMMAND_TRACK_EVENT)) {
- executeTrackEvent(args);
- } else if (action.equals(COMMAND_SET_OFFLINE_MODE)) {
- final Boolean enabled = args.getBoolean(0);
- Adjust.setOfflineMode(enabled);
} else if (action.equals(COMMAND_SET_PUSH_TOKEN)) {
final String token = args.getString(0);
Adjust.setPushToken(token, this.cordova.getActivity().getApplicationContext());
- } else if (action.equals(COMMAND_ON_PAUSE)) {
- Adjust.onPause();
- } else if (action.equals(COMMAND_ON_RESUME)) {
- Adjust.onResume();
- } else if (action.equals(COMMAND_SET_ENABLED)) {
- final Boolean enabled = args.getBoolean(0);
- Adjust.setEnabled(enabled);
- } else if (action.equals(COMMAND_IS_ENABLED)) {
- final Boolean isEnabled = Adjust.isEnabled();
- PluginResult pluginResult = new PluginResult(Status.OK, isEnabled);
- callbackContext.sendPluginResult(pluginResult);
- } else if (action.equals(COMMAND_APP_WILL_OPEN_URL)) {
- String url = args.getString(0);
- final Uri uri = Uri.parse(url);
- Adjust.appWillOpenUrl(uri, this.cordova.getActivity().getApplicationContext());
- } else if (action.equals(COMMAND_ADD_SESSION_CALLBACK_PARAMETER)) {
+ } else if (action.equals(COMMAND_GET_ATTRIBUTION)) {
+ executeGetAttribution(callbackContext);
+ } else if (action.equals(COMMAND_GET_ADID)) {
+ executeGetAdid(callbackContext);
+ } else if (action.equals(COMMAND_GET_GOOGLE_AD_ID)) {
+ executeGetGoogleAdid(callbackContext);
+ } else if (action.equals(COMMAND_GET_AMAZON_AD_ID)) {
+ executeGetAmazonAdid(callbackContext);
+ } else if (action.equals(COMMAND_GET_SDK_VERSION)) {
+ executeGetSdkVersion(callbackContext);
+ } else if (action.equals(COMMAND_ADD_GLOBAL_CALLBACK_PARAMETER)) {
final String key = args.getString(0);
final String value = args.getString(1);
- Adjust.addSessionCallbackParameter(key, value);
- } else if (action.equals(COMMAND_REMOVE_SESSION_CALLBACK_PARAMETER)) {
+ Adjust.addGlobalCallbackParameter(key, value);
+ } else if (action.equals(COMMAND_REMOVE_GLOBAL_CALLBACK_PARAMETER)) {
final String key = args.getString(0);
- Adjust.removeSessionCallbackParameter(key);
- } else if (action.equals(COMMAND_RESET_SESSION_CALLBACK_PARAMETERS)) {
- Adjust.resetSessionCallbackParameters();
- } else if (action.equals(COMMAND_ADD_SESSION_PARTNER_PARAMETER)) {
+ Adjust.removeGlobalCallbackParameter(key);
+ } else if (action.equals(COMMAND_REMOVE_GLOBAL_CALLBACK_PARAMETERS)) {
+ Adjust.removeGlobalCallbackParameters();
+ } else if (action.equals(COMMAND_ADD_GLOBAL_PARTNER_PARAMETER)) {
final String key = args.getString(0);
final String value = args.getString(1);
- Adjust.addSessionPartnerParameter(key, value);
- } else if (action.equals(COMMAND_REMOVE_SESSION_PARTNER_PARAMETER)) {
+ Adjust.addGlobalPartnerParameter(key, value);
+ } else if (action.equals(COMMAND_REMOVE_GLOBAL_PARTNER_PARAMETER)) {
final String key = args.getString(0);
- Adjust.removeSessionPartnerParameter(key);
- } else if (action.equals(COMMAND_RESET_SESSION_PARTNER_PARAMETERS)) {
- Adjust.resetSessionPartnerParameters();
- } else if (action.equals(COMMAND_SEND_FIRST_PACKAGES)) {
- Adjust.sendFirstPackages();
+ Adjust.removeGlobalPartnerParameter(key);
+ } else if (action.equals(COMMAND_REMOVE_GLOBAL_PARTNER_PARAMETERS)) {
+ Adjust.removeGlobalPartnerParameters();
+ } else if (action.equals(COMMAND_SWITCH_TO_OFFLINE_MODE)) {
+ Adjust.switchToOfflineMode();
+ } else if (action.equals(COMMAND_SWITCH_BACK_TO_ONLINE_MODE)) {
+ Adjust.switchBackToOnlineMode();
+ } else if (action.equals(COMMAND_ENABLE)) {
+ Adjust.enable();
+ } else if (action.equals(COMMAND_DISABLE)) {
+ Adjust.disable();
+ } else if (action.equals(COMMAND_IS_ENABLED)) {
+ executeIsAdjustSdkEnabled(callbackContext);
} else if (action.equals(COMMAND_GDPR_FORGET_ME)) {
Adjust.gdprForgetMe(this.cordova.getActivity().getApplicationContext());
- } else if (action.equals(COMMAND_DISABLE_THIRD_PARTY_SHARING)) {
- Adjust.disableThirdPartySharing(this.cordova.getActivity().getApplicationContext());
- } else if (action.equals(COMMAND_SET_REFERRER)) {
- final String referrer = args.getString(0);
- Adjust.setReferrer(referrer, this.cordova.getActivity().getApplicationContext());
+ } else if (action.equals(COMMAND_ON_PAUSE)) {
+ Adjust.onPause();
+ } else if (action.equals(COMMAND_ON_RESUME)) {
+ Adjust.onResume();
+ } else if (action.equals(COMMAND_TRACK_EVENT)) {
+ executeTrackEvent(args);
} else if (action.equals(COMMAND_TRACK_AD_REVENUE)) {
- if (args.length() == 2) {
- // old API
- try {
- JSONObject jsonPayload = new JSONObject(args.getString(1));
- Adjust.trackAdRevenue(args.getString(0), jsonPayload);
- } catch (JSONException err) {
- Logger logger = (Logger)AdjustFactory.getLogger();
- logger.error("Give ad revenue payload is not a valid JSON string");
- }
- } else {
- // new API
- executeTrackAdRevenue(args);
+ if (args.length() != 1) {
+ AdjustFactory.getLogger().error(String.format("[AdjustCordova]: Invalid call (%s). Only one parameter is supported!", action));
+ return false;
}
- } else if (action.equals(COMMAND_TRACK_APP_STORE_SUBSCRIPTION)) {
- // iOS method only
- } else if (action.equals(COMMAND_REQUEST_TRACKING_AUTHORIZATION_WITH_COMPLETION_HANDLER)) {
- // iOS method only
- } else if (action.equals(COMMAND_UPDATE_CONVERSION_VALUE)) {
- // iOS method only
- } else if (action.equals(COMMAND_UPDATE_CONVERSION_VALUE_WITH_ERROR_CALLBACK)) {
- // iOS method only
- } else if (action.equals(COMMAND_UPDATE_SKAD4_CONVERSION_VALUE_WITH_ERROR_CALLBACK)) {
- // iOS method only
- } else if (action.equals(COMMAND_GET_APP_TRACKING_AUTHORIZATION_STATUS)) {
- // iOS method only
- } else if (action.equals(COMMAND_CHECK_FOR_NEW_ATT_STATUS)) {
- // iOS method only
- } else if (action.equals(COMMAND_VERIFY_APP_STORE_PURCHASE)) {
- // iOS method only
+ executeTrackAdRevenue(args);
} else if (action.equals(COMMAND_TRACK_PLAY_STORE_SUBSCRIPTION)) {
executeTrackPlayStoreSubscription(args);
} else if (action.equals(COMMAND_VERIFY_PLAY_STORE_PURCHASE)) {
executeVerifyPlayStorePurchase(args, callbackContext);
+ } else if (action.equals(COMMAND_VERIFY_AND_TRACK_PLAY_STORE_PURCHASE)) {
+ executeVerifyAndTrackPlayStorePurchase(args, callbackContext);
} else if (action.equals(COMMAND_TRACK_THIRD_PARTY_SHARING)) {
executeTrackThirdPartySharing(args);
} else if (action.equals(COMMAND_TRACK_MEASUREMENT_CONSENT)) {
@@ -202,7 +119,15 @@ public boolean execute(String action, final JSONArray args, CallbackContext call
Adjust.trackMeasurementConsent(isEnabled);
}
} else if (action.equals(COMMAND_PROCESS_DEEPLINK)) {
- executeProcessDeeplink(args, callbackContext);
+ if (executeProcessDeeplink(args) == false) {
+ return false;
+ }
+ } else if (action.equals(COMMAND_PROCESS_AND_RESOLVE_DEEPLINK)) {
+ if (executeProcessAndResolveDeeplink(args, callbackContext) == false) {
+ return false;
+ }
+ } else if (action.equals(COMMAND_GET_LAST_DEEPLINK)) {
+ executeGetLastDeeplink(callbackContext);
} else if (action.equals(COMMAND_SET_TEST_OPTIONS)) {
executeSetTestOptions(args);
} else if (action.equals(COMMAND_TEARDOWN)) {
@@ -212,23 +137,16 @@ public boolean execute(String action, final JSONArray args, CallbackContext call
sessionTrackingSucceededCallbackContext = null;
sessionTrackingFailedCallbackContext = null;
deferredDeeplinkCallbackContext = null;
- getAdidCallbackContext = null;
- getIdfaCallbackContext = null;
- getGoogleAdIdCallbackContext = null;
- getAmazonAdidCallbackContext = null;
- getAttributionCallbackContext = null;
- getIdfvCallbackContext = null;
- shouldLaunchDeeplink = true;
+ isDeferredDeeplinkOpeningEnabled = true;
} else {
- Logger logger = (Logger)AdjustFactory.getLogger();
+ Logger logger = (Logger) AdjustFactory.getLogger();
logger.error(String.format("[AdjustCordova]: Invalid call (%s).", action));
- return false;
+ return false;
}
-
return true;
}
- private void executeCreate(final JSONArray args) throws JSONException {
+ private void executeInitSdk(final JSONArray args) throws JSONException {
String params = args.getString(0);
JSONArray jsonArrayParams = new JSONArray(params);
JSONObject jsonParameters = jsonArrayParams.optJSONObject(0);
@@ -236,255 +154,198 @@ private void executeCreate(final JSONArray args) throws JSONException {
String appToken = null;
String environment = null;
- String defaultTracker = null;
- String externalDeviceId = null;
- String urlStrategy = null;
- String processName = null;
- String delayStart = null;
String logLevel = null;
- String userAgent = null;
- String sdkPrefix = null;
- String secretId = null;
- String info1 = null;
- String info2 = null;
- String info3 = null;
- String info4 = null;
- String preinstallFilePath = null;
- String fbAppId = null;
boolean isLogLevelSuppress = false;
- boolean eventBufferingEnabled = false;
- boolean isDeviceKnown = false;
- boolean sendInBackground = false;
- boolean shouldLaunchDeeplink = true;
- boolean needsCost = false;
- boolean preinstallTrackingEnabled = false;
- boolean oaidReadingEnabled = false;
- boolean coppaCompliantEnabled = false;
- boolean playStoreKidsAppEnabled = false;
- boolean finalAndroidAttributionEnabled = false;
- boolean readDeviceInfoOnceEnabled = false;
+ // App Token
if (parameters.containsKey(KEY_APP_TOKEN)) {
appToken = parameters.get(KEY_APP_TOKEN).toString();
}
+ // Environment
if (parameters.containsKey(KEY_ENVIRONMENT)) {
environment = parameters.get(KEY_ENVIRONMENT).toString();
}
- if (parameters.containsKey(KEY_DEFAULT_TRACKER)) {
- defaultTracker = parameters.get(KEY_DEFAULT_TRACKER).toString();
- }
- if (parameters.containsKey(KEY_EXTERNAL_DEVICE_ID)) {
- externalDeviceId = parameters.get(KEY_EXTERNAL_DEVICE_ID).toString();
- }
- if (parameters.containsKey(KEY_URL_STRATEGY)) {
- urlStrategy = parameters.get(KEY_URL_STRATEGY).toString();
- }
- if (parameters.containsKey(KEY_PROCESS_NAME)) {
- processName = parameters.get(KEY_PROCESS_NAME).toString();
- }
- if (parameters.containsKey(KEY_DELAY_START)) {
- delayStart = parameters.get(KEY_DELAY_START).toString();
- }
+ // Log Level Suppress
if (parameters.containsKey(KEY_LOG_LEVEL)) {
logLevel = parameters.get(KEY_LOG_LEVEL).toString().toUpperCase();
- }
- if (parameters.containsKey(KEY_USER_AGENT)) {
- userAgent = parameters.get(KEY_USER_AGENT).toString();
- }
- if (parameters.containsKey(KEY_SECRET_ID)) {
- secretId = parameters.get(KEY_SECRET_ID).toString();
- }
- if (parameters.containsKey(KEY_SDK_PREFIX)) {
- sdkPrefix = parameters.get(KEY_SDK_PREFIX).toString();
- }
- if (parameters.containsKey(KEY_INFO_1)) {
- info1 = parameters.get(KEY_INFO_1).toString();
- }
- if (parameters.containsKey(KEY_INFO_2)) {
- info2 = parameters.get(KEY_INFO_2).toString();
- }
- if (parameters.containsKey(KEY_INFO_3)) {
- info3 = parameters.get(KEY_INFO_3).toString();
- }
- if (parameters.containsKey(KEY_INFO_4)) {
- info4 = parameters.get(KEY_INFO_4).toString();
- }
- if (parameters.containsKey(KEY_PREINSTALL_FILE_PATH)) {
- preinstallFilePath = parameters.get(KEY_PREINSTALL_FILE_PATH).toString();
- }
- if (parameters.containsKey(KEY_FB_APP_ID)) {
- fbAppId = parameters.get(KEY_FB_APP_ID).toString();
- }
- if (parameters.containsKey(KEY_EVENT_BUFFERING_ENABLED)) {
- eventBufferingEnabled = parameters.get(KEY_EVENT_BUFFERING_ENABLED).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_DEVICE_KNOWN)) {
- isDeviceKnown = parameters.get(KEY_DEVICE_KNOWN).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_SEND_IN_BACKGROUND)) {
- sendInBackground = parameters.get(KEY_SEND_IN_BACKGROUND).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_SHOULD_LAUNCH_DEEPLINK)) {
- shouldLaunchDeeplink = parameters.get(KEY_SHOULD_LAUNCH_DEEPLINK).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_NEEDS_COST)) {
- needsCost = parameters.get(KEY_NEEDS_COST).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_PREINSTALL_TRACKING_ENABLED)) {
- preinstallTrackingEnabled = parameters.get(KEY_PREINSTALL_TRACKING_ENABLED).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_OAID_READING_ENABLED)) {
- oaidReadingEnabled = parameters.get(KEY_OAID_READING_ENABLED).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_COPPA_COMPLIANT_ENABLED)) {
- coppaCompliantEnabled = parameters.get(KEY_COPPA_COMPLIANT_ENABLED).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_PLAY_STORE_KIDS_APP_ENABLED)) {
- playStoreKidsAppEnabled = parameters.get(KEY_PLAY_STORE_KIDS_APP_ENABLED).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_FINAL_ANDROID_ATTRIBUTION_ENABLED)) {
- finalAndroidAttributionEnabled = parameters.get(KEY_FINAL_ANDROID_ATTRIBUTION_ENABLED).toString() == "true" ? true : false;
- }
- if (parameters.containsKey(KEY_READ_DEVICE_INFO_ONCE_ENABLED)) {
- readDeviceInfoOnceEnabled = parameters.get(KEY_READ_DEVICE_INFO_ONCE_ENABLED).toString() == "true" ? true : false;
- }
-
- if (isFieldValid(logLevel) && logLevel.equals("SUPPRESS")) {
- isLogLevelSuppress = true;
+ if (isFieldValid(logLevel) && logLevel.equals("SUPPRESS")) {
+ isLogLevelSuppress = true;
+ }
}
- final AdjustConfig adjustConfig = new AdjustConfig(this.cordova.getActivity().getApplicationContext(), appToken, environment, isLogLevelSuppress);
+ final AdjustConfig adjustConfig = new AdjustConfig(
+ this.cordova.getActivity().getApplicationContext(),
+ appToken,
+ environment,
+ isLogLevelSuppress);
if (!adjustConfig.isValid()) {
return;
}
+ // SDK prefix.
+ if (parameters.containsKey(KEY_SDK_PREFIX)) {
+ String sdkPrefix = parameters.get(KEY_SDK_PREFIX).toString();
+ if (isFieldValid(sdkPrefix)) {
+ adjustConfig.setSdkPrefix(sdkPrefix);
+ }
+ }
+
// Log level.
if (isFieldValid(logLevel)) {
- if (logLevel.equals("VERBOSE")) {
- adjustConfig.setLogLevel(LogLevel.VERBOSE);
- } else if (logLevel.equals("DEBUG")) {
- adjustConfig.setLogLevel(LogLevel.DEBUG);
- } else if (logLevel.equals("INFO")) {
- adjustConfig.setLogLevel(LogLevel.INFO);
- } else if (logLevel.equals("WARN")) {
- adjustConfig.setLogLevel(LogLevel.WARN);
- } else if (logLevel.equals("ERROR")) {
- adjustConfig.setLogLevel(LogLevel.ERROR);
- } else if (logLevel.equals("ASSERT")) {
- adjustConfig.setLogLevel(LogLevel.ASSERT);
- } else if (logLevel.equals("SUPPRESS")) {
- adjustConfig.setLogLevel(LogLevel.SUPRESS);
- } else {
- adjustConfig.setLogLevel(LogLevel.INFO);
+ switch (logLevel) {
+ case "VERBOSE":
+ adjustConfig.setLogLevel(LogLevel.VERBOSE);
+ break;
+ case "DEBUG":
+ adjustConfig.setLogLevel(LogLevel.DEBUG);
+ break;
+ case "WARN":
+ adjustConfig.setLogLevel(LogLevel.WARN);
+ break;
+ case "ERROR":
+ adjustConfig.setLogLevel(LogLevel.ERROR);
+ break;
+ case "ASSERT":
+ adjustConfig.setLogLevel(LogLevel.ASSERT);
+ break;
+ case "SUPPRESS":
+ adjustConfig.setLogLevel(LogLevel.SUPRESS);
+ break;
+ case "INFO":
+ default:
+ adjustConfig.setLogLevel(LogLevel.INFO);
+ break;
}
}
- // SDK prefix.
- if (isFieldValid(sdkPrefix)) {
- adjustConfig.setSdkPrefix(sdkPrefix);
+ // COPPA compliance
+ if (parameters.containsKey(KEY_IS_COPPA_COMPLIANCE_ENABLED)) {
+ String strIsCoppaComplianceEnabled = parameters.get(KEY_IS_COPPA_COMPLIANCE_ENABLED).toString();
+ boolean isCoppaComplianceEnabled = Boolean.parseBoolean(strIsCoppaComplianceEnabled);
+ if (isCoppaComplianceEnabled) {
+ adjustConfig.enableCoppaCompliance();
+ }
}
- // Main process name.
- if (isFieldValid(processName)) {
- adjustConfig.setProcessName(processName);
- }
-
- // Default tracker.
- if (isFieldValid(defaultTracker)) {
- adjustConfig.setDefaultTracker(defaultTracker);
- }
-
- // External device ID.
- if (isFieldValid(externalDeviceId)) {
- adjustConfig.setExternalDeviceId(externalDeviceId);
- }
-
- // URL strategy.
- if (isFieldValid(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);
+ // Google Play Store kids compliance
+ if (parameters.containsKey(KEY_IS_PLAY_STORE_KIDS_COMPLIANCE_ENABLED)) {
+ String strIsPlayStoreKidsComplianceEnabled = parameters.get(KEY_IS_PLAY_STORE_KIDS_COMPLIANCE_ENABLED).toString();
+ boolean isPlayStoreKidsComplianceEnabled = Boolean.parseBoolean(strIsPlayStoreKidsComplianceEnabled);
+ if (isPlayStoreKidsComplianceEnabled) {
+ adjustConfig.enablePlayStoreKidsCompliance();
}
}
- // User agent.
- if (isFieldValid(userAgent)) {
- adjustConfig.setUserAgent(userAgent);
+ // Read device info only once
+ if (parameters.containsKey(KEY_IS_DEVICE_IDS_READING_ONCE_ENABLED)) {
+ String strIsDeviceIdsReadingOnceEnabled = parameters.get(KEY_IS_DEVICE_IDS_READING_ONCE_ENABLED).toString();
+ boolean isDeviceIdsReadingOnceEnabled = Boolean.parseBoolean(strIsDeviceIdsReadingOnceEnabled);
+ if (isDeviceIdsReadingOnceEnabled) {
+ adjustConfig.enableDeviceIdsReadingOnce();
+ }
}
- // App secret.
- if (isFieldValid(secretId) && isFieldValid(info1) && isFieldValid(info2) && isFieldValid(info3) && isFieldValid(info4)) {
+ // Event deduplication buffer size
+ if (parameters.containsKey(KEY_EVENT_DEDUPLICATION_IDS_MAX_SIZE)) {
+ String strEventDeduplicationIdsMaxSize = parameters.get(KEY_EVENT_DEDUPLICATION_IDS_MAX_SIZE).toString();
try {
- long lSecretId = Long.parseLong(secretId, 10);
- long lInfo1 = Long.parseLong(info1, 10);
- long lInfo2 = Long.parseLong(info2, 10);
- long lInfo3 = Long.parseLong(info3, 10);
- long lInfo4 = Long.parseLong(info4, 10);
- adjustConfig.setAppSecret(lSecretId, lInfo1, lInfo2, lInfo3, lInfo4);
- } catch(NumberFormatException ignored) {}
+ int eventDeduplicationIdsMaxSize = Integer.valueOf(strEventDeduplicationIdsMaxSize);
+ adjustConfig.setEventDeduplicationIdsMaxSize(eventDeduplicationIdsMaxSize);
+ } catch (Exception e) {}
}
- // Preinstall file path.
- if (isFieldValid(preinstallFilePath)) {
- adjustConfig.setPreinstallFilePath(preinstallFilePath);
- }
+ // URL strategy
+ if (parameters.containsKey(KEY_URL_STRATEGY_DOMAINS) &&
+ parameters.containsKey(KEY_USE_SUBDOMAINS) &&
+ parameters.containsKey(KEY_IS_DATA_RESIDENCY)) {
+ String strUrlStrategyDomains = parameters.get(KEY_URL_STRATEGY_DOMAINS).toString();
+ 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 = parameters.get(KEY_USE_SUBDOMAINS).toString();
+ boolean useSubdomains = Boolean.parseBoolean(strShouldUseSubdomains);
+
+ String strIsDataResidency = parameters.get(KEY_IS_DATA_RESIDENCY).toString();
+ boolean isDataResidency = Boolean.parseBoolean(strIsDataResidency);
- // FB app ID (meta install referrer).
- if (isFieldValid(fbAppId)) {
- adjustConfig.setFbAppId(fbAppId);
+ adjustConfig.setUrlStrategy(urlStrategyDomainsArray, useSubdomains, isDataResidency);
+ } catch (JSONException ignored) {}
}
- // Deprecated.
- // Read mobile equipment identity.
- // adjustConfig.setReadMobileEquipmentIdentity(readMobileEquipmentIdentity);
+ // Main process name.
+ if (parameters.containsKey(KEY_PROCESS_NAME)) {
+ String processName = parameters.get(KEY_PROCESS_NAME).toString();
+ if (isFieldValid(processName)) {
+ adjustConfig.setProcessName(processName);
+ }
+ }
- // Event buffering.
- adjustConfig.setEventBufferingEnabled(eventBufferingEnabled);
+ // Default tracker
+ if (parameters.containsKey(KEY_DEFAULT_TRACKER)) {
+ String defaultTracker = parameters.get(KEY_DEFAULT_TRACKER).toString();
+ if (isFieldValid(defaultTracker)) {
+ adjustConfig.setDefaultTracker(defaultTracker);
+ }
+ }
- // COPPA compliant.
- adjustConfig.setCoppaCompliantEnabled(coppaCompliantEnabled);
+ // External device ID
+ if (parameters.containsKey(KEY_EXTERNAL_DEVICE_ID)) {
+ String externalDeviceId = parameters.get(KEY_EXTERNAL_DEVICE_ID).toString();
+ if (isFieldValid(externalDeviceId)) {
+ adjustConfig.setExternalDeviceId(externalDeviceId);
+ }
+ }
- // Play Store Kids App.
- adjustConfig.setPlayStoreKidsAppEnabled(playStoreKidsAppEnabled);
+ // Custom preinstall file path.
+ if (parameters.containsKey(KEY_PREINSTALL_FILE_PATH)) {
+ String preinstallFilePath = parameters.get(KEY_PREINSTALL_FILE_PATH).toString();
+ if (isFieldValid(preinstallFilePath)) {
+ adjustConfig.setPreinstallFilePath(preinstallFilePath);
+ }
+ }
- // Final Android attribution.
- adjustConfig.setFinalAttributionEnabled(finalAndroidAttributionEnabled);
+ // FB app ID (META install referrer).
+ if (parameters.containsKey(KEY_FB_APP_ID)) {
+ String fbAppId = parameters.get(KEY_FB_APP_ID).toString();
+ if (isFieldValid(fbAppId)) {
+ adjustConfig.setFbAppId(fbAppId);
+ }
+ }
- // Read device info just once.
- adjustConfig.setReadDeviceInfoOnceEnabled(readDeviceInfoOnceEnabled);
+ // Sending in background
+ if (parameters.containsKey(KEY_IS_SENDING_IN_BACKGROUND_ENABLED)) {
+ String strIsSendingInBackgroundEnabled = parameters.get(KEY_IS_SENDING_IN_BACKGROUND_ENABLED).toString();
+ boolean isSendingInBackgroundEnabled = Boolean.parseBoolean(strIsSendingInBackgroundEnabled);
+ if (isSendingInBackgroundEnabled) {
+ adjustConfig.enableSendingInBackground();
+ }
+ }
- // Is device known.
- adjustConfig.setDeviceKnown(isDeviceKnown);
+ // Cost data in attribution callback
+ if (parameters.containsKey(KEY_IS_COST_DATA_IN_ATTRIBUTION_ENABLED)) {
+ String strIsCostDataInAttributionEnabled = parameters.get(KEY_IS_COST_DATA_IN_ATTRIBUTION_ENABLED).toString();
+ boolean isCostDataInAttributionEnabled = Boolean.parseBoolean(strIsCostDataInAttributionEnabled);
+ if (isCostDataInAttributionEnabled) {
+ adjustConfig.enableCostDataInAttribution();
+ }
+ }
- // Background tracking.
- adjustConfig.setSendInBackground(sendInBackground);
+ // Preinstall tracking
+ if (parameters.containsKey(KEY_IS_PREINSTALL_TRACKING_ENABLED)) {
+ String strIsPreinstallTrackingEnabled = parameters.get(KEY_IS_PREINSTALL_TRACKING_ENABLED).toString();
+ boolean isPreinstallTrackingEnabled = Boolean.parseBoolean(strIsPreinstallTrackingEnabled);
+ if (isPreinstallTrackingEnabled) {
+ adjustConfig.enablePreinstallTracking();
+ }
+ }
// Launching deferred deep link.
- this.shouldLaunchDeeplink = shouldLaunchDeeplink;
-
- // Cost data.
- adjustConfig.setNeedsCost(needsCost);
-
- // Preinstall tracking enabled.
- adjustConfig.setPreinstallTrackingEnabled(preinstallTrackingEnabled);
-
- // Delayed start.
- if (isFieldValid(delayStart)) {
- try {
- double dDelayStart = Double.parseDouble(delayStart);
- adjustConfig.setDelayStart(dDelayStart);
- } catch(NumberFormatException ignored) {}
+ if (parameters.containsKey(KEY_IS_DEFERRED_DEEP_LINK_OPENING_ENABLED)) {
+ String strIsDeferredDeeplinkOpeningEnabled = parameters.get(KEY_IS_DEFERRED_DEEP_LINK_OPENING_ENABLED).toString();
+ isDeferredDeeplinkOpeningEnabled = strIsDeferredDeeplinkOpeningEnabled.equals("true");
}
// Attribution callback.
@@ -514,127 +375,98 @@ private void executeCreate(final JSONArray args) throws JSONException {
// Deferred deeplink callback listener.
if (deferredDeeplinkCallbackContext != null) {
- adjustConfig.setOnDeeplinkResponseListener(this);
- }
-
- // PLUGIN
- // Check if OAID reading is enabled to potentially ping OAID plugin if added natively.
- if (oaidReadingEnabled == true) {
- Logger logger = (Logger)AdjustFactory.getLogger();
- try {
- Class clazz = Class.forName("com.adjust.sdk.oaid.AdjustOaid");
- if (clazz != null) {
- Method method = clazz.getMethod("readOaid", (Class>[]) null);
- if (method != null) {
- method.invoke(null, (Object[])null);
- logger.info(String.format("[AdjustCordova]: Adjust OAID plugin successfully found in the app"));
- logger.info(String.format("[AdjustCordova]: OAID reading enabled"));
- }
- }
- } catch (Exception e) {
- logger.error(String.format("[AdjustCordova]: OAID reading failed"));
- e.printStackTrace();
- }
+ adjustConfig.setOnDeferredDeeplinkResponseListener(this);
}
// Start SDK.
- Adjust.onCreate(adjustConfig);
- // Needed because Cordova doesn't launch 'resume' event on app start.
- // It initializes it only when app comes back from the background.
- Adjust.onResume();
+ Adjust.initSdk(adjustConfig);
}
- private void executeTrackEvent(final JSONArray args) throws JSONException {
- String params = args.getString(0);
- JSONArray jsonArrayParams = new JSONArray(params);
- JSONObject jsonParameters = jsonArrayParams.optJSONObject(0);
- Map parameters = jsonObjectToMap(jsonParameters);
-
- String eventToken = null;
- String revenue = null;
- String currency = null;
- String transactionId = null;
- String callbackId = null;
- String productId = null;
- String purchaseToken = null;
-
- if (parameters.containsKey(KEY_EVENT_TOKEN)) {
- eventToken = parameters.get(KEY_EVENT_TOKEN).toString();
- }
- if (parameters.containsKey(KEY_REVENUE)) {
- revenue = parameters.get(KEY_REVENUE).toString();
- }
- if (parameters.containsKey(KEY_CURRENCY)) {
- currency = parameters.get(KEY_CURRENCY).toString();
- }
- if (parameters.containsKey(KEY_TRANSACTION_ID)) {
- transactionId = parameters.get(KEY_TRANSACTION_ID).toString();
- }
- if (parameters.containsKey(KEY_CALLBACK_ID)) {
- callbackId = parameters.get(KEY_CALLBACK_ID).toString();
- }
- if (parameters.containsKey(KEY_PRODUCT_ID)) {
- productId = parameters.get(KEY_PRODUCT_ID).toString();
- }
- if (parameters.containsKey(KEY_PURCHASE_TOKEN)) {
- purchaseToken = parameters.get(KEY_PURCHASE_TOKEN).toString();
- }
-
- JSONArray partnerParametersJson = (JSONArray)parameters.get(KEY_PARTNER_PARAMETERS);
- JSONArray callbackParametersJson = (JSONArray)parameters.get(KEY_CALLBACK_PARAMETERS);
- String[] partnerParameters = jsonArrayToArray(partnerParametersJson);
- String[] callbackParameters = jsonArrayToArray(callbackParametersJson);
-
- final AdjustEvent adjustEvent = new AdjustEvent(eventToken);
- if (!adjustEvent.isValid()) {
- return;
- }
+ private void executeGetGoogleAdid(final CallbackContext callbackContext) throws JSONException {
+ Adjust.getGoogleAdId(this.cordova.getActivity().getApplicationContext(), new OnGoogleAdIdReadListener() {
+ @Override
+ public void onGoogleAdIdRead(String googleAdId) {
+ PluginResult pluginResult = new PluginResult(Status.OK, googleAdId);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
- // Revenue and currency.
- if (isFieldValid(revenue) && isFieldValid(currency)) {
- try {
- double revenueValue = Double.parseDouble(revenue);
- adjustEvent.setRevenue(revenueValue, currency);
- } catch (Exception e) {
- ILogger logger = AdjustFactory.getLogger();
- logger.error("[AdjustCordova]: Unable to parse revenue.");
+ private void executeGetAmazonAdid(final CallbackContext callbackContext) throws JSONException {
+ Adjust.getAmazonAdId(this.cordova.getActivity().getApplicationContext(), new OnAmazonAdIdReadListener() {
+ @Override
+ public void onAmazonAdIdRead(String amazonAdId) {
+ amazonAdId = (amazonAdId != null) ? amazonAdId : "";
+ PluginResult pluginResult = new PluginResult(Status.OK, amazonAdId);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
}
- }
+ });
+ }
- // Callback parameters.
- for (int i = 0; i < callbackParameters.length; i +=2) {
- String key = callbackParameters[i];
- String value = callbackParameters[i+1];
- adjustEvent.addCallbackParameter(key, value);
- }
+ private void executeGetAdid(final CallbackContext callbackContext) throws JSONException {
+ Adjust.getAdid(new OnAdidReadListener() {
+ @Override
+ public void onAdidRead(String adid) {
+ adid = (adid != null) ? adid : "";
+ PluginResult pluginResult = new PluginResult(Status.OK, adid);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
- // Partner parameters.
- for (int i = 0; i < partnerParameters.length; i += 2) {
- String key = partnerParameters[i];
- String value = partnerParameters[i+1];
- adjustEvent.addPartnerParameter(key, value);
- }
+ private void executeGetAttribution(final CallbackContext callbackContext) throws JSONException {
+ Adjust.getAttribution(new OnAttributionReadListener() {
+ @Override
+ public void onAttributionRead(AdjustAttribution adjustAttribution) {
+ JSONObject attributionJsonData = new JSONObject(getAttributionMap(adjustAttribution));
+ PluginResult pluginResult = new PluginResult(Status.OK, attributionJsonData);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
- // Transaction ID.
- if (isFieldValid(transactionId)) {
- adjustEvent.setOrderId(transactionId);
- }
+ private void executeGetSdkVersion(final CallbackContext callbackContext) throws JSONException {
+ Adjust.getSdkVersion(new OnSdkVersionReadListener() {
+ @Override
+ public void onSdkVersionRead(String sdkVersion) {
+ sdkVersion = (sdkVersion != null) ? sdkVersion : "";
+ PluginResult pluginResult = new PluginResult(Status.OK, sdkVersion);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
- // Callback ID.
- if (isFieldValid(callbackId)) {
- adjustEvent.setCallbackId(callbackId);
- }
+ private void executeIsAdjustSdkEnabled(final CallbackContext callbackContext) throws JSONException {
+ Adjust.isEnabled(this.cordova.getActivity().getApplicationContext(), new OnIsEnabledListener() {
+ @Override
+ public void onIsEnabledRead(boolean isEnabled) {
+ PluginResult pluginResult = new PluginResult(Status.OK, isEnabled);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
- // Product ID.
- if (isFieldValid(productId)) {
- adjustEvent.setProductId(productId);
- }
+ private void executeGetLastDeeplink(final CallbackContext callbackContext) throws JSONException {
+ Adjust.getLastDeeplink(this.cordova.getActivity().getApplicationContext(), new OnLastDeeplinkReadListener() {
+ @Override
+ public void onLastDeeplinkRead(Uri uri) {
+ String uriS = (uri != null) ? uri.toString() : "";
+ PluginResult pluginResult = new PluginResult(Status.OK, uriS);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
- // Purchase token.
- if (isFieldValid(purchaseToken)) {
- adjustEvent.setPurchaseToken(purchaseToken);
+ private void executeTrackEvent(final JSONArray args) throws JSONException {
+ AdjustEvent adjustEvent = serializeAdjustEventFromJson(args);
+ if (adjustEvent == null) {
+ return;
}
-
// Track event.
Adjust.trackEvent(adjustEvent);
}
@@ -656,7 +488,8 @@ private void executeTrackPlayStoreSubscription(final JSONArray args) throws JSON
if (parameters.containsKey(KEY_PRICE)) {
try {
price = Long.parseLong(parameters.get(KEY_PRICE).toString());
- } catch (NumberFormatException ignore) {}
+ } catch (NumberFormatException ignore) {
+ }
}
// Currency.
if (parameters.containsKey(KEY_CURRENCY)) {
@@ -692,25 +525,26 @@ private void executeTrackPlayStoreSubscription(final JSONArray args) throws JSON
try {
long purchaseTime = Long.parseLong(parameters.get(KEY_PURCHASE_TIME).toString());
subscription.setPurchaseTime(purchaseTime);
- } catch (NumberFormatException ignore) {}
+ } catch (NumberFormatException ignore) {
+ }
}
- JSONArray partnerParametersJson = (JSONArray)parameters.get(KEY_PARTNER_PARAMETERS);
- JSONArray callbackParametersJson = (JSONArray)parameters.get(KEY_CALLBACK_PARAMETERS);
+ JSONArray partnerParametersJson = (JSONArray) parameters.get(KEY_PARTNER_PARAMETERS);
+ JSONArray callbackParametersJson = (JSONArray) parameters.get(KEY_CALLBACK_PARAMETERS);
String[] partnerParameters = jsonArrayToArray(partnerParametersJson);
String[] callbackParameters = jsonArrayToArray(callbackParametersJson);
// Callback parameters.
- for (int i = 0; i < callbackParameters.length; i +=2) {
+ for (int i = 0; i < callbackParameters.length; i += 2) {
String key = callbackParameters[i];
- String value = callbackParameters[i+1];
+ String value = callbackParameters[i + 1];
subscription.addCallbackParameter(key, value);
}
// Partner parameters.
for (int i = 0; i < partnerParameters.length; i += 2) {
String key = partnerParameters[i];
- String value = partnerParameters[i+1];
+ String value = partnerParameters[i + 1];
subscription.addPartnerParameter(key, value);
}
@@ -719,8 +553,9 @@ private void executeTrackPlayStoreSubscription(final JSONArray args) throws JSON
}
private void executeVerifyPlayStorePurchase(
- final JSONArray args,
- final CallbackContext callbackContext) throws JSONException {
+ final JSONArray args,
+ final CallbackContext callbackContext) throws JSONException {
+
String params = args.getString(0);
JSONArray jsonArrayParams = new JSONArray(params);
JSONObject jsonParameters = jsonArrayParams.optJSONObject(0);
@@ -739,33 +574,73 @@ private void executeVerifyPlayStorePurchase(
}
// Create purchase instance.
- final AdjustPurchase purchase = new AdjustPurchase(productId, purchaseToken);
-
+ final AdjustPlayStorePurchase playStorePurchase = new AdjustPlayStorePurchase(productId, purchaseToken);
// Verify purchase.
- Adjust.verifyPurchase(purchase, new OnPurchaseVerificationFinishedListener() {
+ Adjust.verifyPlayStorePurchase(playStorePurchase, new OnPurchaseVerificationFinishedListener() {
@Override
public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
- if (callbackContext != null) {
- HashMap adjustPurchaseMap = new HashMap();
- adjustPurchaseMap.put("code", String.valueOf(verificationResult.getCode()));
- adjustPurchaseMap.put("verificationStatus", verificationResult.getVerificationStatus());
- adjustPurchaseMap.put("message", verificationResult.getMessage());
- JSONObject verificationResultJsonData = new JSONObject(adjustPurchaseMap);
- PluginResult pluginResult = new PluginResult(Status.OK, verificationResultJsonData);
- pluginResult.setKeepCallback(true);
- callbackContext.sendPluginResult(pluginResult);
- }
+ Map resultMap = getPurchaseVerificationResultMap(verificationResult);
+ JSONObject verificationResultJsonData = new JSONObject(resultMap);
+ PluginResult pluginResult = new PluginResult(Status.OK, verificationResultJsonData);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
+ }
+ });
+ }
+
+ private void executeVerifyAndTrackPlayStorePurchase(
+ final JSONArray args,
+ final CallbackContext callbackContext) throws JSONException {
+
+ AdjustEvent adjustEvent = serializeAdjustEventFromJson(args);
+ if (adjustEvent == null) {
+ return;
+ }
+ Adjust.verifyAndTrackPlayStorePurchase(adjustEvent, new OnPurchaseVerificationFinishedListener() {
+ @Override
+ public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
+ Map resultMap = getPurchaseVerificationResultMap(verificationResult);
+ JSONObject verificationResultJsonData = new JSONObject(resultMap);
+ PluginResult pluginResult = new PluginResult(Status.OK, verificationResultJsonData);
+ pluginResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(pluginResult);
}
});
}
- private void executeProcessDeeplink(
- final JSONArray args,
- final CallbackContext callbackContext) throws JSONException {
- String url = args.getString(0);
- final Uri uri = Uri.parse(url);
+ private Boolean executeProcessDeeplink(final JSONArray args) throws JSONException {
+ String params = args.getString(0);
+ JSONArray jsonArrayParams = new JSONArray(params);
+ JSONObject jsonParameters = jsonArrayParams.optJSONObject(0);
+ Map parameters = jsonObjectToMap(jsonParameters);
+
+ String deeplink = null;
+ if (parameters.containsKey(KEY_DEEPLINK)) {
+ deeplink = parameters.get(KEY_DEEPLINK).toString();
+ } else {
+ return false;
+ }
+ AdjustDeeplink adjustDeeplink = new AdjustDeeplink(Uri.parse(deeplink));
+ Adjust.processDeeplink(adjustDeeplink, this.cordova.getActivity().getApplicationContext());
+ return true;
+ }
+
+ private Boolean executeProcessAndResolveDeeplink(
+ final JSONArray args,
+ final CallbackContext callbackContext) throws JSONException {
+ String params = args.getString(0);
+ JSONArray jsonArrayParams = new JSONArray(params);
+ JSONObject jsonParameters = jsonArrayParams.optJSONObject(0);
+ Map parameters = jsonObjectToMap(jsonParameters);
- Adjust.processDeeplink(uri, this.cordova.getActivity().getApplicationContext(), new OnDeeplinkResolvedListener() {
+ String deeplink = null;
+ if (parameters.containsKey(KEY_DEEPLINK)) {
+ deeplink = parameters.get(KEY_DEEPLINK).toString();
+ } else {
+ return false;
+ }
+ AdjustDeeplink adjustDeeplink = new AdjustDeeplink(Uri.parse(deeplink));
+ Adjust.processAndResolveDeeplink(adjustDeeplink, this.cordova.getActivity().getApplicationContext(), new OnDeeplinkResolvedListener() {
@Override
public void onDeeplinkResolved(String resolvedLink) {
PluginResult pluginResult = new PluginResult(Status.OK, resolvedLink);
@@ -773,6 +648,7 @@ public void onDeeplinkResolved(String resolvedLink) {
callbackContext.sendPluginResult(pluginResult);
}
});
+ return true;
}
private void executeTrackThirdPartySharing(final JSONArray args) throws JSONException {
@@ -792,26 +668,26 @@ private void executeTrackThirdPartySharing(final JSONArray args) throws JSONExce
final AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(isEnabled);
- JSONArray granularOptionsJson = (JSONArray)parameters.get(KEY_GRANULAR_OPTIONS);
+ JSONArray granularOptionsJson = (JSONArray) parameters.get(KEY_GRANULAR_OPTIONS);
String[] granularOptions = jsonArrayToArray(granularOptionsJson);
// Granular options.
for (int i = 0; i < granularOptions.length; i += 3) {
adjustThirdPartySharing.addGranularOption(
- granularOptions[i],
- granularOptions[i+1],
- granularOptions[i+2]);
+ granularOptions[i],
+ granularOptions[i + 1],
+ granularOptions[i + 2]);
}
- JSONArray partnerSharingSettingsJson = (JSONArray)parameters.get(KEY_PARTNER_SHARING_SETTINGS);
+ JSONArray partnerSharingSettingsJson = (JSONArray) parameters.get(KEY_PARTNER_SHARING_SETTINGS);
String[] partnerSharingSettings = jsonArrayToArray(partnerSharingSettingsJson);
// Partner sharing settings.
for (int i = 0; i < partnerSharingSettings.length; i += 3) {
adjustThirdPartySharing.addPartnerSharingSetting(
- partnerSharingSettings[i],
- partnerSharingSettings[i+1],
- Boolean.parseBoolean(partnerSharingSettings[i+2]));
+ partnerSharingSettings[i],
+ partnerSharingSettings[i + 1],
+ Boolean.parseBoolean(partnerSharingSettings[i + 2]));
}
// Track third party sharing.
@@ -854,8 +730,8 @@ private void executeTrackAdRevenue(final JSONArray args) throws JSONException {
adRevenuePlacement = parameters.get(KEY_AD_REVENUE_PLACEMENT).toString();
}
- JSONArray partnerParametersJson = (JSONArray)parameters.get(KEY_PARTNER_PARAMETERS);
- JSONArray callbackParametersJson = (JSONArray)parameters.get(KEY_CALLBACK_PARAMETERS);
+ JSONArray partnerParametersJson = (JSONArray) parameters.get(KEY_PARTNER_PARAMETERS);
+ JSONArray callbackParametersJson = (JSONArray) parameters.get(KEY_CALLBACK_PARAMETERS);
String[] partnerParameters = jsonArrayToArray(partnerParametersJson);
String[] callbackParameters = jsonArrayToArray(callbackParametersJson);
@@ -873,16 +749,16 @@ private void executeTrackAdRevenue(final JSONArray args) throws JSONException {
}
// Callback parameters.
- for (int i = 0; i < callbackParameters.length; i +=2) {
+ for (int i = 0; i < callbackParameters.length; i += 2) {
String key = callbackParameters[i];
- String value = callbackParameters[i+1];
+ String value = callbackParameters[i + 1];
adjustAdRevenue.addCallbackParameter(key, value);
}
// Partner parameters.
for (int i = 0; i < partnerParameters.length; i += 2) {
String key = partnerParameters[i];
- String value = partnerParameters[i+1];
+ String value = partnerParameters[i + 1];
adjustAdRevenue.addPartnerParameter(key, value);
}
@@ -921,9 +797,9 @@ private void executeSetTestOptions(final JSONArray args) throws JSONException {
Map parameters = jsonObjectToMap(jsonParameters);
final AdjustTestOptions testOptions = new AdjustTestOptions();
- if (!jsonParameters.isNull(KEY_HAS_CONTEXT)) {
+ if (!jsonParameters.isNull(KEY_DELETE_STATE)) {
try {
- boolean value = jsonParameters.getBoolean(KEY_HAS_CONTEXT);
+ boolean value = jsonParameters.getBoolean(KEY_DELETE_STATE);
if (value) {
testOptions.context = this.cordova.getActivity().getApplicationContext();
}
@@ -932,88 +808,30 @@ private void executeSetTestOptions(final JSONArray args) throws JSONException {
}
}
- if (!jsonParameters.isNull(KEY_BASE_URL)) {
+ if (!jsonParameters.isNull(KEY_TEST_URL_OVERWRITE)) {
try {
- String value = jsonParameters.getString(KEY_BASE_URL);
+ String value = jsonParameters.getString(KEY_TEST_URL_OVERWRITE);
testOptions.baseUrl = value;
- } catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse base URL.");
- }
- }
-
- if (!jsonParameters.isNull(KEY_GDPR_URL)) {
- try {
- String value = jsonParameters.getString(KEY_GDPR_URL);
testOptions.gdprUrl = value;
- } catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse GDPR URL.");
- }
- }
-
- if (!jsonParameters.isNull(KEY_SUBSCRIPTION_URL)) {
- try {
- String value = jsonParameters.getString(KEY_SUBSCRIPTION_URL);
testOptions.subscriptionUrl = value;
- } catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse subscription URL.");
- }
- }
-
- if (!jsonParameters.isNull(KEY_PURCHASE_VERIFICATION_URL)) {
- try {
- String value = jsonParameters.getString(KEY_PURCHASE_VERIFICATION_URL);
testOptions.purchaseVerificationUrl = value;
} catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse purchase verification URL.");
+ AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse testUrlOverwrite.");
}
}
- if (!jsonParameters.isNull(KEY_BASE_PATH)) {
+ if (!jsonParameters.isNull(KEY_EXTRA_PATH)) {
try {
- String value = jsonParameters.getString(KEY_BASE_PATH);
+ String value = jsonParameters.getString(KEY_EXTRA_PATH);
testOptions.basePath = value;
- } catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse base path.");
- }
- }
-
- if (!jsonParameters.isNull(KEY_GDPR_PATH)) {
- try {
- String value = jsonParameters.getString(KEY_GDPR_PATH);
testOptions.gdprPath = value;
- } catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse GDPR path.");
- }
- }
-
- if (!jsonParameters.isNull(KEY_SUBSCRIPTION_PATH)) {
- try {
- String value = jsonParameters.getString(KEY_SUBSCRIPTION_PATH);
testOptions.subscriptionPath = value;
- } catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse subscription path.");
- }
- }
-
- if (!jsonParameters.isNull(KEY_PURCHASE_VERIFICATION_PATH)) {
- try {
- String value = jsonParameters.getString(KEY_PURCHASE_VERIFICATION_PATH);
testOptions.purchaseVerificationPath = value;
} catch (JSONException e) {
- AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse purchase verification path.");
+ AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse extra path.");
}
}
- // Keep this for the record. Not needed anymore since extraction of test-options.
- // if (!jsonParameters.isNull(KEY_USE_TEST_CONNECTION_OPTIONS)) {
- // try {
- // boolean value = jsonParameters.getBoolean(KEY_USE_TEST_CONNECTION_OPTIONS);
- // testOptions.useTestConnectionOptions = value;
- // } catch (JSONException e) {
- // AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse use test connection options.");
- // }
- // }
-
if (!jsonParameters.isNull(KEY_TIMER_INTERVAL)) {
try {
long value = jsonParameters.getLong(KEY_TIMER_INTERVAL);
@@ -1039,7 +857,7 @@ private void executeSetTestOptions(final JSONArray args) throws JSONException {
} catch (JSONException e) {
AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse session interval.");
}
- }
+ }
if (!jsonParameters.isNull(KEY_SUBSESSION_INTERVAL)) {
try {
@@ -1068,6 +886,15 @@ private void executeSetTestOptions(final JSONArray args) throws JSONException {
}
}
+ if (!jsonParameters.isNull(KEY_IGNORE_SYSTEM_LIFECYCLE_BOOTSTRAP)) {
+ try {
+ boolean ignoreSystemLifecycleBootstrap = jsonParameters.getBoolean(KEY_IGNORE_SYSTEM_LIFECYCLE_BOOTSTRAP);
+ testOptions.ignoreSystemLifecycleBootstrap = ignoreSystemLifecycleBootstrap;
+ } catch (JSONException e) {
+ AdjustFactory.getLogger().error("[AdjustCordova]: Unable to parse ignoreSystemLifecycleBootstrap.");
+ }
+ }
+
Adjust.setTestOptions(testOptions);
}
@@ -1084,7 +911,7 @@ public void onAttributionChanged(AdjustAttribution attribution) {
}
@Override
- public void onFinishedEventTrackingSucceeded(AdjustEventSuccess event) {
+ public void onEventTrackingSucceeded(AdjustEventSuccess event) {
if (eventTrackingSucceededCallbackContext == null) {
return;
}
@@ -1096,7 +923,7 @@ public void onFinishedEventTrackingSucceeded(AdjustEventSuccess event) {
}
@Override
- public void onFinishedEventTrackingFailed(AdjustEventFailure event) {
+ public void onEventTrackingFailed(AdjustEventFailure event) {
if (eventTrackingFailedCallbackContext == null) {
return;
}
@@ -1108,7 +935,7 @@ public void onFinishedEventTrackingFailed(AdjustEventFailure event) {
}
@Override
- public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess session) {
+ public void onSessionTrackingSucceeded(AdjustSessionSuccess session) {
if (sessionTrackingSucceededCallbackContext == null) {
return;
}
@@ -1120,7 +947,7 @@ public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess session) {
}
@Override
- public void onFinishedSessionTrackingFailed(AdjustSessionFailure session) {
+ public void onSessionTrackingFailed(AdjustSessionFailure session) {
if (sessionTrackingFailedCallbackContext == null) {
return;
}
@@ -1139,17 +966,109 @@ public boolean launchReceivedDeeplink(Uri deeplink) {
deferredDeeplinkCallbackContext.sendPluginResult(pluginResult);
}
- return this.shouldLaunchDeeplink;
+ return this.isDeferredDeeplinkOpeningEnabled;
}
- @Override
- public void onGoogleAdIdRead(String playAdId) {
- if (getGoogleAdIdCallbackContext == null) {
- return;
+ private AdjustEvent serializeAdjustEventFromJson(final JSONArray args) throws JSONException {
+ String params = args.getString(0);
+ JSONArray jsonArrayParams = new JSONArray(params);
+ JSONObject jsonParameters = jsonArrayParams.optJSONObject(0);
+ Map parameters = jsonObjectToMap(jsonParameters);
+
+ String eventToken = null;
+ String revenue = null;
+ String currency = null;
+ String transactionId = null;
+ String callbackId = null;
+ String productId = null;
+ String purchaseToken = null;
+ String deduplicationId = null;
+
+ if (parameters.containsKey(KEY_EVENT_TOKEN)) {
+ eventToken = parameters.get(KEY_EVENT_TOKEN).toString();
+ }
+ if (parameters.containsKey(KEY_REVENUE)) {
+ revenue = parameters.get(KEY_REVENUE).toString();
+ }
+ if (parameters.containsKey(KEY_CURRENCY)) {
+ currency = parameters.get(KEY_CURRENCY).toString();
+ }
+ if (parameters.containsKey(KEY_TRANSACTION_ID)) {
+ transactionId = parameters.get(KEY_TRANSACTION_ID).toString();
+ }
+ if (parameters.containsKey(KEY_CALLBACK_ID)) {
+ callbackId = parameters.get(KEY_CALLBACK_ID).toString();
+ }
+ if (parameters.containsKey(KEY_PRODUCT_ID)) {
+ productId = parameters.get(KEY_PRODUCT_ID).toString();
+ }
+ if (parameters.containsKey(KEY_PURCHASE_TOKEN)) {
+ purchaseToken = parameters.get(KEY_PURCHASE_TOKEN).toString();
}
- PluginResult pluginResult = new PluginResult(Status.OK, playAdId);
- pluginResult.setKeepCallback(true);
- getGoogleAdIdCallbackContext.sendPluginResult(pluginResult);
+ if (parameters.containsKey(KEY_DEDUPLICATION_ID)) {
+ deduplicationId = parameters.get(KEY_DEDUPLICATION_ID).toString();
+ }
+
+ JSONArray partnerParametersJson = (JSONArray) parameters.get(KEY_PARTNER_PARAMETERS);
+ JSONArray callbackParametersJson = (JSONArray) parameters.get(KEY_CALLBACK_PARAMETERS);
+ String[] partnerParameters = jsonArrayToArray(partnerParametersJson);
+ String[] callbackParameters = jsonArrayToArray(callbackParametersJson);
+
+ final AdjustEvent adjustEvent = new AdjustEvent(eventToken);
+ if (!adjustEvent.isValid()) {
+ return null;
+ }
+
+ // Revenue and currency.
+ if (isFieldValid(revenue) && isFieldValid(currency)) {
+ try {
+ double revenueValue = Double.parseDouble(revenue);
+ adjustEvent.setRevenue(revenueValue, currency);
+ } catch (Exception e) {
+ ILogger logger = AdjustFactory.getLogger();
+ logger.error("[AdjustCordova]: Unable to parse revenue.");
+ }
+ }
+
+ // Callback parameters.
+ for (int i = 0; i < callbackParameters.length; i += 2) {
+ String key = callbackParameters[i];
+ String value = callbackParameters[i + 1];
+ adjustEvent.addCallbackParameter(key, value);
+ }
+
+ // Partner parameters.
+ for (int i = 0; i < partnerParameters.length; i += 2) {
+ String key = partnerParameters[i];
+ String value = partnerParameters[i + 1];
+ adjustEvent.addPartnerParameter(key, value);
+ }
+
+ // Transaction ID.
+ if (isFieldValid(transactionId)) {
+ adjustEvent.setOrderId(transactionId);
+ }
+
+ // Callback ID.
+ if (isFieldValid(callbackId)) {
+ adjustEvent.setCallbackId(callbackId);
+ }
+
+ // Product ID.
+ if (isFieldValid(productId)) {
+ adjustEvent.setProductId(productId);
+ }
+
+ // Purchase token.
+ if (isFieldValid(purchaseToken)) {
+ adjustEvent.setPurchaseToken(purchaseToken);
+ }
+
+ // Deduplication ID.
+ if (isFieldValid(deduplicationId)) {
+ adjustEvent.setDeduplicationId(deduplicationId);
+ }
+ return adjustEvent;
}
}
diff --git a/src/android/AdjustCordovaUtils.java b/src/android/AdjustCordovaUtils.java
index 09e85df7..eb291576 100644
--- a/src/android/AdjustCordovaUtils.java
+++ b/src/android/AdjustCordovaUtils.java
@@ -8,56 +8,42 @@
import org.json.JSONException;
public class AdjustCordovaUtils {
- public static final String KEY_APP_TOKEN = "appToken";
+ public static final String KEY_APP_TOKEN = "appToken";
public static final String KEY_ENVIRONMENT = "environment";
public static final String KEY_LOG_LEVEL = "logLevel";
public static final String KEY_SDK_PREFIX = "sdkPrefix";
public static final String KEY_PROCESS_NAME = "processName";
public static final String KEY_DEFAULT_TRACKER = "defaultTracker";
public static final String KEY_EXTERNAL_DEVICE_ID = "externalDeviceId";
- public static final String KEY_URL_STRATEGY = "urlStrategy";
- public static final String KEY_EVENT_BUFFERING_ENABLED = "eventBufferingEnabled";
public static final String KEY_EVENT_TOKEN = "eventToken";
public static final String KEY_REVENUE = "revenue";
public static final String KEY_CURRENCY = "currency";
public static final String KEY_TRANSACTION_ID = "transactionId";
public static final String KEY_CALLBACK_ID = "callbackId";
+ public static final String KEY_DEDUPLICATION_ID = "deduplicationId";
+ public static final String KEY_EVENT_DEDUPLICATION_IDS_MAX_SIZE = "eventDeduplicationIdsMaxSize";
public static final String KEY_CALLBACK_PARAMETERS = "callbackParameters";
public static final String KEY_PARTNER_PARAMETERS = "partnerParameters";
- public static final String KEY_SEND_IN_BACKGROUND = "sendInBackground";
- public static final String KEY_SHOULD_LAUNCH_DEEPLINK = "shouldLaunchDeeplink";
- public static final String KEY_NEEDS_COST = "needsCost";
- public static final String KEY_PREINSTALL_TRACKING_ENABLED = "preinstallTrackingEnabled";
- public static final String KEY_OAID_READING_ENABLED = "oaidReadingEnabled";
+ public static final String KEY_IS_SENDING_IN_BACKGROUND_ENABLED = "isSendingInBackgroundEnabled";
+ public static final String KEY_IS_DEFERRED_DEEP_LINK_OPENING_ENABLED = "isDeferredDeeplinkOpeningEnabled";
+ public static final String KEY_IS_COST_DATA_IN_ATTRIBUTION_ENABLED = "isCostDataInAttributionEnabled";
+ public static final String KEY_IS_PREINSTALL_TRACKING_ENABLED = "isPreinstallTrackingEnabled";
public static final String KEY_IS_ENABLED = "isEnabled";
public static final String KEY_GRANULAR_OPTIONS = "granularOptions";
public static final String KEY_PARTNER_SHARING_SETTINGS = "partnerSharingSettings";
- public static final String KEY_USER_AGENT = "userAgent";
- public static final String KEY_DELAY_START = "delayStart";
- public static final String KEY_SECRET_ID = "secretId";
- public static final String KEY_INFO_1 = "info1";
- public static final String KEY_INFO_2 = "info2";
- public static final String KEY_INFO_3 = "info3";
- public static final String KEY_INFO_4 = "info4";
public static final String KEY_PREINSTALL_FILE_PATH = "preinstallFilePath";
- public static final String KEY_DEVICE_KNOWN = "isDeviceKnown";
- // public static final String KEY_READ_MOBILE_EQUIPMENT_IDENTITY = "readMobileEquipmentIdentity";
- public static final String KEY_BASE_URL = "baseUrl";
- public static final String KEY_GDPR_URL = "gdprUrl";
- public static final String KEY_SUBSCRIPTION_URL = "subscriptionUrl";
- public static final String KEY_PURCHASE_VERIFICATION_URL = "purchaseVerificationUrl";
- public static final String KEY_BASE_PATH = "basePath";
- public static final String KEY_GDPR_PATH = "gdprPath";
- public static final String KEY_SUBSCRIPTION_PATH = "subscriptionPath";
- public static final String KEY_PURCHASE_VERIFICATION_PATH = "purchaseVerificationPath";
- public static final String KEY_USE_TEST_CONNECTION_OPTIONS = "useTestConnectionOptions";
+
+ public static final String KEY_TEST_URL_OVERWRITE = "testUrlOverwrite";
+ public static final String KEY_EXTRA_PATH = "extraPath";
public static final String KEY_TIMER_INTERVAL = "timerIntervalInMilliseconds";
public static final String KEY_TIMER_START = "timerStartInMilliseconds";
public static final String KEY_SESSION_INTERVAL = "sessionIntervalInMilliseconds";
public static final String KEY_SUBSESSION_INTERVAL = "subsessionIntervalInMilliseconds";
public static final String KEY_TEARDOWN = "teardown";
public static final String KEY_NO_BACKOFF_WAIT = "noBackoffWait";
- public static final String KEY_HAS_CONTEXT = "hasContext";
+ public static final String KEY_DELETE_STATE = "deleteState";
+ public static final String KEY_IGNORE_SYSTEM_LIFECYCLE_BOOTSTRAP = "ignoreSystemLifecycleBootstrap";
+
public static final String KEY_ADID = "adid";
public static final String KEY_MESSAGE = "message";
public static final String KEY_NETWORK = "network";
@@ -86,60 +72,66 @@ public class AdjustCordovaUtils {
public static final String KEY_AD_REVENUE_NETWORK = "adRevenueNetwork";
public static final String KEY_AD_REVENUE_UNIT = "adRevenueUnit";
public static final String KEY_AD_REVENUE_PLACEMENT = "adRevenuePlacement";
- public static final String KEY_COPPA_COMPLIANT_ENABLED = "coppaCompliantEnabled";
- public static final String KEY_PLAY_STORE_KIDS_APP_ENABLED = "playStoreKidsAppEnabled";
- public static final String KEY_FINAL_ANDROID_ATTRIBUTION_ENABLED = "finalAndroidAttributionEnabled";
- public static final String KEY_READ_DEVICE_INFO_ONCE_ENABLED = "readDeviceInfoOnceEnabled";
+ public static final String KEY_IS_COPPA_COMPLIANCE_ENABLED = "isCoppaComplianceEnabled";
+ public static final String KEY_IS_PLAY_STORE_KIDS_COMPLIANCE_ENABLED = "isPlayStoreKidsComplianceEnabled";
+ public static final String KEY_IS_DEVICE_IDS_READING_ONCE_ENABLED = "isDeviceIdsReadingOnceEnabled";
public static final String KEY_FB_APP_ID = "fbAppId";
-
- public static final String COMMAND_CREATE = "create";
+ public static final String KEY_VERIFICATION_STATUS = "verificationStatus";
+ public static final String KEY_CODE = "code";
+ public static final String KEY_DEEPLINK = "deeplink";
+ public static final String KEY_URL_STRATEGY_DOMAINS = "urlStrategyDomains";
+ public static final String KEY_USE_SUBDOMAINS = "useSubdomains";
+ public static final String KEY_IS_DATA_RESIDENCY = "isDataResidency";
+
+ // Adjust Create Configuration and Initialize SDK command
+ public static final String COMMAND_INIT_SDK = "initSdk";
+ // Callback setters commands
public static final String COMMAND_SET_ATTRIBUTION_CALLBACK = "setAttributionCallback";
public static final String COMMAND_SET_EVENT_TRACKING_SUCCEEDED_CALLBACK = "setEventTrackingSucceededCallback";
public static final String COMMAND_SET_EVENT_TRACKING_FAILED_CALLBACK = "setEventTrackingFailedCallback";
public static final String COMMAND_SET_SESSION_TRACKING_SUCCEEDED_CALLBACK = "setSessionTrackingSucceededCallback";
public static final String COMMAND_SET_SESSION_TRACKING_FAILED_CALLBACK = "setSessionTrackingFailedCallback";
public static final String COMMAND_SET_DEFERRED_DEEPLINK_CALLBACK = "setDeferredDeeplinkCallback";
- public static final String COMMAND_SET_CONVERSION_VALUE_UPDATED_CALLBACK = "setConversionValueUpdatedCallback";
- public static final String COMMAND_SET_SKAD4_CONVERSION_VALUE_UPDATED_CALLBACK = "setSkad4ConversionValueUpdatedCallback";
+ // Setters commands
public static final String COMMAND_SET_PUSH_TOKEN = "setPushToken";
- public static final String COMMAND_TRACK_EVENT = "trackEvent";
- public static final String COMMAND_SET_OFFLINE_MODE = "setOfflineMode";
- public static final String COMMAND_ON_RESUME = "onResume";
- public static final String COMMAND_ON_PAUSE = "onPause";
+ // Getters commands
+ public static final String COMMAND_GET_ATTRIBUTION = "getAttribution";
+ public static final String COMMAND_GET_ADID = "getAdid";
+ public static final String COMMAND_GET_GOOGLE_AD_ID = "getGoogleAdId";
+ public static final String COMMAND_GET_AMAZON_AD_ID = "getAmazonAdId";
+ public static final String COMMAND_GET_SDK_VERSION = "getSdkVersion";
+ // Global Parameters manipulation commands
+ // Callback
+ public static final String COMMAND_ADD_GLOBAL_CALLBACK_PARAMETER = "addGlobalCallbackParameter";
+ public static final String COMMAND_REMOVE_GLOBAL_CALLBACK_PARAMETER = "removeGlobalCallbackParameter";
+ public static final String COMMAND_REMOVE_GLOBAL_CALLBACK_PARAMETERS = "removeGlobalCallbackParameters";
+ // Partner
+ public static final String COMMAND_ADD_GLOBAL_PARTNER_PARAMETER = "addGlobalPartnerParameter";
+ public static final String COMMAND_REMOVE_GLOBAL_PARTNER_PARAMETER = "removeGlobalPartnerParameter";
+ public static final String COMMAND_REMOVE_GLOBAL_PARTNER_PARAMETERS = "removeGlobalPartnerParameters";
+ // SDK State commands
+ public static final String COMMAND_SWITCH_TO_OFFLINE_MODE = "switchToOfflineMode";
+ public static final String COMMAND_SWITCH_BACK_TO_ONLINE_MODE = "switchBackToOnlineMode";
public static final String COMMAND_IS_ENABLED = "isEnabled";
- public static final String COMMAND_SET_ENABLED = "setEnabled";
- public static final String COMMAND_APP_WILL_OPEN_URL = "appWillOpenUrl";
+ public static final String COMMAND_ENABLE = "enable";
+ public static final String COMMAND_DISABLE = "disable";
public static final String COMMAND_GDPR_FORGET_ME = "gdprForgetMe";
- public static final String COMMAND_DISABLE_THIRD_PARTY_SHARING = "disableThirdPartySharing";
+ // SDK Lifecycle commands
+ public static final String COMMAND_ON_RESUME = "onResume";
+ public static final String COMMAND_ON_PAUSE = "onPause";
+ // Tracking commands
+ public static final String COMMAND_TRACK_EVENT = "trackEvent";
public static final String COMMAND_TRACK_AD_REVENUE = "trackAdRevenue";
- public static final String COMMAND_TRACK_APP_STORE_SUBSCRIPTION = "trackAppStoreSubscription";
public static final String COMMAND_TRACK_PLAY_STORE_SUBSCRIPTION = "trackPlayStoreSubscription";
public static final String COMMAND_VERIFY_PLAY_STORE_PURCHASE = "verifyPlayStorePurchase";
- public static final String COMMAND_VERIFY_APP_STORE_PURCHASE = "verifyAppStorePurchase";
+ public static final String COMMAND_VERIFY_AND_TRACK_PLAY_STORE_PURCHASE = "verifyAndTrackPlayStorePurchase";
public static final String COMMAND_TRACK_THIRD_PARTY_SHARING = "trackThirdPartySharing";
public static final String COMMAND_TRACK_MEASUREMENT_CONSENT = "trackMeasurementConsent";
+ // Deeplink commands
public static final String COMMAND_PROCESS_DEEPLINK = "processDeeplink";
- public static final String COMMAND_REQUEST_TRACKING_AUTHORIZATION_WITH_COMPLETION_HANDLER = "requestTrackingAuthorizationWithCompletionHandler";
- public static final String COMMAND_UPDATE_CONVERSION_VALUE = "updateConversionValue";
- public static final String COMMAND_UPDATE_CONVERSION_VALUE_WITH_ERROR_CALLBACK = "updateConversionValueWithErrorCallback";
- public static final String COMMAND_UPDATE_SKAD4_CONVERSION_VALUE_WITH_ERROR_CALLBACK = "updateSkad4ConversionValueWithErrorCallback";
- public static final String COMMAND_GET_APP_TRACKING_AUTHORIZATION_STATUS = "getAppTrackingAuthorizationStatus";
- public static final String COMMAND_GET_IDFA = "getIdfa";
- public static final String COMMAND_GET_IDFV = "getIdfv";
- public static final String COMMAND_GET_ADID = "getAdid";
- public static final String COMMAND_CHECK_FOR_NEW_ATT_STATUS = "checkForNewAttStatus";
- public static final String COMMAND_GET_ATTRIBUTION = "getAttribution";
- public static final String COMMAND_GET_GOOGLE_AD_ID = "getGoogleAdId";
- public static final String COMMAND_GET_AMAZON_AD_ID = "getAmazonAdId";
- public static final String COMMAND_GET_SDK_VERSION = "getSdkVersion";
- public static final String COMMAND_ADD_SESSION_CALLBACK_PARAMETER = "addSessionCallbackParameter";
- public static final String COMMAND_REMOVE_SESSION_CALLBACK_PARAMETER = "removeSessionCallbackParameter";
- public static final String COMMAND_RESET_SESSION_CALLBACK_PARAMETERS = "resetSessionCallbackParameters";
- public static final String COMMAND_ADD_SESSION_PARTNER_PARAMETER = "addSessionPartnerParameter";
- public static final String COMMAND_REMOVE_SESSION_PARTNER_PARAMETER = "removeSessionPartnerParameter";
- public static final String COMMAND_RESET_SESSION_PARTNER_PARAMETERS = "resetSessionPartnerParameters";
- public static final String COMMAND_SEND_FIRST_PACKAGES = "sendFirstPackages";
- public static final String COMMAND_SET_REFERRER = "setReferrer";
+ public static final String COMMAND_PROCESS_AND_RESOLVE_DEEPLINK = "processAndResolveDeeplink";
+ public static final String COMMAND_GET_LAST_DEEPLINK = "getLastDeeplink";
+ // Testing commands
public static final String COMMAND_SET_TEST_OPTIONS = "setTestOptions";
public static final String COMMAND_TEARDOWN = "teardown";
@@ -190,7 +182,6 @@ public static Map getAttributionMap(AdjustAttribution attributio
addValueOrEmpty(map, KEY_ADGROUP, attribution.adgroup);
addValueOrEmpty(map, KEY_CREATIVE, attribution.creative);
addValueOrEmpty(map, KEY_CLICK_LABEL, attribution.clickLabel);
- addValueOrEmpty(map, KEY_ADID, attribution.adid);
addValueOrEmpty(map, KEY_COST_TYPE, attribution.costType);
addValueOrEmpty(map, KEY_COST_AMOUNT,
null != attribution.costAmount && !attribution.costAmount.isNaN() ? attribution.costAmount.toString() : null);
@@ -240,4 +231,13 @@ public static Map getSessionFailureMap(AdjustSessionFailure sess
addValueOrEmpty(map, KEY_JSON_RESPONSE, session.jsonResponse);
return map;
}
+
+ public static Map getPurchaseVerificationResultMap(AdjustPurchaseVerificationResult verificationResult) {
+ Map map = new HashMap();
+ addValueOrEmpty(map, KEY_CODE, String.valueOf(verificationResult.getCode()));
+ addValueOrEmpty(map, KEY_VERIFICATION_STATUS, verificationResult.getVerificationStatus());
+ addValueOrEmpty(map, KEY_MESSAGE, verificationResult.getMessage());
+ return map;
+ }
+
}
diff --git a/src/ios/AdjustCordova.h b/src/ios/AdjustCordova.h
index c7fbcf18..c699c142 100644
--- a/src/ios/AdjustCordova.h
+++ b/src/ios/AdjustCordova.h
@@ -3,68 +3,74 @@
// Adjust SDK
//
// Created by Pedro Filipe (@nonelse) on 3rd April 2014.
-// Copyright (c) 2012-2018 Adjust GmbH. All rights reserved.
+// Copyright (c) 2012-Present Adjust GmbH. All rights reserved.
//
#import
#if defined(__has_include) && __has_include()
#import
#else
-#import "Adjust.h"
+#import
#endif
@interface AdjustCordova : CDVPlugin
-- (void)create:(CDVInvokedUrlCommand *)command;
-- (void)isEnabled:(CDVInvokedUrlCommand *)command;
-- (void)setEnabled:(CDVInvokedUrlCommand *)command;
-- (void)trackEvent:(CDVInvokedUrlCommand *)command;
-- (void)setOfflineMode:(CDVInvokedUrlCommand *)command;
-- (void)appWillOpenUrl:(CDVInvokedUrlCommand *)command;
-- (void)getIdfa:(CDVInvokedUrlCommand *)command;
-- (void)getAdid:(CDVInvokedUrlCommand *)command;
-- (void)getAttribution:(CDVInvokedUrlCommand *)command;
-- (void)getSdkVersion:(CDVInvokedUrlCommand *)command;
-- (void)setPushToken:(CDVInvokedUrlCommand *)command;
-- (void)sendFirstPackages:(CDVInvokedUrlCommand *)command;
-- (void)gdprForgetMe:(CDVInvokedUrlCommand *)command;
-- (void)disableThirdPartySharing:(CDVInvokedUrlCommand *)command;
-- (void)trackAdRevenue:(CDVInvokedUrlCommand *)command;
+// Initialization
+- (void)initSdk:(CDVInvokedUrlCommand *)command;
+// Adjust API Callbacks setters
- (void)setAttributionCallback:(CDVInvokedUrlCommand *)command;
- (void)setEventTrackingSucceededCallback:(CDVInvokedUrlCommand *)command;
- (void)setEventTrackingFailedCallback:(CDVInvokedUrlCommand *)command;
- (void)setSessionTrackingSucceededCallback:(CDVInvokedUrlCommand *)command;
- (void)setSessionTrackingFailedCallback:(CDVInvokedUrlCommand *)command;
- (void)setDeferredDeeplinkCallback:(CDVInvokedUrlCommand *)command;
-- (void)setConversionValueUpdatedCallback:(CDVInvokedUrlCommand *)command;
-- (void)setSkad4ConversionValueUpdatedCallback:(CDVInvokedUrlCommand *)command;
-- (void)addSessionPartnerParameter:(CDVInvokedUrlCommand *)command;
-- (void)addSessionCallbackParameter:(CDVInvokedUrlCommand *)command;
-- (void)removeSessionPartnerParameter:(CDVInvokedUrlCommand *)command;
-- (void)removeSessionCallbackParameter:(CDVInvokedUrlCommand *)command;
-- (void)resetSessionPartnerParameters:(CDVInvokedUrlCommand *)command;
-- (void)resetSessionCallbackParameters:(CDVInvokedUrlCommand *)command;
+- (void)setSkanUpdatedCallback:(CDVInvokedUrlCommand *)command;
+// Adjust API
+// Setters
+- (void)setPushToken:(CDVInvokedUrlCommand *)command;
+// Getters
+- (void)getAttribution:(CDVInvokedUrlCommand *)command;
+- (void)getAdid:(CDVInvokedUrlCommand *)command;
+- (void)getIdfa:(CDVInvokedUrlCommand *)command;
+- (void)getIdfv:(CDVInvokedUrlCommand *)command;
+- (void)getSdkVersion:(CDVInvokedUrlCommand *)command;
+// Global Parameters manipulation commands
+// Callback
+- (void)addGlobalCallbackParameter:(CDVInvokedUrlCommand *)command;
+- (void)removeGlobalCallbackParameter:(CDVInvokedUrlCommand *)command;
+- (void)removeGlobalCallbackParameters:(CDVInvokedUrlCommand *)command;
+// Partner
+- (void)addGlobalPartnerParameter:(CDVInvokedUrlCommand *)command;
+- (void)removeGlobalPartnerParameter:(CDVInvokedUrlCommand *)command;
+- (void)removeGlobalPartnerParameters:(CDVInvokedUrlCommand *)command;
+// SDK State
+- (void)switchToOfflineMode:(CDVInvokedUrlCommand *)command;
+- (void)switchBackToOnlineMode:(CDVInvokedUrlCommand *)command;
+- (void)enable:(CDVInvokedUrlCommand *)command;
+- (void)disable:(CDVInvokedUrlCommand *)command;
+- (void)isEnabled:(CDVInvokedUrlCommand *)command;
+- (void)gdprForgetMe:(CDVInvokedUrlCommand *)command;
+// SDK Lifecycle
+- (void)onPause:(CDVInvokedUrlCommand *)command;
+- (void)onResume:(CDVInvokedUrlCommand *)command;
+// Tracking
+- (void)trackEvent:(CDVInvokedUrlCommand *)command;
+- (void)trackAdRevenue:(CDVInvokedUrlCommand *)command;
- (void)trackAppStoreSubscription:(CDVInvokedUrlCommand *)command;
-- (void)requestTrackingAuthorizationWithCompletionHandler:(CDVInvokedUrlCommand *)command;
-- (void)updateConversionValue:(CDVInvokedUrlCommand *)command;
-- (void)updateConversionValueWithErrorCallback:(CDVInvokedUrlCommand *)command;
-- (void)updateSkad4ConversionValueWithErrorCallback:(CDVInvokedUrlCommand *)command;
-- (void)getAppTrackingAuthorizationStatus:(CDVInvokedUrlCommand *)command;
+- (void)verifyAppStorePurchase:(CDVInvokedUrlCommand *)command;
+- (void)verifyAndTrackAppStorePurchase:(CDVInvokedUrlCommand *)command;
- (void)trackThirdPartySharing:(CDVInvokedUrlCommand *)command;
- (void)trackMeasurementConsent:(CDVInvokedUrlCommand *)command;
-- (void)getLastDeeplink:(CDVInvokedUrlCommand *)command;
-- (void)verifyAppStorePurchase:(CDVInvokedUrlCommand *)command;
-- (void)getIdfv:(CDVInvokedUrlCommand *)command;
+// Deeplink
- (void)processDeeplink:(CDVInvokedUrlCommand *)command;
-
-- (void)onPause:(CDVInvokedUrlCommand *)command;
-- (void)onResume:(CDVInvokedUrlCommand *)command;
-- (void)setReferrer:(CDVInvokedUrlCommand *)command;
-- (void)getGoogleAdId:(CDVInvokedUrlCommand *)command;
-- (void)getAmazonAdId:(CDVInvokedUrlCommand *)command;
-- (void)trackPlayStoreSubscription:(CDVInvokedUrlCommand *)command;
-- (void)verifyPlayStorePurchase:(CDVInvokedUrlCommand *)command;
-
+- (void)processAndResolveDeeplink:(CDVInvokedUrlCommand *)command;
+- (void)getLastDeeplink:(CDVInvokedUrlCommand *)command;
+// App Tracking Authorization
+- (void)requestAppTrackingAuthorization:(CDVInvokedUrlCommand *)command;
+- (void)getAppTrackingAuthorizationStatus:(CDVInvokedUrlCommand *)command;
+// SKAN
+- (void)updateSkanConversionValue:(CDVInvokedUrlCommand *)command;
+// Testing
- (void)setTestOptions:(CDVInvokedUrlCommand *)command;
- (void)teardown:(CDVInvokedUrlCommand *)command;
diff --git a/src/ios/AdjustCordova.m b/src/ios/AdjustCordova.m
index 745c6f8d..c6097112 100644
--- a/src/ios/AdjustCordova.m
+++ b/src/ios/AdjustCordova.m
@@ -3,7 +3,7 @@
// Adjust SDK
//
// Created by Pedro Filipe (@nonelse) on 3rd April 2014.
-// Copyright (c) 2012-2018 Adjust GmbH. All rights reserved.
+// Copyright (c) 2012-Present Adjust GmbH. All rights reserved.
//
#import
@@ -15,41 +15,29 @@
#define KEY_ENVIRONMENT @"environment"
#define KEY_LOG_LEVEL @"logLevel"
#define KEY_SDK_PREFIX @"sdkPrefix"
-#define KEY_EVENT_BUFFERING_ENABLED @"eventBufferingEnabled"
-#define KEY_COPPA_COMPLIANT_ENABLED @"coppaCompliantEnabled"
#define KEY_EVENT_TOKEN @"eventToken"
#define KEY_REVENUE @"revenue"
#define KEY_CURRENCY @"currency"
-#define KEY_RECEIPT @"receipt"
#define KEY_DEFAULT_TRACKER @"defaultTracker"
#define KEY_EXTERNAL_DEVICE_ID @"externalDeviceId"
-#define KEY_URL_STRATEGY @"urlStrategy"
#define KEY_TRANSACTION_ID @"transactionId"
#define KEY_CALLBACK_ID @"callbackId"
+#define KEY_DEDUPLICATION_ID @"deduplicationId"
#define KEY_CALLBACK_PARAMETERS @"callbackParameters"
#define KEY_PARTNER_PARAMETERS @"partnerParameters"
-#define KEY_IS_RECEIPT_SET @"isReceiptSet"
#define KEY_IS_ENABLED @"isEnabled"
#define KEY_GRANULAR_OPTIONS @"granularOptions"
#define KEY_PARTNER_SHARING_SETTINGS @"partnerSharingSettings"
-#define KEY_USER_AGENT @"userAgent"
-#define KEY_REFERRER @"referrer"
-#define KEY_SHOULD_LAUNCH_DEEPLINK @"shouldLaunchDeeplink"
-#define KEY_SEND_IN_BACKGROUND @"sendInBackground"
-#define KEY_DELAY_START @"delayStart"
-#define KEY_DEVICE_KNOWN @"isDeviceKnown"
-#define KEY_NEEDS_COST @"needsCost"
-// #define KEY_ALLOW_IAD_INFO_READING @"allowiAdInfoReading"
-#define KEY_ALLOW_ADSERVICES_INFO_READING @"allowAdServicesInfoReading"
-#define KEY_ALLOW_IDFA_READING @"allowIdfaReading"
-#define KEY_HANDLE_SKADNETWORK @"handleSkAdNetwork"
-#define KEY_LINK_ME_ENABLED @"linkMeEnabled"
-#define KEY_SECRET_ID @"secretId"
-#define KEY_INFO_1 @"info1"
-#define KEY_INFO_2 @"info2"
-#define KEY_INFO_3 @"info3"
-#define KEY_INFO_4 @"info4"
-#define KEY_URL_OVERWRITE @"urlOverwrite"
+#define KEY_IS_DEFERRED_DEEP_LINK_OPENING_ENABLED @"isDeferredDeeplinkOpeningEnabled"
+#define KEY_IS_SENDING_IN_BACKGROUND_ENABLED @"isSendingInBackgroundEnabled"
+#define KEY_IS_COST_DATA_IN_ATTRIBUTION_ENABLED @"isCostDataInAttributionEnabled"
+#define KEY_IS_AD_SERVICES_ENABLED @"isAdServicesEnabled"
+#define KEY_IS_IDFA_READING_ENABLED @"isIdfaReadingEnabled"
+#define KEY_IS_IDFV_READING_ENABLED @"isIdfvReadingEnabled"
+#define KEY_IS_SKAN_ATTRIBUTION_ENABLED @"isSkanAttributionEnabled"
+#define KEY_IS_LINK_ME_ENABLED @"isLinkMeEnabled"
+#define KEY_IS_COPPA_COMPLIANCE_ENABLED @"isCoppaComplianceEnabled"
+#define KEY_TEST_URL_OVERWRITE @"testUrlOverwrite"
#define KEY_EXTRA_PATH @"extraPath"
#define KEY_USE_TEST_CONNECTION_OPTIONS @"useTestConnectionOptions"
#define KEY_TIMER_INTERVAL @"timerIntervalInMilliseconds"
@@ -60,8 +48,7 @@
#define KEY_NO_BACKOFF_WAIT @"noBackoffWait"
#define KEY_ATT_STATUS @"attStatus"
#define KEY_IDFA @"idfa"
-#define KEY_HAS_CONTEXT @"hasContext"
-#define KEY_IAD_ENABLED @"iAdFrameworkEnabled"
+#define KEY_DELETE_STATE @"deleteState"
#define KEY_ADSERVICES_ENABLED @"adServicesFrameworkEnabled"
#define KEY_PRICE @"price"
#define KEY_TRANSACTION_DATE @"transactionDate"
@@ -73,67 +60,64 @@
#define KEY_AD_REVENUE_PLACEMENT @"adRevenuePlacement"
#define KEY_ATT_CONSENT_WAITING_INTERVAL @"attConsentWaitingInterval"
#define KEY_PRODUCT_ID @"productId"
-#define KEY_READ_DEVICE_INFO_ONCE_ENABLED @"readDeviceInfoOnceEnabled"
+#define KEY_IS_DEVICE_IDS_READING_ONCE_ENABLED @"isDeviceIdsReadingOnceEnabled"
+#define KEY_URL_STRATEGY_DOMAINS @"urlStrategyDomains"
+#define KEY_USE_SUBDOMAINS @"useSubdomains"
+#define KEY_IS_DATA_RESIDENCY @"isDataResidency"
+#define KEY_EVENT_DEDUPLICATION_IDS_MAX_SIZE @"eventDeduplicationIdsMaxSize"
+#define KEY_DEEPLINK @"deeplink"
@implementation AdjustCordova {
NSString *attributionCallbackId;
- NSString *eventFailedCallbackId;
- NSString *eventSucceededCallbackId;
- NSString *sessionFailedCallbackId;
- NSString *sessionSucceededCallbackId;
+ NSString *eventTrackingFailedCallbackId;
+ NSString *eventTrackingSucceededCallbackId;
+ NSString *sessionTrackingFailedCallbackId;
+ NSString *sessionTrackingSucceededCallbackId;
NSString *deferredDeeplinkCallbackId;
- NSString *conversionValueUpdatedCallbackId;
- NSString *skad4ConversionValueUpdatedCallbackId;
+ NSString *skanUpdatedCallbackId;
}
#pragma mark - Object lifecycle methods
- (void)pluginInitialize {
attributionCallbackId = nil;
- eventFailedCallbackId = nil;
- eventSucceededCallbackId = nil;
- sessionFailedCallbackId = nil;
- sessionSucceededCallbackId = nil;
+ eventTrackingFailedCallbackId = nil;
+ eventTrackingSucceededCallbackId = nil;
+ sessionTrackingFailedCallbackId = nil;
+ sessionTrackingSucceededCallbackId = nil;
deferredDeeplinkCallbackId = nil;
- conversionValueUpdatedCallbackId = nil;
- skad4ConversionValueUpdatedCallbackId = nil;
+ skanUpdatedCallbackId = nil;
}
#pragma mark - Public methods
-
-- (void)create:(CDVInvokedUrlCommand *)command {
+#pragma mark - Create
+- (void)initSdk:(CDVInvokedUrlCommand *)command {
NSString *arguments = [command.arguments objectAtIndex:0];
NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
options:0
error:NULL];
-
NSString *appToken = [[jsonObject valueForKey:KEY_APP_TOKEN] objectAtIndex:0];
NSString *environment = [[jsonObject valueForKey:KEY_ENVIRONMENT] objectAtIndex:0];
NSString *logLevel = [[jsonObject valueForKey:KEY_LOG_LEVEL] objectAtIndex:0];
NSString *defaultTracker = [[jsonObject valueForKey:KEY_DEFAULT_TRACKER] objectAtIndex:0];
NSString *externalDeviceId = [[jsonObject valueForKey:KEY_EXTERNAL_DEVICE_ID] objectAtIndex:0];
- NSString *urlStrategy = [[jsonObject valueForKey:KEY_URL_STRATEGY] objectAtIndex:0];
- NSString *userAgent = [[jsonObject valueForKey:KEY_USER_AGENT] objectAtIndex:0];
- NSString *secretId = [[jsonObject valueForKey:KEY_SECRET_ID] objectAtIndex:0];
- NSString *info1 = [[jsonObject valueForKey:KEY_INFO_1] objectAtIndex:0];
- NSString *info2 = [[jsonObject valueForKey:KEY_INFO_2] objectAtIndex:0];
- NSString *info3 = [[jsonObject valueForKey:KEY_INFO_3] objectAtIndex:0];
- NSString *info4 = [[jsonObject valueForKey:KEY_INFO_4] objectAtIndex:0];
- NSNumber *delayStart = [[jsonObject valueForKey:KEY_DELAY_START] objectAtIndex:0];
- NSNumber *isDeviceKnown = [[jsonObject valueForKey:KEY_DEVICE_KNOWN] objectAtIndex:0];
- // NSNumber *allowiAdInfoReading = [[jsonObject valueForKey:KEY_ALLOW_IAD_INFO_READING] objectAtIndex:0];
- NSNumber *allowAdServicesInfoReading = [[jsonObject valueForKey:KEY_ALLOW_ADSERVICES_INFO_READING] objectAtIndex:0];
- NSNumber *allowIdfaReading = [[jsonObject valueForKey:KEY_ALLOW_IDFA_READING] objectAtIndex:0];
- NSNumber *handleSkAdNetwork = [[jsonObject valueForKey:KEY_HANDLE_SKADNETWORK] objectAtIndex:0];
- NSNumber *linkMeEnabled = [[jsonObject valueForKey:KEY_LINK_ME_ENABLED] objectAtIndex:0];
- NSNumber *eventBufferingEnabled = [[jsonObject valueForKey:KEY_EVENT_BUFFERING_ENABLED] objectAtIndex:0];
- NSNumber *coppaCompliantEnabled = [[jsonObject valueForKey:KEY_COPPA_COMPLIANT_ENABLED] objectAtIndex:0];
- NSNumber *readDeviceInfoOnceEnabled = [[jsonObject valueForKey:KEY_READ_DEVICE_INFO_ONCE_ENABLED] objectAtIndex:0];
- NSNumber *sendInBackground = [[jsonObject valueForKey:KEY_SEND_IN_BACKGROUND] objectAtIndex:0];
- NSNumber *shouldLaunchDeeplink = [[jsonObject valueForKey:KEY_SHOULD_LAUNCH_DEEPLINK] objectAtIndex:0];
- NSNumber *needsCost = [[jsonObject valueForKey:KEY_NEEDS_COST] objectAtIndex:0];
+ NSNumber *eventDeduplicationIdsMaxSize = [[jsonObject valueForKey:KEY_EVENT_DEDUPLICATION_IDS_MAX_SIZE] objectAtIndex:0];
+ NSNumber *isAdServicesEnabled = [[jsonObject valueForKey:KEY_IS_AD_SERVICES_ENABLED] objectAtIndex:0];
+ NSNumber *isIdfaReadingEnabled = [[jsonObject valueForKey:KEY_IS_IDFA_READING_ENABLED] objectAtIndex:0];
+ NSNumber *isIdfvReadingEnabled = [[jsonObject valueForKey:KEY_IS_IDFV_READING_ENABLED] objectAtIndex:0];
+ NSNumber *isSkanAttributionEnabled = [[jsonObject valueForKey:KEY_IS_SKAN_ATTRIBUTION_ENABLED] objectAtIndex:0];
+ NSNumber *isLinkMeEnabled = [[jsonObject valueForKey:KEY_IS_LINK_ME_ENABLED] objectAtIndex:0];
+ NSNumber *isCoppaComplianceEnabled = [[jsonObject valueForKey:KEY_IS_COPPA_COMPLIANCE_ENABLED] objectAtIndex:0];
+ NSNumber *isDeviceIdsReadingOnceEnabled = [[jsonObject valueForKey:KEY_IS_DEVICE_IDS_READING_ONCE_ENABLED] objectAtIndex:0];
+ NSNumber *isSendingInBackgroundEnabled = [[jsonObject valueForKey:KEY_IS_SENDING_IN_BACKGROUND_ENABLED] objectAtIndex:0];
+ NSNumber *isDeferredDeeplinkOpeningEnabled = [[jsonObject valueForKey:KEY_IS_DEFERRED_DEEP_LINK_OPENING_ENABLED] objectAtIndex:0];
+ NSNumber *isCostDataInAttributionEnabled = [[jsonObject valueForKey:KEY_IS_COST_DATA_IN_ATTRIBUTION_ENABLED] objectAtIndex:0];
NSNumber *attConsentWaitingInterval = [[jsonObject valueForKey:KEY_ATT_CONSENT_WAITING_INTERVAL] objectAtIndex:0];
NSString *sdkPrefix = [[jsonObject valueForKey:KEY_SDK_PREFIX] objectAtIndex:0];
+ id urlStrategyDomains = [[jsonObject valueForKey:KEY_URL_STRATEGY_DOMAINS] objectAtIndex:0];
+ NSNumber *useSubdomains = [[jsonObject valueForKey:KEY_USE_SUBDOMAINS] objectAtIndex:0];
+ NSNumber *isDataResidency = [[jsonObject valueForKey:KEY_IS_DATA_RESIDENCY] objectAtIndex:0];
+
BOOL allowSuppressLogLevel = NO;
// Check for SUPPRESS log level.
@@ -143,9 +127,9 @@ - (void)create:(CDVInvokedUrlCommand *)command {
}
}
- ADJConfig *adjustConfig = [ADJConfig configWithAppToken:appToken
- environment:environment
- allowSuppressLogLevel:allowSuppressLogLevel];
+ ADJConfig *adjustConfig = [[ADJConfig alloc] initWithAppToken:appToken
+ environment:environment
+ suppressLogLevel:allowSuppressLogLevel];
if (![adjustConfig isValid]) {
return;
@@ -156,19 +140,10 @@ - (void)create:(CDVInvokedUrlCommand *)command {
[adjustConfig setLogLevel:[ADJLogger logLevelFromString:[logLevel lowercaseString]]];
}
- // Event buffering.
- if ([self isFieldValid:eventBufferingEnabled]) {
- [adjustConfig setEventBufferingEnabled:[eventBufferingEnabled boolValue]];
- }
-
- // COPPA compliant.
- if ([self isFieldValid:coppaCompliantEnabled]) {
- [adjustConfig setCoppaCompliantEnabled:[coppaCompliantEnabled boolValue]];
- }
-
// Read device info just once.
- if ([self isFieldValid:readDeviceInfoOnceEnabled]) {
- [adjustConfig setReadDeviceInfoOnceEnabled:[readDeviceInfoOnceEnabled boolValue]];
+ if ([self isFieldValid:isDeviceIdsReadingOnceEnabled] &&
+ [isDeviceIdsReadingOnceEnabled boolValue]) {
+ [adjustConfig enableDeviceIdsReadingOnce];
}
// SDK prefix.
@@ -186,352 +161,305 @@ - (void)create:(CDVInvokedUrlCommand *)command {
[adjustConfig setExternalDeviceId:externalDeviceId];
}
- // 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];
- }
+ // ATT consent waiting interval.
+ if ([self isFieldValid:attConsentWaitingInterval]) {
+ [adjustConfig setAttConsentWaitingInterval:[attConsentWaitingInterval intValue]];
}
- // Send in background.
- if ([self isFieldValid:sendInBackground]) {
- [adjustConfig setSendInBackground:[sendInBackground boolValue]];
+ if ([self isFieldValid:eventDeduplicationIdsMaxSize]) {
+ [adjustConfig setEventDeduplicationIdsMaxSize:[eventDeduplicationIdsMaxSize integerValue]];
}
- // User agent.
- if ([self isFieldValid:userAgent]) {
- [adjustConfig setUserAgent:userAgent];
+ // Send in background.
+ if ([self isFieldValid:isSendingInBackgroundEnabled] &&
+ [isSendingInBackgroundEnabled boolValue]) {
+ [adjustConfig enableSendingInBackground];
}
- // Delay start.
- if ([self isFieldValid:delayStart]) {
- [adjustConfig setDelayStart:[delayStart doubleValue]];
+ // Cost data.
+ if ([self isFieldValid:isCostDataInAttributionEnabled] &&
+ [isCostDataInAttributionEnabled boolValue]) {
+ [adjustConfig enableCostDataInAttribution];
}
- // ATT consent waiting interval.
- if ([self isFieldValid:attConsentWaitingInterval]) {
- [adjustConfig setAttConsentWaitingInterval:[attConsentWaitingInterval intValue]];
+ // AdServices info reading.
+ if ([self isFieldValid:isAdServicesEnabled] &&
+ ![isAdServicesEnabled boolValue]) {
+ [adjustConfig disableAdServices];
}
- // Device known.
- if ([self isFieldValid:isDeviceKnown]) {
- [adjustConfig setIsDeviceKnown:[isDeviceKnown boolValue]];
+ // IDFA reading.
+ if ([self isFieldValid:isIdfaReadingEnabled] &&
+ ![isIdfaReadingEnabled boolValue]) {
+ [adjustConfig disableIdfaReading];
}
- // Cost data.
- if ([self isFieldValid:needsCost]) {
- [adjustConfig setNeedsCost:[needsCost boolValue]];
+ // IDFV reading.
+ if ([self isFieldValid:isIdfvReadingEnabled] &&
+ ![isIdfvReadingEnabled boolValue]) {
+ [adjustConfig disableIdfvReading];
}
- // iAd info reading. Deprecated.
- // if ([self isFieldValid:allowiAdInfoReading]) {
- // [adjustConfig setAllowiAdInfoReading:[allowiAdInfoReading boolValue]];
- // }
+ // SKAdNetwork handling.
+ if ([self isFieldValid:isSkanAttributionEnabled] &&
+ ![isSkanAttributionEnabled boolValue]) {
+ [adjustConfig disableSkanAttribution];
+ }
- // AdServices info reading.
- if ([self isFieldValid:allowAdServicesInfoReading]) {
- [adjustConfig setAllowAdServicesInfoReading:[allowAdServicesInfoReading boolValue]];
+ // LinkMe.
+ if ([self isFieldValid:isLinkMeEnabled] &&
+ [isLinkMeEnabled boolValue]) {
+ [adjustConfig enableLinkMe];
}
- // IDFA reading.
- if ([self isFieldValid:allowIdfaReading]) {
- [adjustConfig setAllowIdfaReading:[allowIdfaReading boolValue]];
+ // Coppa
+ if ([self isFieldValid:isCoppaComplianceEnabled] &&
+ [isCoppaComplianceEnabled boolValue]) {
+ [adjustConfig enableCoppaCompliance];
}
- // SKAdNetwork handling.
- if ([self isFieldValid:handleSkAdNetwork]) {
- if ([handleSkAdNetwork boolValue] == false) {
- [adjustConfig deactivateSKAdNetworkHandling];
+ // Url Strategy
+ if ([self isFieldValid:urlStrategyDomains] &&
+ [urlStrategyDomains count] > 0 &&
+ [self isFieldValid:useSubdomains] &&
+ [self isFieldValid:isDataResidency]) {
+
+ NSMutableArray *urlStrategyDomainsArray = [NSMutableArray array];
+ for (int i = 0; i < [urlStrategyDomains count]; i += 1) {
+ NSString *domain = [[urlStrategyDomains objectAtIndex:i] description];
+ [urlStrategyDomainsArray addObject:domain];
}
+ [adjustConfig setUrlStrategy:urlStrategyDomains
+ useSubdomains:[useSubdomains boolValue]
+ isDataResidency:[isDataResidency boolValue]];
}
- // LinkMe.
- if ([self isFieldValid:linkMeEnabled]) {
- [adjustConfig setLinkMeEnabled:[linkMeEnabled boolValue]];
- }
-
- // 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]];
- }
-
- BOOL isAttributionCallbackImplemented = attributionCallbackId != nil ? YES : NO;
- BOOL isEventSucceededCallbackImplemented = eventSucceededCallbackId != nil ? YES : NO;
- BOOL isEventFailedCallbackImplemented = eventFailedCallbackId != nil ? YES : NO;
- BOOL isSessionSucceededCallbackImplemented = sessionSucceededCallbackId != nil ? YES : NO;
- BOOL isSessionFailedCallbackImplemented = sessionFailedCallbackId != nil ? YES : NO;
- BOOL isDeferredDeeplinkCallbackImplemented = deferredDeeplinkCallbackId != nil ? YES : NO;
- BOOL isConversionValueUpdatedCallbackImplemented = conversionValueUpdatedCallbackId != nil ? YES : NO;
- BOOL isSkad4ConversionValueUpdatedCallbackImplemented = skad4ConversionValueUpdatedCallbackId != nil ? YES : NO;
- BOOL shouldLaunchDeferredDeeplink = [self isFieldValid:shouldLaunchDeeplink] ? [shouldLaunchDeeplink boolValue] : YES;
+ BOOL shouldLaunchDeferredDeeplink = [self isFieldValid:isDeferredDeeplinkOpeningEnabled] ? [isDeferredDeeplinkOpeningEnabled boolValue] : YES;
// Attribution delegate & other delegates
- if (isAttributionCallbackImplemented
- || isEventSucceededCallbackImplemented
- || isEventFailedCallbackImplemented
- || isSessionSucceededCallbackImplemented
- || isSessionFailedCallbackImplemented
- || isDeferredDeeplinkCallbackImplemented
- || isConversionValueUpdatedCallbackImplemented
- || isSkad4ConversionValueUpdatedCallbackImplemented) {
+ if (attributionCallbackId != nil
+ || eventTrackingSucceededCallbackId != nil
+ || eventTrackingFailedCallbackId != nil
+ || sessionTrackingSucceededCallbackId != nil
+ || sessionTrackingFailedCallbackId != nil
+ || deferredDeeplinkCallbackId != nil
+ || skanUpdatedCallbackId != nil
+ ) {
[adjustConfig setDelegate:
- [AdjustCordovaDelegate getInstanceWithSwizzleOfAttributionCallback:isAttributionCallbackImplemented
- eventSucceededCallback:isEventSucceededCallbackImplemented
- eventFailedCallback:isEventFailedCallbackImplemented
- sessionSucceededCallback:isSessionSucceededCallbackImplemented
- sessionFailedCallback:isSessionFailedCallbackImplemented
- deferredDeeplinkCallback:isDeferredDeeplinkCallbackImplemented
- conversionValueUpdatedCallback:isConversionValueUpdatedCallbackImplemented
- skad4ConversionValueUpdatedCallback:isSkad4ConversionValueUpdatedCallbackImplemented
- andAttributionCallbackId:attributionCallbackId
- eventSucceededCallbackId:eventSucceededCallbackId
- eventFailedCallbackId:eventFailedCallbackId
- sessionSucceededCallbackId:sessionSucceededCallbackId
- sessionFailedCallbackId:sessionFailedCallbackId
- deferredDeeplinkCallbackId:deferredDeeplinkCallbackId
- conversionValueUpdatedCallbackId:conversionValueUpdatedCallbackId
- skad4ConversionValueUpdatedCallbackId:skad4ConversionValueUpdatedCallbackId
- shouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink
- withCommandDelegate:self.commandDelegate]];
+ [AdjustCordovaDelegate getInstanceWithSwizzledAttributionCallbackId:attributionCallbackId
+ eventTrackingSucceededCallbackId:eventTrackingSucceededCallbackId
+ eventTrackingFailedCallbackId:eventTrackingFailedCallbackId
+ sessionTrackingSucceededCallbackId:sessionTrackingSucceededCallbackId
+ sessionTrackingFailedCallbackId:sessionTrackingFailedCallbackId
+ deferredDeeplinkCallbackId:deferredDeeplinkCallbackId
+ skanUpdatedCallbackId:skanUpdatedCallbackId
+ shouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink
+ withCommandDelegate:self.commandDelegate]];
}
// Start SDK.
- [Adjust appDidLaunch:adjustConfig];
- [Adjust trackSubsessionStart];
+ [Adjust initSdk:adjustConfig];
}
-- (void)trackEvent:(CDVInvokedUrlCommand *)command {
- NSString *arguments = [command.arguments objectAtIndex:0];
- NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
- options:0
- error:NULL];
+#pragma mark - Adjust API Callbacks setters
- NSString *eventToken = [[jsonObject valueForKey:KEY_EVENT_TOKEN] objectAtIndex:0];
- NSString *revenue = [[jsonObject valueForKey:KEY_REVENUE] objectAtIndex:0];
- NSString *currency = [[jsonObject valueForKey:KEY_CURRENCY] objectAtIndex:0];
- NSString *receipt = [[jsonObject valueForKey:KEY_RECEIPT] objectAtIndex:0];
- NSString *productId = [[jsonObject valueForKey:KEY_PRODUCT_ID] objectAtIndex:0];
- NSString *transactionId = [[jsonObject valueForKey:KEY_TRANSACTION_ID] objectAtIndex:0];
- NSString *callbackId = [[jsonObject valueForKey:KEY_CALLBACK_ID] objectAtIndex:0];
- // NSNumber *isReceiptSet = [[jsonObject valueForKey:KEY_IS_RECEIPT_SET] objectAtIndex:0];
- NSMutableArray *callbackParameters = [[NSMutableArray alloc] init];
- NSMutableArray *partnerParameters = [[NSMutableArray alloc] init];
+- (void)setAttributionCallback:(CDVInvokedUrlCommand *)command {
+ attributionCallbackId = command.callbackId;
+}
- if ([self isFieldValid:[[jsonObject valueForKey:KEY_CALLBACK_PARAMETERS] objectAtIndex:0]]) {
- for (id item in [[jsonObject valueForKey:KEY_CALLBACK_PARAMETERS] objectAtIndex:0]) {
- [callbackParameters addObject:item];
- }
- }
- if ([self isFieldValid:[[jsonObject valueForKey:KEY_PARTNER_PARAMETERS] objectAtIndex:0]]) {
- for (id item in [[jsonObject valueForKey:KEY_PARTNER_PARAMETERS] objectAtIndex:0]) {
- [partnerParameters addObject:item];
- }
- }
+- (void)setEventTrackingSucceededCallback:(CDVInvokedUrlCommand *)command {
+ eventTrackingSucceededCallbackId = command.callbackId;
+}
- ADJEvent *adjustEvent = [ADJEvent eventWithEventToken:eventToken];
+- (void)setEventTrackingFailedCallback:(CDVInvokedUrlCommand *)command {
+ eventTrackingFailedCallbackId = command.callbackId;
+}
- if (![adjustEvent isValid]) {
+- (void)setSessionTrackingSucceededCallback:(CDVInvokedUrlCommand *)command {
+ sessionTrackingSucceededCallbackId = command.callbackId;
+}
+
+- (void)setSessionTrackingFailedCallback:(CDVInvokedUrlCommand *)command {
+ sessionTrackingFailedCallbackId = command.callbackId;
+}
+
+- (void)setDeferredDeeplinkCallback:(CDVInvokedUrlCommand *)command {
+ deferredDeeplinkCallbackId = command.callbackId;
+}
+
+- (void)setSkanUpdatedCallback:(CDVInvokedUrlCommand *)command {
+ skanUpdatedCallbackId = command.callbackId;
+}
+
+#pragma mark - Adjust API
+#pragma mark - Setters
+
+- (void)setPushToken:(CDVInvokedUrlCommand *)command {
+ NSString *token = [command argumentAtIndex:0 withDefault:nil];
+ if (!([self isFieldValid:token])) {
return;
}
+ [Adjust setPushTokenAsString:token];
+}
- // Revenue and currency.
- if ([self isFieldValid:revenue]) {
- double revenueValue = [revenue doubleValue];
- [adjustEvent setRevenue:revenueValue currency:currency];
- }
+#pragma mark - Getters
- // Callback parameters.
- for (int i = 0; i < [callbackParameters count]; i += 2) {
- NSString *key = [callbackParameters objectAtIndex:i];
- NSObject *value = [callbackParameters objectAtIndex:(i+1)];
- [adjustEvent addCallbackParameter:key value:[NSString stringWithFormat:@"%@", value]];
- }
+- (void)getAttribution:(CDVInvokedUrlCommand *)command {
- // Partner parameters.
- for (int i = 0; i < [partnerParameters count]; i += 2) {
- NSString *key = [partnerParameters objectAtIndex:i];
- NSObject *value = [partnerParameters objectAtIndex:(i+1)];
- [adjustEvent addPartnerParameter:key value:[NSString stringWithFormat:@"%@", value]];
- }
+ [Adjust attributionWithCompletionHandler:^(ADJAttribution * _Nullable attribution) {
+ if (attribution == nil) {
+ return;
+ }
- // Deprecated.
- // Transaction ID and receipt.
- // BOOL isTransactionIdSet = NO;
- // if ([self isFieldValid:isReceiptSet]) {
- // if ([isReceiptSet boolValue]) {
- // [adjustEvent setReceipt:[receipt dataUsingEncoding:NSUTF8StringEncoding] transactionId:transactionId];
- // } else {
- // if ([self isFieldValid:transactionId]) {
- // [adjustEvent setTransactionId:transactionId];
- // isTransactionIdSet = YES;
- // }
- // }
- // }
- //
- // if (NO == isTransactionIdSet) {
- // if ([self isFieldValid:transactionId]) {
- // [adjustEvent setTransactionId:transactionId];
- // }
- // }
+ NSMutableDictionary *dictionary = [NSMutableDictionary 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 addValueOrEmpty:attribution.costAmount withKey:@"costAmount" toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.costCurrency withKey:@"costCurrency" toDictionary:dictionary];
- // Callback ID.
- if ([self isFieldValid:callbackId]) {
- [adjustEvent setCallbackId:callbackId];
- }
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+}
- // Receipt.
- if ([self isFieldValid:receipt]) {
- [adjustEvent setReceipt:[receipt dataUsingEncoding:NSUTF8StringEncoding]];
- }
+- (void)getAdid:(CDVInvokedUrlCommand *)command {
+ [Adjust adidWithCompletionHandler:^(NSString * _Nullable adid) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:adid];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+}
- // Product ID.
- if ([self isFieldValid:productId]) {
- [adjustEvent setProductId:productId];
- }
+- (void)getIdfa:(CDVInvokedUrlCommand *)command {
- // Transaction ID.
- if ([self isFieldValid:transactionId]) {
- [adjustEvent setTransactionId:transactionId];
- }
+ [Adjust idfaWithCompletionHandler:^(NSString * _Nullable idfa) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:idfa];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+}
- // Track event.
- [Adjust trackEvent:adjustEvent];
+- (void)getIdfv:(CDVInvokedUrlCommand *)command {
+ [Adjust idfvWithCompletionHandler:^(NSString * _Nullable idfv) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:idfv];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
}
-- (void)setOfflineMode:(CDVInvokedUrlCommand *)command {
- NSNumber *isEnabledNumber = [command argumentAtIndex:0 withDefault:nil];
- if (isEnabledNumber == nil) {
+
+- (void)getSdkVersion:(CDVInvokedUrlCommand *)command {
+ [Adjust sdkVersionWithCompletionHandler:^(NSString * _Nullable sdkVersion) {
+ if (sdkVersion == nil) {
+ sdkVersion = @"";
+ }
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:sdkVersion];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+}
+
+#pragma mark - Global Callback Parameters
+
+- (void)addGlobalCallbackParameter:(CDVInvokedUrlCommand *)command {
+ NSString *key = [command argumentAtIndex:0 withDefault:nil];
+ NSString *value = [command argumentAtIndex:1 withDefault:nil];
+ if (!([self isFieldValid:key]) || !([self isFieldValid:value])) {
return;
}
- [Adjust setOfflineMode:[isEnabledNumber boolValue]];
+ [Adjust addGlobalCallbackParameter:value forKey:key];
}
-- (void)setPushToken:(CDVInvokedUrlCommand *)command {
- NSString *token = [command argumentAtIndex:0 withDefault:nil];
- if (!([self isFieldValid:token])) {
+- (void)removeGlobalCallbackParameter:(CDVInvokedUrlCommand *)command {
+ NSString *key = [command argumentAtIndex:0 withDefault:nil];
+ if (!([self isFieldValid:key])) {
return;
}
- [Adjust setPushToken:token];
+ [Adjust removeGlobalCallbackParameterForKey:key];
+}
+
+- (void)removeGlobalCallbackParameters:(CDVInvokedUrlCommand *)command {
+ [Adjust removeGlobalCallbackParameters];
}
-- (void)appWillOpenUrl:(CDVInvokedUrlCommand *)command {
- NSString *urlString = [command argumentAtIndex:0 withDefault:nil];
- if (urlString == nil) {
+#pragma mark - Global Partner Parameters
+
+- (void)addGlobalPartnerParameter:(CDVInvokedUrlCommand *)command {
+ NSString *key = [command argumentAtIndex:0 withDefault:nil];
+ NSString *value = [command argumentAtIndex:1 withDefault:nil];
+ if (!([self isFieldValid:key]) || !([self isFieldValid:value])) {
return;
}
+ [Adjust addGlobalPartnerParameter:value forKey:key];
+}
- NSURL *url;
- if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) {
- url = [NSURL URLWithString:[urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]];
- } else {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+- (void)removeGlobalPartnerParameter:(CDVInvokedUrlCommand *)command {
+ NSString *key = [command argumentAtIndex:0 withDefault:nil];
+ if (!([self isFieldValid:key])) {
+ return;
}
-#pragma clang diagnostic pop
- [Adjust appWillOpenUrl:url];
+ [Adjust removeGlobalPartnerParameterForKey:key];
}
-- (void)gdprForgetMe:(CDVInvokedUrlCommand *)command {
- [Adjust gdprForgetMe];
+- (void)removeGlobalPartnerParameters:(CDVInvokedUrlCommand *)command {
+ [Adjust removeGlobalPartnerParameters];
}
-- (void)disableThirdPartySharing:(CDVInvokedUrlCommand *)command {
- [Adjust disableThirdPartySharing];
+#pragma mark - SDK State
+
+- (void)switchToOfflineMode:(CDVInvokedUrlCommand *)command {
+ [Adjust switchToOfflineMode];
}
-- (void)getIdfa:(CDVInvokedUrlCommand *)command {
- NSString *idfa = [Adjust idfa];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:idfa];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+- (void)switchBackToOnlineMode:(CDVInvokedUrlCommand *)command {
+ [Adjust switchBackToOnlineMode];
}
-- (void)getAdid:(CDVInvokedUrlCommand *)command {
- NSString *adid = [Adjust adid];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:adid];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+- (void)enable:(CDVInvokedUrlCommand *)command {
+ [Adjust enable];
}
-- (void)getAttribution:(CDVInvokedUrlCommand *)command {
- ADJAttribution *attribution = [Adjust attribution];
- if (attribution == nil) {
- return;
- }
-
- NSMutableDictionary *dictionary = [NSMutableDictionary 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 addValueOrEmpty:attribution.costAmount withKey:@"costAmount" toDictionary:dictionary];
- [self addValueOrEmpty:attribution.costCurrency withKey:@"costCurrency" toDictionary:dictionary];
-
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+- (void)disable:(CDVInvokedUrlCommand *)command {
+ [Adjust disable];
}
-- (void)getSdkVersion:(CDVInvokedUrlCommand *)command {
- NSString *sdkVersion = [Adjust sdkVersion];
- if (sdkVersion == nil) {
- sdkVersion = @"";
- }
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:sdkVersion];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+- (void)isEnabled:(CDVInvokedUrlCommand *)command {
+ [Adjust isEnabledWithCompletionHandler:^(BOOL isEnabled) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:isEnabled];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
}
-- (void)setEnabled:(CDVInvokedUrlCommand *)command {
- NSNumber *isEnabledNumber = [command argumentAtIndex:0 withDefault:nil];
- if (isEnabledNumber == nil) {
- return;
- }
+- (void)gdprForgetMe:(CDVInvokedUrlCommand *)command {
+ [Adjust gdprForgetMe];
+}
- [Adjust setEnabled:[isEnabledNumber boolValue]];
+#pragma mark - SDK Lifecycle
+
+- (void)onPause:(CDVInvokedUrlCommand *)command {
+ [Adjust trackSubsessionEnd];
}
-- (void)isEnabled:(CDVInvokedUrlCommand *)command {
- BOOL isEnabled = [Adjust isEnabled];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:isEnabled];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+- (void)onResume:(CDVInvokedUrlCommand *)command {
+ [Adjust trackSubsessionStart];
}
-- (void)sendFirstPackages:(CDVInvokedUrlCommand *)command {
- [Adjust sendFirstPackages];
+#pragma mark - Tracking
+
+- (void)trackEvent:(CDVInvokedUrlCommand *)command {
+ ADJEvent *adjustEvent = [self serializeAdjustEventFromCommand:command];
+ if (adjustEvent == nil) {
+ return;
+ }
+
+ // Track event.
+ [Adjust trackEvent:adjustEvent];
}
- (void)trackAdRevenue:(CDVInvokedUrlCommand *)command {
- if ([command.arguments count] == 2) {
- // old API
- NSString *source = [command argumentAtIndex:0 withDefault:nil];
- NSString *payload = [command argumentAtIndex:1 withDefault:nil];
- NSData *dataPayload = [payload dataUsingEncoding:NSUTF8StringEncoding];
- [Adjust trackAdRevenue:source payload:dataPayload];
- } else {
- // new API
+ if ([command.arguments count] == 1) {
NSString *arguments = [command.arguments objectAtIndex:0];
NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
options:0
@@ -615,7 +543,6 @@ - (void)trackAppStoreSubscription:(CDVInvokedUrlCommand *)command {
NSString *price = [[jsonObject valueForKey:KEY_PRICE] objectAtIndex:0];
NSString *currency = [[jsonObject valueForKey:KEY_CURRENCY] objectAtIndex:0];
NSString *transactionId = [[jsonObject valueForKey:KEY_TRANSACTION_ID] objectAtIndex:0];
- NSString *receipt = [[jsonObject valueForKey:KEY_RECEIPT] objectAtIndex:0];
NSString *transactionDate = [[jsonObject valueForKey:KEY_TRANSACTION_DATE] objectAtIndex:0];
NSString *salesRegion = [[jsonObject valueForKey:KEY_SALES_REGION] objectAtIndex:0];
NSMutableArray *callbackParameters = [[NSMutableArray alloc] init];
@@ -634,16 +561,9 @@ - (void)trackAppStoreSubscription:(CDVInvokedUrlCommand *)command {
priceValue = [NSDecimalNumber decimalNumberWithString:price];
}
- // Receipt.
- NSData *receiptValue;
- if ([self isFieldValid:receipt]) {
- receiptValue = [receipt dataUsingEncoding:NSUTF8StringEncoding];
- }
-
- ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:priceValue
- currency:currency
- transactionId:transactionId
- andReceipt:receiptValue];
+ ADJAppStoreSubscription *subscription = [[ADJAppStoreSubscription alloc] initWithPrice:priceValue
+ currency:currency
+ transactionId:transactionId];
// Transaction date.
if ([self isFieldValid:transactionDate]) {
@@ -672,135 +592,64 @@ - (void)trackAppStoreSubscription:(CDVInvokedUrlCommand *)command {
}
// Track subscription.
- [Adjust trackSubscription:subscription];
-}
-
-- (void)setAttributionCallback:(CDVInvokedUrlCommand *)command {
- attributionCallbackId = command.callbackId;
-}
-
-- (void)setEventTrackingSucceededCallback:(CDVInvokedUrlCommand *)command {
- eventSucceededCallbackId = command.callbackId;
-}
-
-- (void)setEventTrackingFailedCallback:(CDVInvokedUrlCommand *)command {
- eventFailedCallbackId = command.callbackId;
-}
-
-- (void)setSessionTrackingSucceededCallback:(CDVInvokedUrlCommand *)command {
- sessionSucceededCallbackId = command.callbackId;
-}
-
-- (void)setSessionTrackingFailedCallback:(CDVInvokedUrlCommand *)command {
- sessionFailedCallbackId = command.callbackId;
-}
-
-- (void)setDeferredDeeplinkCallback:(CDVInvokedUrlCommand *)command {
- deferredDeeplinkCallbackId = command.callbackId;
-}
-
-- (void)setConversionValueUpdatedCallback:(CDVInvokedUrlCommand *)command {
- conversionValueUpdatedCallbackId = command.callbackId;
-}
-
-- (void)setSkad4ConversionValueUpdatedCallback:(CDVInvokedUrlCommand *)command {
- skad4ConversionValueUpdatedCallbackId = command.callbackId;
-}
-
-- (void)addSessionCallbackParameter:(CDVInvokedUrlCommand *)command {
- NSString *key = [command argumentAtIndex:0 withDefault:nil];
- NSString *value = [command argumentAtIndex:1 withDefault:nil];
- if (!([self isFieldValid:key]) || !([self isFieldValid:value])) {
- return;
- }
- [Adjust addSessionCallbackParameter:key value:value];
+ [Adjust trackAppStoreSubscription:subscription];
}
-- (void)removeSessionCallbackParameter:(CDVInvokedUrlCommand *)command {
- NSString *key = [command argumentAtIndex:0 withDefault:nil];
- if (!([self isFieldValid:key])) {
- return;
- }
- [Adjust removeSessionCallbackParameter:key];
-}
-
-- (void)resetSessionCallbackParameters:(CDVInvokedUrlCommand *)command {
- [Adjust resetSessionCallbackParameters];
-}
-
-- (void)addSessionPartnerParameter:(CDVInvokedUrlCommand *)command {
- NSString *key = [command argumentAtIndex:0 withDefault:nil];
- NSString *value = [command argumentAtIndex:1 withDefault:nil];
- if (!([self isFieldValid:key]) || !([self isFieldValid:value])) {
- return;
- }
- [Adjust addSessionPartnerParameter:key value:value];
-}
+- (void)verifyAppStorePurchase:(CDVInvokedUrlCommand *)command {
+ NSString *arguments = [command.arguments objectAtIndex:0];
+ NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
+ options:0
+ error:NULL];
-- (void)removeSessionPartnerParameter:(CDVInvokedUrlCommand *)command {
- NSString *key = [command argumentAtIndex:0 withDefault:nil];
- if (!([self isFieldValid:key])) {
- return;
- }
- [Adjust removeSessionPartnerParameter:key];
-}
+ NSString *productId = [[jsonObject valueForKey:KEY_PRODUCT_ID] objectAtIndex:0];
+ NSString *transactionId = [[jsonObject valueForKey:KEY_TRANSACTION_ID] objectAtIndex:0];
-- (void)resetSessionPartnerParameters:(CDVInvokedUrlCommand *)command {
- [Adjust resetSessionPartnerParameters];
-}
+ // Create purchase instance.
+ ADJAppStorePurchase *purchase = [[ADJAppStorePurchase alloc] initWithTransactionId:transactionId
+ productId:productId];
+ // Verify purchase.
+ [Adjust verifyAppStorePurchase:purchase
+ withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
+ NSDictionary *dictionary = nil;
+ if (verificationResult == nil) {
+ dictionary = [NSMutableDictionary dictionary];
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+ messageAsDictionary:dictionary];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
-- (void)requestTrackingAuthorizationWithCompletionHandler:(CDVInvokedUrlCommand *)command {
- [Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsNSUInteger:status];
+ dictionary = [self deserializePvResult:verificationResult];
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+ messageAsDictionary:dictionary];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
}
-- (void)updateConversionValue:(CDVInvokedUrlCommand *)command {
- NSNumber *conversionValue = [command argumentAtIndex:0 withDefault:nil];
- if (conversionValue == nil) {
+- (void)verifyAndTrackAppStorePurchase:(CDVInvokedUrlCommand *)command {
+ ADJEvent *adjustEvent = [self serializeAdjustEventFromCommand:command];
+ if (adjustEvent == nil) {
return;
}
- [Adjust updateConversionValue:[conversionValue intValue]];
-}
-
-- (void)updateConversionValueWithErrorCallback:(CDVInvokedUrlCommand *)command {
- NSNumber *conversionValue = [command argumentAtIndex:0 withDefault:nil];
- if (conversionValue == nil) {
- return;
- }
-
- [Adjust updatePostbackConversionValue:[conversionValue intValue]
- completionHandler:^(NSError * _Nullable error) {
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[error localizedDescription]];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- }];
-}
-
-- (void)updateSkad4ConversionValueWithErrorCallback:(CDVInvokedUrlCommand *)command {
- NSNumber *fineValue = [command argumentAtIndex:0 withDefault:nil];
- NSString *coarseValue = [command argumentAtIndex:1 withDefault:nil];
- NSNumber *lockWindow = [command argumentAtIndex:2 withDefault:nil];
- if (fineValue == nil || coarseValue == nil || lockWindow == nil) {
- return;
- }
+ [Adjust verifyAndTrackAppStorePurchase:adjustEvent
+ withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
+ NSDictionary *dictionary = nil;;
+ if (verificationResult == nil) {
+ dictionary = [NSMutableDictionary dictionary];
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+ messageAsDictionary:dictionary];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
- [Adjust updatePostbackConversionValue:[fineValue intValue]
- coarseValue:coarseValue
- lockWindow:(BOOL)lockWindow
- completionHandler:^(NSError * _Nullable error) {
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[error localizedDescription]];
+ dictionary = [self deserializePvResult:verificationResult];
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+ messageAsDictionary:dictionary];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
}
-- (void)getAppTrackingAuthorizationStatus:(CDVInvokedUrlCommand *)command {
- int appTrackingAuthorizationStatus = [Adjust appTrackingAuthorizationStatus];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:appTrackingAuthorizationStatus];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
- (void)trackThirdPartySharing:(CDVInvokedUrlCommand *)command {
NSString *arguments = [command.arguments objectAtIndex:0];
NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
@@ -824,7 +673,8 @@ - (void)trackThirdPartySharing:(CDVInvokedUrlCommand *)command {
if (isEnabled != nil && [isEnabled isKindOfClass:[NSNull class]]) {
isEnabled = nil;
}
- ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:isEnabled];
+
+ ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabled:isEnabled];
// Granular options.
if ([self isFieldValid:granularOptions]) {
@@ -859,194 +709,189 @@ - (void)trackMeasurementConsent:(CDVInvokedUrlCommand *)command {
[Adjust trackMeasurementConsent:[isEnabledNumber boolValue]];
}
-- (void)getLastDeeplink:(CDVInvokedUrlCommand *)command {
- NSURL *lastDeeplink = [Adjust lastDeeplink];
- NSString *lastDeeplinkString = nil;
- if (lastDeeplink == nil) {
- lastDeeplinkString = @"";
+#pragma mark - Deeplink
+
+- (void)processDeeplink:(CDVInvokedUrlCommand *)command {
+ NSString *arguments = [command.arguments objectAtIndex:0];
+ NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
+ options:0
+ error:NULL];
+ NSString *deeplink;
+ if ([self isFieldValid:[[jsonObject valueForKey:KEY_DEEPLINK] objectAtIndex:0]]) {
+ deeplink = [[jsonObject valueForKey:KEY_DEEPLINK] objectAtIndex:0];
} else {
- lastDeeplinkString = [lastDeeplink absoluteString];
+ return;
}
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:lastDeeplinkString];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+
+ NSURL *url;
+ if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) {
+ url = [NSURL URLWithString:[deeplink stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]];
+ } else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ url = [NSURL URLWithString:[deeplink stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+ }
+#pragma clang diagnostic pop
+ [Adjust processDeeplink:[[ADJDeeplink alloc] initWithDeeplink:url]];
}
-- (void)verifyAppStorePurchase:(CDVInvokedUrlCommand *)command {
+- (void)processAndResolveDeeplink:(CDVInvokedUrlCommand *)command {
NSString *arguments = [command.arguments objectAtIndex:0];
NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
options:0
error:NULL];
+ NSString *deeplink;
+ if ([self isFieldValid:[[jsonObject valueForKey:KEY_DEEPLINK] objectAtIndex:0]]) {
+ deeplink = [[jsonObject valueForKey:KEY_DEEPLINK] objectAtIndex:0];
+ } else {
+ return;
+ }
- NSString *receipt = [[jsonObject valueForKey:KEY_RECEIPT] objectAtIndex:0];
- NSString *productId = [[jsonObject valueForKey:KEY_PRODUCT_ID] objectAtIndex:0];
- NSString *transactionId = [[jsonObject valueForKey:KEY_TRANSACTION_ID] objectAtIndex:0];
-
- // Receipt.
- NSData *receiptValue;
- if ([self isFieldValid:receipt]) {
- receiptValue = [receipt dataUsingEncoding:NSUTF8StringEncoding];
+ NSURL *url;
+ if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) {
+ url = [NSURL URLWithString:[deeplink stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]];
+ } else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ url = [NSURL URLWithString:[deeplink stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
+#pragma clang diagnostic pop
- // Create purchase instance.
- ADJPurchase *purchase = [[ADJPurchase alloc] initWithTransactionId:transactionId
- productId:productId
- andReceipt:receiptValue];
- // Verify purchase.
- [Adjust verifyPurchase:purchase
- completionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
- NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
- if (verificationResult == nil) {
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ ADJDeeplink *deepLink = [[ADJDeeplink alloc] initWithDeeplink:url];
+ [Adjust processAndResolveDeeplink:deepLink
+ withCompletionHandler:^(NSString * _Nullable resolvedLink) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resolvedLink];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+}
+
+- (void)getLastDeeplink:(CDVInvokedUrlCommand *)command {
+ [Adjust lastDeeplinkWithCompletionHandler:^(NSURL * _Nullable lastDeeplink) {
+ NSString *lastDeeplinkString = nil;
+ if (lastDeeplink == nil) {
+ lastDeeplinkString = @"";
+ } else {
+ lastDeeplinkString = [lastDeeplink absoluteString];
}
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:lastDeeplinkString];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+}
- [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];
+#pragma mark App Tracking Authorization
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
+- (void)requestAppTrackingAuthorization:(CDVInvokedUrlCommand *)command {
+ [Adjust requestAppTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsNSUInteger:status];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
}
-- (void)getIdfv:(CDVInvokedUrlCommand *)command {
- NSString *idfv = [Adjust idfv];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:idfv];
+- (void)getAppTrackingAuthorizationStatus:(CDVInvokedUrlCommand *)command {
+ int appTrackingAuthorizationStatus = [Adjust appTrackingAuthorizationStatus];
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:appTrackingAuthorizationStatus];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
-- (void)processDeeplink:(CDVInvokedUrlCommand *)command {
- NSString *urlString = [command argumentAtIndex:0 withDefault:nil];
- if (urlString == nil) {
- return;
- }
+#pragma mark - SKAN
- NSURL *url;
- if ([NSString instancesRespondToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) {
- url = [NSURL URLWithString:[urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]];
- } else {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+- (void)updateSkanConversionValue:(CDVInvokedUrlCommand *)command {
+ NSNumber *conversionValue = [command argumentAtIndex:0 withDefault:nil];
+ NSString *coarseValue = [command argumentAtIndex:1 withDefault:nil];
+ NSNumber *lockWindow = [command argumentAtIndex:2 withDefault:nil];
+ if (![self isFieldValid:conversionValue]) {
+ return;
}
-#pragma clang diagnostic pop
- [Adjust processDeeplink:url completionHandler:^(NSString * _Nonnull resolvedLink) {
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resolvedLink];
+ [Adjust updateSkanConversionValue:[conversionValue intValue]
+ coarseValue:coarseValue
+ lockWindow:lockWindow
+ withCompletionHandler:^(NSError * _Nullable error) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[error localizedDescription]];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}];
}
+#pragma mark - Testing
+
- (void)setTestOptions:(CDVInvokedUrlCommand *)command {
- NSString *hasContext = [[command.arguments valueForKey:KEY_HAS_CONTEXT] objectAtIndex:0];
- NSString *urlOverwrite = [[command.arguments valueForKey:KEY_URL_OVERWRITE] objectAtIndex:0];
+ NSString *testUrlOverwrite = [[command.arguments valueForKey:KEY_TEST_URL_OVERWRITE] objectAtIndex:0];
NSString *extraPath = [[command.arguments valueForKey:KEY_EXTRA_PATH] objectAtIndex:0];
NSString *timerInterval = [[command.arguments valueForKey:KEY_TIMER_INTERVAL] objectAtIndex:0];
NSString *timerStart = [[command.arguments valueForKey:KEY_TIMER_START] objectAtIndex:0];
NSString *sessionInterval = [[command.arguments valueForKey:KEY_SESSION_INTERVAL] objectAtIndex:0];
NSString *subsessionInterval = [[command.arguments valueForKey:KEY_SUBSESSION_INTERVAL] objectAtIndex:0];
NSString *teardown = [[command.arguments valueForKey:KEY_TEARDOWN] objectAtIndex:0];
+ NSString *deleteState = [[command.arguments valueForKey:KEY_DELETE_STATE] objectAtIndex:0];
NSString *noBackoffWait = [[command.arguments valueForKey:KEY_NO_BACKOFF_WAIT] objectAtIndex:0];
- // NSString *iAdFrameworkEnabled = [[command.arguments valueForKey:KEY_IAD_ENABLED] objectAtIndex:0];
NSString *adServicesFrameworkEnabled = [[command.arguments valueForKey:KEY_ADSERVICES_ENABLED] objectAtIndex:0];
NSString *attStatus = [[command.arguments valueForKey:KEY_ATT_STATUS] objectAtIndex:0];
NSString *idfa = [[command.arguments valueForKey:KEY_IDFA] objectAtIndex:0];
-
- AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
-
- if ([self isFieldValid:urlOverwrite]) {
- testOptions.urlOverwrite = urlOverwrite;
+
+ NSMutableDictionary *testOptions = [NSMutableDictionary dictionary];
+
+ if ([self isFieldValid:testUrlOverwrite]) {
+ [testOptions setObject:testUrlOverwrite forKey:KEY_TEST_URL_OVERWRITE];
}
if ([self isFieldValid:extraPath]) {
- testOptions.extraPath = extraPath;
+ [testOptions setObject:extraPath forKey:KEY_EXTRA_PATH];
}
if ([self isFieldValid:timerInterval]) {
- testOptions.timerIntervalInMilliseconds = [self convertMilliStringToNumber:timerInterval];
+ NSNumber *timerIntervalInMilliseconds = [self convertMilliStringToNumber:timerInterval];
+ [testOptions setObject:timerIntervalInMilliseconds forKey:KEY_TIMER_INTERVAL];
}
if ([self isFieldValid:timerStart]) {
- testOptions.timerStartInMilliseconds = [self convertMilliStringToNumber:timerStart];
+ NSNumber *timerStartInMilliseconds = [self convertMilliStringToNumber:timerStart];
+ [testOptions setObject:timerStartInMilliseconds forKey:KEY_TIMER_START];
}
if ([self isFieldValid:sessionInterval]) {
- testOptions.sessionIntervalInMilliseconds = [self convertMilliStringToNumber:sessionInterval];
+ NSNumber *sessionIntervalInMilliseconds = [self convertMilliStringToNumber:sessionInterval];
+ [testOptions setObject:sessionIntervalInMilliseconds forKey:KEY_SESSION_INTERVAL];
}
if ([self isFieldValid:subsessionInterval]) {
- testOptions.subsessionIntervalInMilliseconds = [self convertMilliStringToNumber:subsessionInterval];
+ NSNumber *subsessionIntervalInMilliseconds = [self convertMilliStringToNumber:subsessionInterval];
+ [testOptions setObject:subsessionIntervalInMilliseconds forKey:KEY_SUBSESSION_INTERVAL];
}
- if ([self isFieldValid:teardown]) {
- testOptions.teardown = [teardown boolValue];
+ if ([self isFieldValid:attStatus]) {
+ NSNumber *attStatusNum = [NSNumber numberWithInt:[attStatus intValue]];
+ [testOptions setObject:attStatusNum forKey:@"attStatusInt"];
}
- if ([self isFieldValid:noBackoffWait]) {
- testOptions.noBackoffWait = [noBackoffWait boolValue];
+ if ([self isFieldValid:idfa]) {
+ [testOptions setObject:idfa forKey:KEY_IDFA];
}
- if ([self isFieldValid:hasContext]) {
- testOptions.deleteState = [hasContext boolValue];
+ if ([self isFieldValid:deleteState]) {
+ NSNumber *deleteStateNumber = [NSNumber numberWithBool:[deleteState boolValue]];
+ [testOptions setObject:deleteStateNumber forKey:KEY_DELETE_STATE];
}
- // Deprecated.
- // if ([self isFieldValid:iAdFrameworkEnabled]) {
- // testOptions.iAdFrameworkEnabled = [iAdFrameworkEnabled boolValue];
- // }
- if ([self isFieldValid:adServicesFrameworkEnabled]) {
- testOptions.adServicesFrameworkEnabled = [adServicesFrameworkEnabled boolValue];
+ if ([self isFieldValid:teardown]) {
+ NSNumber *tearDownNumber = [NSNumber numberWithBool:[teardown boolValue]];
+ [testOptions setObject:tearDownNumber forKey:KEY_TEARDOWN];
}
- if ([self isFieldValid:attStatus]) {
- testOptions.attStatusInt = [NSNumber numberWithInt:[attStatus intValue]];
+ if ([self isFieldValid:noBackoffWait]) {
+ NSNumber *noBackoffWaitNum = [NSNumber numberWithBool:[noBackoffWait boolValue]];
+ [testOptions setObject:noBackoffWaitNum forKey:KEY_NO_BACKOFF_WAIT];
+
}
- if ([self isFieldValid:idfa]) {
- testOptions.idfa = idfa;
+ if ([self isFieldValid:adServicesFrameworkEnabled]) {
+ NSNumber *adServicesFrameworkEnabledNum = [NSNumber numberWithBool:[adServicesFrameworkEnabled boolValue]];
+ [testOptions setObject:adServicesFrameworkEnabledNum forKey:KEY_ADSERVICES_ENABLED];
}
-
+
[Adjust setTestOptions:testOptions];
}
- (void)teardown:(CDVInvokedUrlCommand *)command {
attributionCallbackId = nil;
- eventFailedCallbackId = nil;
- eventSucceededCallbackId = nil;
- sessionFailedCallbackId = nil;
- sessionSucceededCallbackId = nil;
+ eventTrackingFailedCallbackId = nil;
+ eventTrackingSucceededCallbackId = nil;
+ sessionTrackingFailedCallbackId = nil;
+ sessionTrackingSucceededCallbackId = nil;
deferredDeeplinkCallbackId = nil;
- conversionValueUpdatedCallbackId = nil;
- skad4ConversionValueUpdatedCallbackId = nil;
+ skanUpdatedCallbackId = nil;
[AdjustCordovaDelegate teardown];
}
-- (void)onPause:(CDVInvokedUrlCommand *)command {
- [Adjust trackSubsessionEnd];
-}
-
-- (void)onResume:(CDVInvokedUrlCommand *)command {
- [Adjust trackSubsessionStart];
-}
-
-- (void)setReferrer:(CDVInvokedUrlCommand *)command {}
-
-- (void)trackPlayStoreSubscription:(CDVInvokedUrlCommand *)command {}
-
-- (void)getGoogleAdId:(CDVInvokedUrlCommand *)command {
- NSString *googleAdId = @"";
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:googleAdId];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (void)getAmazonAdId:(CDVInvokedUrlCommand *)command {
- NSString *amazonAdId = @"";
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:amazonAdId];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (void)verifyPlayStorePurchase:(CDVInvokedUrlCommand *)command {
- NSMutableDictionary *verificationResult = [NSMutableDictionary dictionary];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:verificationResult];
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
#pragma mark - Private & helper methods
- (NSNumber *)convertMilliStringToNumber:(NSString *)milliS {
@@ -1058,12 +903,12 @@ - (BOOL)isFieldValid:(NSObject *)field {
if (field == nil) {
return NO;
}
-
+
// 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.
NSString *str = [NSString stringWithFormat:@"%@", field];
if (str != nil) {
@@ -1071,7 +916,7 @@ - (BOOL)isFieldValid:(NSObject *)field {
return NO;
}
}
-
+
return YES;
}
@@ -1085,8 +930,97 @@ - (void)addValueOrEmpty:(NSObject *)value
}
}
-- (void)checkForNewAttStatus:(CDVInvokedUrlCommand *)command {
- [Adjust checkForNewAttStatus];
+- (ADJEvent *)serializeAdjustEventFromCommand:(CDVInvokedUrlCommand *)command {
+ NSString *arguments = [command.arguments objectAtIndex:0];
+ NSArray *jsonObject = [NSJSONSerialization JSONObjectWithData:[arguments dataUsingEncoding:NSUTF8StringEncoding]
+ options:0
+ error:NULL];
+
+ NSString *eventToken = [[jsonObject valueForKey:KEY_EVENT_TOKEN] objectAtIndex:0];
+ NSString *revenue = [[jsonObject valueForKey:KEY_REVENUE] objectAtIndex:0];
+ NSString *currency = [[jsonObject valueForKey:KEY_CURRENCY] objectAtIndex:0];
+ NSString *productId = [[jsonObject valueForKey:KEY_PRODUCT_ID] objectAtIndex:0];
+ NSString *transactionId = [[jsonObject valueForKey:KEY_TRANSACTION_ID] objectAtIndex:0];
+ NSString *callbackId = [[jsonObject valueForKey:KEY_CALLBACK_ID] objectAtIndex:0];
+ NSString *deduplicationId = [[jsonObject valueForKey:KEY_DEDUPLICATION_ID] objectAtIndex:0];
+ NSMutableArray *callbackParameters = [[NSMutableArray alloc] init];
+ NSMutableArray *partnerParameters = [[NSMutableArray alloc] init];
+
+ if ([self isFieldValid:[[jsonObject valueForKey:KEY_CALLBACK_PARAMETERS] objectAtIndex:0]]) {
+ for (id item in [[jsonObject valueForKey:KEY_CALLBACK_PARAMETERS] objectAtIndex:0]) {
+ [callbackParameters addObject:item];
+ }
+ }
+ if ([self isFieldValid:[[jsonObject valueForKey:KEY_PARTNER_PARAMETERS] objectAtIndex:0]]) {
+ for (id item in [[jsonObject valueForKey:KEY_PARTNER_PARAMETERS] objectAtIndex:0]) {
+ [partnerParameters addObject:item];
+ }
+ }
+
+ ADJEvent *adjustEvent = [[ADJEvent alloc] initWithEventToken:eventToken];
+
+ if (![adjustEvent isValid]) {
+ return nil;
+ }
+
+ // Revenue and currency.
+ if ([self isFieldValid:revenue]) {
+ double revenueValue = [revenue doubleValue];
+ [adjustEvent setRevenue:revenueValue currency:currency];
+ }
+
+ // Callback parameters.
+ for (int i = 0; i < [callbackParameters count]; i += 2) {
+ NSString *key = [callbackParameters objectAtIndex:i];
+ NSObject *value = [callbackParameters objectAtIndex:(i+1)];
+ [adjustEvent addCallbackParameter:key value:[NSString stringWithFormat:@"%@", value]];
+ }
+
+ // Partner parameters.
+ for (int i = 0; i < [partnerParameters count]; i += 2) {
+ NSString *key = [partnerParameters objectAtIndex:i];
+ NSObject *value = [partnerParameters objectAtIndex:(i+1)];
+ [adjustEvent addPartnerParameter:key value:[NSString stringWithFormat:@"%@", value]];
+ }
+
+ // Deduplication ID.
+ if ([self isFieldValid:deduplicationId]) {
+ [adjustEvent setDeduplicationId:deduplicationId];
+ }
+
+ // Callback ID.
+ if ([self isFieldValid:callbackId]) {
+ [adjustEvent setCallbackId:callbackId];
+ }
+
+
+ // Product ID.
+ if ([self isFieldValid:productId]) {
+ [adjustEvent setProductId:productId];
+ }
+
+ // Transaction ID.
+ if ([self isFieldValid:transactionId]) {
+ [adjustEvent setTransactionId:transactionId];
+ }
+
+ return adjustEvent;
+}
+
+- (NSMutableDictionary *)deserializePvResult:(ADJPurchaseVerificationResult *)pvResult {
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ [self addValueOrEmpty:pvResult.verificationStatus
+ withKey:@"verificationStatus"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:[NSString stringWithFormat:@"%d", pvResult.code]
+ withKey:@"code"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:pvResult.message
+ withKey:@"message"
+ toDictionary:dictionary];
+
+ return dictionary;
}
+
@end
diff --git a/src/ios/AdjustCordovaDelegate.h b/src/ios/AdjustCordovaDelegate.h
index 076b2fa0..61b34bf6 100644
--- a/src/ios/AdjustCordovaDelegate.h
+++ b/src/ios/AdjustCordovaDelegate.h
@@ -3,48 +3,38 @@
// Adjust SDK
//
// Created by Uglješa Erceg (@uerceg) on 16th November 2016.
-// Copyright (c) 2016-2021 Adjust GmbH. All rights reserved.
+// Copyright (c) 2016-Present Adjust GmbH. All rights reserved.
//
#import
#if defined(__has_include) && __has_include()
#import
#else
-#import "Adjust.h"
+//#import "Adjust.h"
+#import
#endif
@interface AdjustCordovaDelegate : NSObject
@property (nonatomic) BOOL shouldLaunchDeferredDeeplink;
@property (nonatomic, copy) NSString *attributionCallbackId;
-@property (nonatomic, copy) NSString *eventSucceededCallbackId;
-@property (nonatomic, copy) NSString *eventFailedCallbackId;
-@property (nonatomic, copy) NSString *sessionSucceededCallbackId;
-@property (nonatomic, copy) NSString *sessionFailedCallbackId;
+@property (nonatomic, copy) NSString *eventTrackingSucceededCallbackId;
+@property (nonatomic, copy) NSString *eventTrackingFailedCallbackId;
+@property (nonatomic, copy) NSString *sessionTrackingSucceededCallbackId;
+@property (nonatomic, copy) NSString *sessionTrackingFailedCallbackId;
@property (nonatomic, copy) NSString *deferredDeeplinkCallbackId;
-@property (nonatomic, copy) NSString *conversionValueUpdatedCallbackId;
-@property (nonatomic, copy) NSString *skad4ConversionValueUpdatedCallbackId;
+@property (nonatomic, copy) NSString *skanUpdatedCallbackId;
@property (nonatomic) id adjustCordovaCommandDelegate;
-+ (id)getInstanceWithSwizzleOfAttributionCallback:(BOOL)swizzleAttributionCallback
- eventSucceededCallback:(BOOL)swizzleEventSucceededCallback
- eventFailedCallback:(BOOL)swizzleEventFailedCallback
- sessionSucceededCallback:(BOOL)swizzleSessionSucceededCallback
- sessionFailedCallback:(BOOL)swizzleSessionFailedCallback
- deferredDeeplinkCallback:(BOOL)swizzleDeferredDeeplinkCallback
- conversionValueUpdatedCallback:(BOOL)swizzleConversionValueUpdatedCallback
- skad4ConversionValueUpdatedCallback:(BOOL)swizzleSkad4ConversionValueUpdatedCallback
- andAttributionCallbackId:(NSString *)attributionCallbackId
- eventSucceededCallbackId:(NSString *)eventSucceededCallbackId
- eventFailedCallbackId:(NSString *)eventFailedCallbackId
- sessionSucceededCallbackId:(NSString *)sessionSucceededCallbackId
- sessionFailedCallbackId:(NSString *)sessionFailedCallbackId
- deferredDeeplinkCallbackId:(NSString *)deferredDeeplinkCallbackId
- conversionValueUpdatedCallbackId:(NSString *)conversionValueUpdatedCallbackId
- skad4ConversionValueUpdatedCallbackId:(NSString *)skad4ConversionValueUpdatedCallbackId
- shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
- withCommandDelegate:(id)adjustCordovaCommandDelegate;
-
++ (id)getInstanceWithSwizzledAttributionCallbackId:(NSString *)attributionCallbackId
+ eventTrackingSucceededCallbackId:(NSString *)eventTrackingSucceededCallbackId
+ eventTrackingFailedCallbackId:(NSString *)eventTrackingFailedCallbackId
+ sessionTrackingSucceededCallbackId:(NSString *)sessionTrackingSucceededCallbackId
+ sessionTrackingFailedCallbackId:(NSString *)sessionTrackingFailedCallbackId
+ deferredDeeplinkCallbackId:(NSString *)deferredDeeplinkCallbackId
+ skanUpdatedCallbackId:(NSString *)skanUpdatedCallbackId
+ shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
+ withCommandDelegate:(id)adjustCordovaCommandDelegate;
+ (void)teardown;
@end
diff --git a/src/ios/AdjustCordovaDelegate.m b/src/ios/AdjustCordovaDelegate.m
index 74d388b9..3e9744b1 100644
--- a/src/ios/AdjustCordovaDelegate.m
+++ b/src/ios/AdjustCordovaDelegate.m
@@ -3,7 +3,7 @@
// Adjust SDK
//
// Created by Uglješa Erceg (@uerceg) on 16th November 2016.
-// Copyright (c) 2016-2021 Adjust GmbH. All rights reserved.
+// Copyright (c) 2016-Present Adjust GmbH. All rights reserved.
//
#import
@@ -27,69 +27,62 @@ - (id)init {
#pragma mark - Public methods
-+ (id)getInstanceWithSwizzleOfAttributionCallback:(BOOL)swizzleAttributionCallback
- eventSucceededCallback:(BOOL)swizzleEventSucceededCallback
- eventFailedCallback:(BOOL)swizzleEventFailedCallback
- sessionSucceededCallback:(BOOL)swizzleSessionSucceededCallback
- sessionFailedCallback:(BOOL)swizzleSessionFailedCallback
- deferredDeeplinkCallback:(BOOL)swizzleDeferredDeeplinkCallback
- conversionValueUpdatedCallback:(BOOL)swizzleConversionValueUpdatedCallback
- skad4ConversionValueUpdatedCallback:(BOOL)swizzleSkad4ConversionValueUpdatedCallback
- andAttributionCallbackId:(NSString *)attributionCallbackId
- eventSucceededCallbackId:(NSString *)eventSucceededCallbackId
- eventFailedCallbackId:(NSString *)eventFailedCallbackId
- sessionSucceededCallbackId:(NSString *)sessionSucceededCallbackId
- sessionFailedCallbackId:(NSString *)sessionFailedCallbackId
- deferredDeeplinkCallbackId:(NSString *)deferredDeeplinkCallbackId
- conversionValueUpdatedCallbackId:(NSString *)conversionValueUpdatedCallbackId
- skad4ConversionValueUpdatedCallbackId:(NSString *)skad4ConversionValueUpdatedCallbackId
- shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
- withCommandDelegate:(id)adjustCordovaCommandDelegate {
++ (id)getInstanceWithSwizzledAttributionCallbackId:(NSString *)attributionCallbackId
+ eventTrackingSucceededCallbackId:(NSString *)eventTrackingSucceededCallbackId
+ eventTrackingFailedCallbackId:(NSString *)eventTrackingFailedCallbackId
+ sessionTrackingSucceededCallbackId:(NSString *)sessionTrackingSucceededCallbackId
+ sessionTrackingFailedCallbackId:(NSString *)sessionTrackingFailedCallbackId
+ deferredDeeplinkCallbackId:(NSString *)deferredDeeplinkCallbackId
+ skanUpdatedCallbackId:(NSString *)skanUpdatedCallbackId
+ shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink
+ withCommandDelegate:(id)adjustCordovaCommandDelegate {
dispatch_once(&onceToken, ^{
defaultInstance = [[AdjustCordovaDelegate alloc] init];
// Do the swizzling where and if needed.
- if (swizzleAttributionCallback) {
+ if (attributionCallbackId != nil &&
+ attributionCallbackId.length > 0) {
[defaultInstance swizzleCallbackMethod:@selector(adjustAttributionChanged:)
swizzledSelector:@selector(adjustAttributionChangedWannabe:)];
}
- if (swizzleEventSucceededCallback) {
+ if (eventTrackingSucceededCallbackId != nil &&
+ eventTrackingSucceededCallbackId.length > 0) {
[defaultInstance swizzleCallbackMethod:@selector(adjustEventTrackingSucceeded:)
swizzledSelector:@selector(adjustEventTrackingSucceededWannabe:)];
}
- if (swizzleEventFailedCallback) {
+ if (eventTrackingFailedCallbackId != nil &&
+ eventTrackingFailedCallbackId.length > 0) {
[defaultInstance swizzleCallbackMethod:@selector(adjustEventTrackingFailed:)
swizzledSelector:@selector(adjustEventTrackingFailedWannabe:)];
}
- if (swizzleSessionSucceededCallback) {
+ if (sessionTrackingSucceededCallbackId != nil &&
+ sessionTrackingSucceededCallbackId.length > 0) {
[defaultInstance swizzleCallbackMethod:@selector(adjustSessionTrackingSucceeded:)
swizzledSelector:@selector(adjustSessionTrackingSucceededWannabe:)];
}
- if (swizzleSessionFailedCallback) {
+ if (sessionTrackingFailedCallbackId != nil &&
+ sessionTrackingFailedCallbackId.length > 0) {
[defaultInstance swizzleCallbackMethod:@selector(adjustSessionTrackingFailed:)
swizzledSelector:@selector(adjustSessionTrackingFailedWananbe:)];
}
- if (swizzleDeferredDeeplinkCallback) {
- [defaultInstance swizzleCallbackMethod:@selector(adjustDeeplinkResponse:)
- swizzledSelector:@selector(adjustDeeplinkResponseWannabe:)];
+ if (deferredDeeplinkCallbackId != nil &&
+ deferredDeeplinkCallbackId.length > 0) {
+ [defaultInstance swizzleCallbackMethod:@selector(adjustDeferredDeeplinkReceived:)
+ swizzledSelector:@selector(adjustDeferredDeeplinkReceivedWannabe:)];
}
- if (swizzleConversionValueUpdatedCallback) {
- [defaultInstance swizzleCallbackMethod:@selector(adjustConversionValueUpdated:)
- swizzledSelector:@selector(adjustConversionValueUpdatedWannabe:)];
- }
- if (swizzleSkad4ConversionValueUpdatedCallback) {
- [defaultInstance swizzleCallbackMethod:@selector(adjustConversionValueUpdated:coarseValue:lockWindow:)
- swizzledSelector:@selector(adjustConversionValueUpdatedWannabe:coarseValue:lockWindow:)];
+ if (skanUpdatedCallbackId != nil &&
+ skanUpdatedCallbackId.length > 0) {
+ [defaultInstance swizzleCallbackMethod:@selector(adjustSkanUpdatedWithConversionData:)
+ swizzledSelector:@selector(adjustSkanUpdatedWithConversionDataWannabe:)];
}
[defaultInstance setAttributionCallbackId:attributionCallbackId];
- [defaultInstance setEventSucceededCallbackId:eventSucceededCallbackId];
- [defaultInstance setEventFailedCallbackId:eventFailedCallbackId];
- [defaultInstance setSessionSucceededCallbackId:sessionSucceededCallbackId];
- [defaultInstance setSessionFailedCallbackId:sessionFailedCallbackId];
+ [defaultInstance setEventTrackingSucceededCallbackId:eventTrackingSucceededCallbackId];
+ [defaultInstance setEventTrackingFailedCallbackId:eventTrackingFailedCallbackId];
+ [defaultInstance setSessionTrackingSucceededCallbackId:sessionTrackingSucceededCallbackId];
+ [defaultInstance setSessionTrackingFailedCallbackId:sessionTrackingFailedCallbackId];
[defaultInstance setDeferredDeeplinkCallbackId:deferredDeeplinkCallbackId];
- [defaultInstance setConversionValueUpdatedCallbackId:conversionValueUpdatedCallbackId];
- [defaultInstance setSkad4ConversionValueUpdatedCallbackId:skad4ConversionValueUpdatedCallbackId];
+ [defaultInstance setSkanUpdatedCallbackId:skanUpdatedCallbackId];
[defaultInstance setShouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink];
[defaultInstance setAdjustCordovaCommandDelegate:adjustCordovaCommandDelegate];
});
@@ -117,7 +110,6 @@ - (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
[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 addValueOrEmpty:attribution.costAmount withKey:@"costAmount" toDictionary:dictionary];
[self addValueOrEmpty:attribution.costCurrency withKey:@"costCurrency" toDictionary:dictionary];
@@ -134,17 +126,21 @@ - (void)adjustEventTrackingSucceededWannabe:(ADJEventSuccess *)eventSuccessRespo
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[self addValueOrEmpty:eventSuccessResponseData.message withKey:@"message" toDictionary:dictionary];
- [self addValueOrEmpty:eventSuccessResponseData.timeStamp withKey:@"timestamp" toDictionary:dictionary];
+ [self addValueOrEmpty:eventSuccessResponseData.timestamp withKey:@"timestamp" toDictionary:dictionary];
[self addValueOrEmpty:eventSuccessResponseData.adid withKey:@"adid" toDictionary:dictionary];
[self addValueOrEmpty:eventSuccessResponseData.eventToken withKey:@"eventToken" toDictionary:dictionary];
[self addValueOrEmpty:eventSuccessResponseData.callbackId withKey:@"callbackId" toDictionary:dictionary];
if (eventSuccessResponseData.jsonResponse != nil) {
- [dictionary setObject:eventSuccessResponseData.jsonResponse forKey:@"jsonResponse"];
+ NSData *dataJsonResponse = [NSJSONSerialization dataWithJSONObject:eventSuccessResponseData.jsonResponse options:0 error:nil];
+ NSString *stringJsonResponse = [[NSString alloc] initWithBytes:[dataJsonResponse bytes]
+ length:[dataJsonResponse length]
+ encoding:NSUTF8StringEncoding];
+ [dictionary setObject:stringJsonResponse forKey:@"jsonResponse"];
}
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
pluginResult.keepCallback = [NSNumber numberWithBool:YES];
- [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_eventSucceededCallbackId];
+ [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_eventTrackingSucceededCallbackId];
}
- (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponseData {
@@ -154,18 +150,22 @@ - (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponse
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[self addValueOrEmpty:eventFailureResponseData.message withKey:@"message" toDictionary:dictionary];
- [self addValueOrEmpty:eventFailureResponseData.timeStamp withKey:@"timestamp" toDictionary:dictionary];
+ [self addValueOrEmpty:eventFailureResponseData.timestamp withKey:@"timestamp" toDictionary:dictionary];
[self addValueOrEmpty:eventFailureResponseData.adid withKey:@"adid" toDictionary:dictionary];
[self addValueOrEmpty:eventFailureResponseData.eventToken withKey:@"eventToken" toDictionary:dictionary];
[self addValueOrEmpty:eventFailureResponseData.callbackId withKey:@"callbackId" toDictionary:dictionary];
[dictionary setObject:(eventFailureResponseData.willRetry ? @"true" : @"false") forKey:@"willRetry"];
if (eventFailureResponseData.jsonResponse != nil) {
- [dictionary setObject:eventFailureResponseData.jsonResponse forKey:@"jsonResponse"];
+ NSData *dataJsonResponse = [NSJSONSerialization dataWithJSONObject:eventFailureResponseData.jsonResponse options:0 error:nil];
+ NSString *stringJsonResponse = [[NSString alloc] initWithBytes:[dataJsonResponse bytes]
+ length:[dataJsonResponse length]
+ encoding:NSUTF8StringEncoding];
+ [dictionary setObject:stringJsonResponse forKey:@"jsonResponse"];
}
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
pluginResult.keepCallback = [NSNumber numberWithBool:YES];
- [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_eventFailedCallbackId];
+ [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_eventTrackingFailedCallbackId];
}
- (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSuccessResponseData {
@@ -175,15 +175,19 @@ - (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSucces
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[self addValueOrEmpty:sessionSuccessResponseData.message withKey:@"message" toDictionary:dictionary];
- [self addValueOrEmpty:sessionSuccessResponseData.timeStamp withKey:@"timestamp" toDictionary:dictionary];
+ [self addValueOrEmpty:sessionSuccessResponseData.timestamp withKey:@"timestamp" toDictionary:dictionary];
[self addValueOrEmpty:sessionSuccessResponseData.adid withKey:@"adid" toDictionary:dictionary];
if (sessionSuccessResponseData.jsonResponse != nil) {
- [dictionary setObject:sessionSuccessResponseData.jsonResponse forKey:@"jsonResponse"];
+ NSData *dataJsonResponse = [NSJSONSerialization dataWithJSONObject:sessionSuccessResponseData.jsonResponse options:0 error:nil];
+ NSString *stringJsonResponse = [[NSString alloc] initWithBytes:[dataJsonResponse bytes]
+ length:[dataJsonResponse length]
+ encoding:NSUTF8StringEncoding];
+ [dictionary setObject:stringJsonResponse forKey:@"jsonResponse"];
}
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
pluginResult.keepCallback = [NSNumber numberWithBool:YES];
- [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_sessionSucceededCallbackId];
+ [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_sessionTrackingSucceededCallbackId];
}
- (void)adjustSessionTrackingFailedWananbe:(ADJSessionFailure *)sessionFailureResponseData {
@@ -193,19 +197,23 @@ - (void)adjustSessionTrackingFailedWananbe:(ADJSessionFailure *)sessionFailureRe
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[self addValueOrEmpty:sessionFailureResponseData.message withKey:@"message" toDictionary:dictionary];
- [self addValueOrEmpty:sessionFailureResponseData.timeStamp withKey:@"timestamp" toDictionary:dictionary];
+ [self addValueOrEmpty:sessionFailureResponseData.timestamp withKey:@"timestamp" toDictionary:dictionary];
[self addValueOrEmpty:sessionFailureResponseData.adid withKey:@"adid" toDictionary:dictionary];
[dictionary setObject:(sessionFailureResponseData.willRetry ? @"true" : @"false") forKey:@"willRetry"];
if (sessionFailureResponseData.jsonResponse != nil) {
- [dictionary setObject:sessionFailureResponseData.jsonResponse forKey:@"jsonResponse"];
+ NSData *dataJsonResponse = [NSJSONSerialization dataWithJSONObject:sessionFailureResponseData.jsonResponse options:0 error:nil];
+ NSString *stringJsonResponse = [[NSString alloc] initWithBytes:[dataJsonResponse bytes]
+ length:[dataJsonResponse length]
+ encoding:NSUTF8StringEncoding];
+ [dictionary setObject:stringJsonResponse forKey:@"jsonResponse"];
}
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
pluginResult.keepCallback = [NSNumber numberWithBool:YES];
- [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_sessionFailedCallbackId];
+ [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_sessionTrackingFailedCallbackId];
}
-- (BOOL)adjustDeeplinkResponseWannabe:(NSURL *)deeplink {
+- (BOOL)adjustDeferredDeeplinkReceivedWannabe:(NSURL *)deeplink {
NSString *path = [deeplink absoluteString];
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:path];
pluginResult.keepCallback = [NSNumber numberWithBool:YES];
@@ -214,24 +222,15 @@ - (BOOL)adjustDeeplinkResponseWannabe:(NSURL *)deeplink {
return _shouldLaunchDeferredDeeplink;
}
-- (void)adjustConversionValueUpdatedWannabe:(NSNumber *)conversionValue {
- int intConversionValue = [conversionValue intValue];
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:intConversionValue];
- pluginResult.keepCallback = [NSNumber numberWithBool:YES];
- [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_conversionValueUpdatedCallbackId];
-}
-
-- (void)adjustConversionValueUpdatedWannabe:(nullable NSNumber *)fineValue
- coarseValue:(nullable NSString *)coarseValue
- lockWindow:(nullable NSNumber *)lockWindow {
+- (void)adjustSkanUpdatedWithConversionDataWannabe:(nonnull NSDictionary *)data {
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
- [self addValueOrEmpty:[fineValue stringValue] withKey:@"fineValue" toDictionary:dictionary];
- [self addValueOrEmpty:coarseValue withKey:@"coarseValue" toDictionary:dictionary];
- [self addValueOrEmpty:[lockWindow stringValue] withKey:@"lockWindow" toDictionary:dictionary];
-
+ [self addValueOrEmpty:data[@"conversion_value"] withKey:@"conversionValue" toDictionary:dictionary];
+ [self addValueOrEmpty:data[@"coarse_value"] withKey:@"coarseValue" toDictionary:dictionary];
+ [self addValueOrEmpty:data[@"lock_window"] withKey:@"lockWindow" toDictionary:dictionary];
+ [self addValueOrEmpty:data[@"error"] withKey:@"error" toDictionary:dictionary];
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dictionary];
pluginResult.keepCallback = [NSNumber numberWithBool:YES];
- [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_skad4ConversionValueUpdatedCallbackId];
+ [_adjustCordovaCommandDelegate sendPluginResult:pluginResult callbackId:_skanUpdatedCallbackId];
}
- (void)swizzleCallbackMethod:(SEL)originalSelector
diff --git a/test/app/package-lock.json b/test/app/package-lock.json
index 65ff84a6..010cb3df 100644
--- a/test/app/package-lock.json
+++ b/test/app/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "com.adjust.examples",
- "version": "4.38.1",
+ "version": "5.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "com.adjust.examples",
- "version": "4.38.1",
+ "version": "5.0.0",
"dependencies": {
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-customurlscheme": "^4.3.0",
@@ -18,14 +18,14 @@
"devDependencies": {
"com.adjust.sdk": "file:../../temp_plugin",
"com.adjust.test": "file:../plugin",
- "cordova-android": "^12.0.1",
- "cordova-ios": "^7.1.0",
+ "cordova-android": "^13.0.0",
+ "cordova-ios": "^7.1.1",
"cordova-plugin-whitelist": "^1.3.5"
}
},
"../../temp_plugin": {
"name": "com.adjust.sdk",
- "version": "4.38.1",
+ "version": "5.0.0",
"dev": true,
"engines": [
{
@@ -45,7 +45,7 @@
},
"../plugin": {
"name": "com.adjust.test",
- "version": "4.38.1",
+ "version": "5.0.0",
"dev": true,
"engines": [
{
@@ -479,9 +479,9 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"node_modules/android-versions": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.9.0.tgz",
- "integrity": "sha512-13O2B6PQMEM4ej9n13ePRQeckrCoKbZrvuzlLvK+9s2QmncpHDbYzZxhgapN32sJNoifN6VAHexLnd/6CYrs7Q==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-2.0.0.tgz",
+ "integrity": "sha512-07fhKL8EjV+ORQggGHcKmhLECwxBlRFimfvsjhfUCYqNDAbcH4qaEaN0AO3DnWtgHqRNfWAxhnWOpx+ZpRMymw==",
"dev": true,
"dependencies": {
"semver": "^7.5.2"
@@ -664,24 +664,24 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"node_modules/cordova-android": {
- "version": "12.0.1",
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-12.0.1.tgz",
- "integrity": "sha512-6fXWoYb/X5AJlluhBg5RvOaX6iRxsvNH7yEOiXzUmLIflf5Ho7LtYCSKZaWMHh3f5cJe/sPCBKmFFBS+EWepVg==",
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-13.0.0.tgz",
+ "integrity": "sha512-uQG+cSyrB1NMi2aIzihldIupHB9WGpZVvrMMMAAtnyc6tDlEk7gweSSaFsEONyGAnteRYpIvrzg/YwDW08PcUg==",
"dev": true,
"dependencies": {
- "android-versions": "^1.8.1",
+ "android-versions": "^2.0.0",
"cordova-common": "^5.0.0",
- "dedent": "^1.0.1",
+ "dedent": "^1.5.3",
"execa": "^5.1.1",
- "fast-glob": "^3.2.12",
- "fs-extra": "^11.1.1",
+ "fast-glob": "^3.3.2",
+ "fs-extra": "^11.2.0",
"is-path-inside": "^3.0.3",
- "nopt": "^7.1.0",
- "properties-parser": "^0.3.1",
- "semver": "^7.3.8",
+ "nopt": "^7.2.1",
+ "properties-parser": "^0.6.0",
+ "semver": "^7.6.2",
"string-argv": "^0.3.1",
"untildify": "^4.0.0",
- "which": "^3.0.0"
+ "which": "^4.0.0"
},
"engines": {
"node": ">=16.13.0"
@@ -710,10 +710,19 @@
}
}
},
+ "node_modules/cordova-android/node_modules/isexe": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
+ "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=16"
+ }
+ },
"node_modules/cordova-android/node_modules/nopt": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz",
- "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==",
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
+ "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
"dev": true,
"dependencies": {
"abbrev": "^2.0.0"
@@ -726,18 +735,18 @@
}
},
"node_modules/cordova-android/node_modules/which": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
- "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
"dev": true,
"dependencies": {
- "isexe": "^2.0.0"
+ "isexe": "^3.1.1"
},
"bin": {
"node-which": "bin/which.js"
},
"engines": {
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ "node": "^16.13.0 || >=18.0.0"
}
},
"node_modules/cordova-common": {
@@ -769,9 +778,9 @@
}
},
"node_modules/cordova-ios": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.0.tgz",
- "integrity": "sha512-9/vPU+GWRdfxNIkAc9Gq6yejMIgpy59ycP8WyVJJ7HfuPSTBUQT8AS2h5ZJOeN4Y/URyEwxQCrAqSADDBVCESA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.1.tgz",
+ "integrity": "sha512-JwTyPxWcAZlbIOR5QO6TaJzkoSzfrp7jrlX01bWZ7Sxp0PYXejAJbA6J0W4u11M+atrQRNimNltZDyAlSBW2tw==",
"dev": true,
"dependencies": {
"cordova-common": "^5.0.0",
@@ -1440,17 +1449,6 @@
"integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==",
"dev": true
},
- "node_modules/lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -1672,13 +1670,10 @@
}
},
"node_modules/properties-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
- "integrity": "sha512-AkSQxQAviJ89x4FIxOyHGfO3uund0gvYo7lfD0E+Gp7gFQKrTNgtoYQklu8EhrfHVZUzTwKGZx2r/KDSfnljcA==",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.6.0.tgz",
+ "integrity": "sha512-qvr2cSmoA0dln0MARAKwBzPkkXn7FqwX+RVVNpMdMJc7rt9mqO2cXwluxtux9fHrLhjnPFaQkS8BM0kFrTCnSw==",
"dev": true,
- "dependencies": {
- "string.prototype.codepointat": "^0.2.0"
- },
"engines": {
"node": ">= 0.3.1"
}
@@ -1803,12 +1798,9 @@
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"node_modules/semver": {
- "version": "7.5.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
- "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
"bin": {
"semver": "bin/semver.js"
},
@@ -1930,12 +1922,6 @@
"node": ">=8"
}
},
- "node_modules/string.prototype.codepointat": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
- "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
- "dev": true
- },
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -2154,11 +2140,6 @@
"engines": {
"node": ">=10.0.0"
}
- },
- "node_modules/yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
},
"dependencies": {
@@ -2492,9 +2473,9 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"android-versions": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.9.0.tgz",
- "integrity": "sha512-13O2B6PQMEM4ej9n13ePRQeckrCoKbZrvuzlLvK+9s2QmncpHDbYzZxhgapN32sJNoifN6VAHexLnd/6CYrs7Q==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/android-versions/-/android-versions-2.0.0.tgz",
+ "integrity": "sha512-07fhKL8EjV+ORQggGHcKmhLECwxBlRFimfvsjhfUCYqNDAbcH4qaEaN0AO3DnWtgHqRNfWAxhnWOpx+ZpRMymw==",
"dev": true,
"requires": {
"semver": "^7.5.2"
@@ -2622,24 +2603,24 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"cordova-android": {
- "version": "12.0.1",
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-12.0.1.tgz",
- "integrity": "sha512-6fXWoYb/X5AJlluhBg5RvOaX6iRxsvNH7yEOiXzUmLIflf5Ho7LtYCSKZaWMHh3f5cJe/sPCBKmFFBS+EWepVg==",
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-13.0.0.tgz",
+ "integrity": "sha512-uQG+cSyrB1NMi2aIzihldIupHB9WGpZVvrMMMAAtnyc6tDlEk7gweSSaFsEONyGAnteRYpIvrzg/YwDW08PcUg==",
"dev": true,
"requires": {
- "android-versions": "^1.8.1",
+ "android-versions": "^2.0.0",
"cordova-common": "^5.0.0",
- "dedent": "^1.0.1",
+ "dedent": "^1.5.3",
"execa": "^5.1.1",
- "fast-glob": "^3.2.12",
- "fs-extra": "^11.1.1",
+ "fast-glob": "^3.3.2",
+ "fs-extra": "^11.2.0",
"is-path-inside": "^3.0.3",
- "nopt": "^7.1.0",
- "properties-parser": "^0.3.1",
- "semver": "^7.3.8",
+ "nopt": "^7.2.1",
+ "properties-parser": "^0.6.0",
+ "semver": "^7.6.2",
"string-argv": "^0.3.1",
"untildify": "^4.0.0",
- "which": "^3.0.0"
+ "which": "^4.0.0"
},
"dependencies": {
"abbrev": {
@@ -2655,22 +2636,28 @@
"dev": true,
"requires": {}
},
+ "isexe": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
+ "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
+ "dev": true
+ },
"nopt": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz",
- "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==",
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
+ "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
"dev": true,
"requires": {
"abbrev": "^2.0.0"
}
},
"which": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
- "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
"dev": true,
"requires": {
- "isexe": "^2.0.0"
+ "isexe": "^3.1.1"
}
}
}
@@ -2701,9 +2688,9 @@
}
},
"cordova-ios": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.0.tgz",
- "integrity": "sha512-9/vPU+GWRdfxNIkAc9Gq6yejMIgpy59ycP8WyVJJ7HfuPSTBUQT8AS2h5ZJOeN4Y/URyEwxQCrAqSADDBVCESA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.1.tgz",
+ "integrity": "sha512-JwTyPxWcAZlbIOR5QO6TaJzkoSzfrp7jrlX01bWZ7Sxp0PYXejAJbA6J0W4u11M+atrQRNimNltZDyAlSBW2tw==",
"dev": true,
"requires": {
"cordova-common": "^5.0.0",
@@ -3185,14 +3172,6 @@
"integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==",
"dev": true
},
- "lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "requires": {
- "yallist": "^4.0.0"
- }
- },
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -3357,13 +3336,10 @@
}
},
"properties-parser": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
- "integrity": "sha512-AkSQxQAviJ89x4FIxOyHGfO3uund0gvYo7lfD0E+Gp7gFQKrTNgtoYQklu8EhrfHVZUzTwKGZx2r/KDSfnljcA==",
- "dev": true,
- "requires": {
- "string.prototype.codepointat": "^0.2.0"
- }
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.6.0.tgz",
+ "integrity": "sha512-qvr2cSmoA0dln0MARAKwBzPkkXn7FqwX+RVVNpMdMJc7rt9mqO2cXwluxtux9fHrLhjnPFaQkS8BM0kFrTCnSw==",
+ "dev": true
},
"q": {
"version": "1.5.1",
@@ -3431,12 +3407,9 @@
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"semver": {
- "version": "7.5.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
- "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
- "requires": {
- "lru-cache": "^6.0.0"
- }
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A=="
},
"shebang-command": {
"version": "2.0.0",
@@ -3527,12 +3500,6 @@
"strip-ansi": "^6.0.1"
}
},
- "string.prototype.codepointat": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
- "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
- "dev": true
- },
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -3686,11 +3653,6 @@
"version": "git+ssh://git@github.com/xmldom/xmldom.git#c568938641cc1f121cef5b4df80fcfda1e489b6e",
"integrity": "sha512-XKfWBSJe4BGKsn67Hypmdfj4fI75a6EsptbrzXzNxKqokfDT3zItQl4xxA1rFvcDBZOBvfDR9tkqlow5xa3AIA==",
"from": "xmldom@github:xmldom/xmldom#0.7.0"
- },
- "yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
}
diff --git a/test/app/package.json b/test/app/package.json
index 961838f7..fe2d3de7 100644
--- a/test/app/package.json
+++ b/test/app/package.json
@@ -1,11 +1,11 @@
{
"name": "com.adjust.examples",
- "version": "4.38.1",
+ "version": "5.0.0",
"displayName": "AdjustTestApp",
"cordova": {
"platforms": [
- "android",
- "ios"
+ "ios",
+ "android"
],
"plugins": {
"cordova-plugin-console": {},
@@ -33,8 +33,8 @@
"devDependencies": {
"com.adjust.sdk": "file:../../temp_plugin",
"com.adjust.test": "file:../plugin",
- "cordova-android": "^12.0.1",
- "cordova-ios": "^7.1.0",
+ "cordova-android": "^13.0.0",
+ "cordova-ios": "^7.1.1",
"cordova-plugin-whitelist": "^1.3.5"
}
}
\ No newline at end of file
diff --git a/test/app/www/js/command_executor.js b/test/app/www/js/command_executor.js
index 49a18317..097824f7 100644
--- a/test/app/www/js/command_executor.js
+++ b/test/app/www/js/command_executor.js
@@ -43,15 +43,7 @@ CommandExecutor.prototype.scheduleCommand = function(className, functionName, pa
function AdjustCommandExecutor(urlOverwrite) {
this.urlOverwrite = urlOverwrite;
- this.baseUrl = urlOverwrite;
- this.gdprUrl = urlOverwrite;
- this.subscriptionUrl = urlOverwrite;
- this.purchaseVerificationUrl = urlOverwrite;
this.extraPath = null;
- this.basePath = null;
- this.gdprPath = null;
- this.subscriptionPath = null;
- this.purchaseVerificationPath = null;
this.savedEvents = {};
this.savedConfigs = {};
this.savedCommands = [];
@@ -97,32 +89,30 @@ AdjustCommandExecutor.prototype.executeCommand = function(command, idx) {
case 'config' : this.config(command.params); break;
case 'start' : this.start(command.params); break;
case 'event' : this.event(command.params); break;
- case 'trackEvent' : this.trackEvent(command.params); break;
case 'resume' : this.resume(command.params); break;
case 'pause' : this.pause(command.params); break;
case 'setEnabled' : this.setEnabled(command.params); break;
- case 'setReferrer' : this.setReferrer(command.params); break;
case 'setOfflineMode' : this.setOfflineMode(command.params); break;
- case 'sendFirstPackages' : this.sendFirstPackages(command.params); break;
- case 'addSessionCallbackParameter' : this.addSessionCallbackParameter(command.params); break;
- case 'addSessionPartnerParameter' : this.addSessionPartnerParameter(command.params); break;
- case 'removeSessionCallbackParameter' : this.removeSessionCallbackParameter(command.params); break;
- case 'removeSessionPartnerParameter' : this.removeSessionPartnerParameter(command.params); break;
- case 'resetSessionCallbackParameters' : this.resetSessionCallbackParameters(command.params); break;
- case 'resetSessionPartnerParameters' : this.resetSessionPartnerParameters(command.params); break;
+ case 'addGlobalCallbackParameter' : this.addGlobalCallbackParameter(command.params); break;
+ case 'addGlobalPartnerParameter' : this.addGlobalPartnerParameter(command.params); break;
+ case 'removeGlobalCallbackParameter' : this.removeGlobalCallbackParameter(command.params); break;
+ case 'removeGlobalPartnerParameter' : this.removeGlobalPartnerParameter(command.params); break;
+ case 'removeGlobalCallbackParameters' : this.removeGlobalCallbackParameters(command.params); break;
+ case 'removeGlobalPartnerParameters' : this.removeGlobalPartnerParameters(command.params); break;
+ case 'setReferrer' : this.setReferrer(command.params); break;
case 'setPushToken' : this.setPushToken(command.params); break;
- case 'openDeeplink' : this.openDeeplink(command.params); break;
- case 'sendReferrer' : this.sendReferrer(command.params); break;
case 'gdprForgetMe' : this.gdprForgetMe(command.params); break;
+ case 'attributionGetter' : this.attributionGetter(command.params); break;
+ case 'trackEvent' : this.trackEvent(command.params); break;
case 'trackAdRevenue' : this.trackAdRevenue(command.params); break;
- case 'disableThirdPartySharing' : this.disableThirdPartySharing(command.params); break;
- case 'trackSubscription' : this.trackSubscription(command.params); break;
+ case 'trackSubscription' : this.trackAppStoreSubscription(command.params); break;
case 'thirdPartySharing' : this.trackThirdPartySharing(command.params); break;
case 'measurementConsent' : this.trackMeasurementConsent(command.params); break;
- case 'trackAdRevenueV2' : this.trackAdRevenueV2(command.params); break;
- case 'getLastDeeplink' : this.getLastDeeplink(command.params); break;
case 'verifyPurchase' : this.verifyPurchase(command.params); break;
+ case 'verifyTrack' : this.verifyTrack(command.params); break;
+ case 'openDeeplink' : this.openDeeplink(command.params); break;
case 'processDeeplink' : this.processDeeplink(command.params); break;
+ case 'getLastDeeplink' : this.getLastDeeplink(command.params); break;
}
this.nextToSendCounter++;
@@ -138,17 +128,9 @@ AdjustCommandExecutor.prototype.executeCommand = function(command, idx) {
AdjustCommandExecutor.prototype.testOptions = function(params) {
var testOptions = new AdjustTestOptions();
- testOptions.urlOverwrite = this.urlOverwrite;
- testOptions.baseUrl = this.urlOverwrite;
- testOptions.gdprUrl = this.urlOverwrite;
- testOptions.subscriptionUrl = this.urlOverwrite;
- testOptions.purchaseVerificationUrl = this.urlOverwrite;
+ testOptions.testUrlOverwrite = this.urlOverwrite;
if ('basePath' in params) {
this.extraPath = getFirstParameterValue(params, 'basePath');
- this.basePath = getFirstParameterValue(params, 'basePath');
- this.gdprPath = getFirstParameterValue(params, 'basePath');
- this.subscriptionPath = getFirstParameterValue(params, 'basePath');
- this.purchaseVerificationPath = getFirstParameterValue(params, 'basePath');
}
if ('timerInterval' in params) {
testOptions.timerIntervalInMilliseconds = getFirstParameterValue(params, 'timerInterval').toString();
@@ -162,18 +144,29 @@ AdjustCommandExecutor.prototype.testOptions = function(params) {
if ('subsessionInterval' in params) {
testOptions.subsessionIntervalInMilliseconds = getFirstParameterValue(params, 'subsessionInterval').toString();
}
- if ('noBackoffWait' in params) {
- testOptions.noBackoffWait = getFirstParameterValue(params, 'noBackoffWait').toString() === 'true';
- }
- if ('adServicesFrameworkEnabled' in params) {
- testOptions.adServicesFrameworkEnabled = getFirstParameterValue(params, 'adServicesFrameworkEnabled').toString() === 'true';
- }
if ('attStatus' in params) {
testOptions.attStatus = getFirstParameterValue(params, 'attStatus').toString();
}
if ('idfa' in params) {
testOptions.idfa = getFirstParameterValue(params, 'idfa').toString();
}
+ if ('noBackoffWait' in params) {
+ testOptions.noBackoffWait = getFirstParameterValue(params, 'noBackoffWait').toString() === 'true';
+ }
+
+ // default value -> NO - AdServices will not be used in test app by default
+ testOptions.adServicesFrameworkEnabled = false;
+ if ('adServicesFrameworkEnabled' in params) {
+ testOptions.adServicesFrameworkEnabled = getFirstParameterValue(params, 'adServicesFrameworkEnabled').toString() === 'true';
+ }
+
+ if ('doNotIgnoreSystemLifecycleBootstrap' in params) {
+ var doNotIgnoreSystemLifecycleBootstrap = getFirstParameterValue(params, 'doNotIgnoreSystemLifecycleBootstrap').toString() === 'true';
+ if (doNotIgnoreSystemLifecycleBootstrap) {
+ testOptions.ignoreSystemLifecycleBootstrap = false;
+ }
+ }
+
var useTestConnectionOptions = false;
if ('teardown' in params) {
var teardownOptions = getValueFromKey(params, 'teardown');
@@ -182,20 +175,15 @@ AdjustCommandExecutor.prototype.testOptions = function(params) {
if ('resetSdk' === option) {
testOptions.teardown = true;
testOptions.extraPath = this.extraPath;
- testOptions.basePath = this.extraPath;
- testOptions.gdprPath = this.extraPath;
- testOptions.subscriptionPath = this.extraPath;
- testOptions.purchaseVerificationPath = this.extraPath;
- testOptions.useTestConnectionOptions = true;
useTestConnectionOptions = true;
Adjust.teardown('test');
}
if ('deleteState' === option) {
- testOptions.hasContext = true;
+ testOptions.deleteState = true;
}
if ('resetTest' === option) {
- this.savedEvents = {};
this.savedConfigs = {};
+ this.savedEvents = {};
testOptions.timerIntervalInMilliseconds = (-1).toString();
testOptions.timerStartInMilliseconds = (-1).toString();
testOptions.sessionIntervalInMilliseconds = (-1).toString();
@@ -204,16 +192,12 @@ AdjustCommandExecutor.prototype.testOptions = function(params) {
if ('sdk' === option) {
testOptions.teardown = true;
testOptions.extraPath = null;
- testOptions.basePath = null;
- testOptions.gdprPath = null;
- testOptions.subscriptionPath = null;
- testOptions.purchaseVerificationPath = null;
- testOptions.useTestConnectionOptions = false;
Adjust.teardown('test');
}
if ('test' === option) {
- this.savedEvents = null;
this.savedConfigs = null;
+ this.savedEvents = null;
+ this.extraPath = null;
testOptions.timerIntervalInMilliseconds = (-1).toString();
testOptions.timerStartInMilliseconds = (-1).toString();
testOptions.sessionIntervalInMilliseconds = (-1).toString();
@@ -286,86 +270,59 @@ AdjustCommandExecutor.prototype.config = function(params) {
adjustConfig.setDefaultTracker(defaultTracker);
}
- if ('externalDeviceId' in params) {
- var externalDeviceId = getFirstParameterValue(params, 'externalDeviceId');
- adjustConfig.setExternalDeviceId(externalDeviceId);
- }
-
- if ('appSecret' in params) {
- var appSecretArray = getValueFromKey(params, 'appSecret');
- var secretId = appSecretArray[0].toString();
- var info1 = appSecretArray[1].toString();
- var info2 = appSecretArray[2].toString();
- var info3 = appSecretArray[3].toString();
- var info4 = appSecretArray[4].toString();
- adjustConfig.setAppSecret(secretId, info1, info2, info3, info4);
- }
-
- if ('delayStart' in params) {
- var delayStartS = getFirstParameterValue(params, 'delayStart');
- var delayStart = parseFloat(delayStartS);
- adjustConfig.setDelayStart(delayStart);
- }
-
- if ('deviceKnown' in params) {
- var deviceKnownS = getFirstParameterValue(params, 'deviceKnown');
- var deviceKnown = deviceKnownS == 'true';
- adjustConfig.setDeviceKnown(deviceKnown);
- }
-
- if ('eventBufferingEnabled' in params) {
- var eventBufferingEnabledS = getFirstParameterValue(params, 'eventBufferingEnabled');
- var eventBufferingEnabled = eventBufferingEnabledS == 'true';
- adjustConfig.setEventBufferingEnabled(eventBufferingEnabled);
+ if ('needsCost' in params) {
+ var defaultTracker = getFirstParameterValue(params, 'needsCost');
+ adjustConfig.enableCostDataInAttribution();
}
if ('sendInBackground' in params) {
var sendInBackgroundS = getFirstParameterValue(params, 'sendInBackground');
- var sendInBackground = sendInBackgroundS == 'true';
- adjustConfig.setSendInBackground(sendInBackground);
+ if (sendInBackgroundS == 'true') {
+ adjustConfig.enableSendingInBackground();
+ }
}
- if ('userAgent' in params) {
- var userAgent = getFirstParameterValue(params, 'userAgent');
- adjustConfig.setUserAgent(userAgent);
+ if ('allowIdfaReading' in params) {
+ var allowIdfaReadingS = getFirstParameterValue(params, 'allowIdfaReading');
+ if (allowIdfaReadingS != 'true') {
+ adjustConfig.disableIdfaReading();
+ }
}
if ('allowAdServicesInfoReading' in params) {
var allowAdServicesInfoReadingS = getFirstParameterValue(params, 'allowAdServicesInfoReading');
- var allowAdServicesInfoReading = allowAdServicesInfoReadingS == 'true';
- adjustConfig.setAllowAdServicesInfoReading(allowAdServicesInfoReading);
+ if (allowAdServicesInfoReadingS != 'true') {
+ adjustConfig.disableAdServices();
}
-
- if ('allowIdfaReading' in params) {
- var allowIdfaReadingS = getFirstParameterValue(params, 'allowIdfaReading');
- var allowIdfaReading = allowIdfaReadingS == 'true';
- adjustConfig.setAllowIdfaReading(allowIdfaReading);
}
if ('allowSkAdNetworkHandling' in params) {
var allowSkAdNetworkHandlingS = getFirstParameterValue(params, 'allowSkAdNetworkHandling');
- var allowSkAdNetworkHandling = allowSkAdNetworkHandlingS == 'true';
- if (allowSkAdNetworkHandling == false) {
- adjustConfig.deactivateSKAdNetworkHandling();
+ if (allowSkAdNetworkHandlingS != 'true') {
+ adjustConfig.disableSkanAttribution();
}
}
+ if ('externalDeviceId' in params) {
+ var externalDeviceId = getFirstParameterValue(params, 'externalDeviceId');
+ adjustConfig.setExternalDeviceId(externalDeviceId);
+ }
+
if ('attributionCallbackSendAll' in params) {
var _this = this;
- adjustConfig.setAttributionCallbackListener(function(attribution) {
- AdjustTest.addInfoToSend('trackerToken', attribution.trackerToken);
- AdjustTest.addInfoToSend('trackerName', attribution.trackerName);
+ adjustConfig.setAttributionCallback(function(attribution) {
+ AdjustTest.addInfoToSend('tracker_token', attribution.trackerToken);
+ AdjustTest.addInfoToSend('tracker_name', attribution.trackerName);
AdjustTest.addInfoToSend('network', attribution.network);
AdjustTest.addInfoToSend('campaign', attribution.campaign);
AdjustTest.addInfoToSend('adgroup', attribution.adgroup);
AdjustTest.addInfoToSend('creative', attribution.creative);
- AdjustTest.addInfoToSend('clickLabel', attribution.clickLabel);
- AdjustTest.addInfoToSend('adid', attribution.adid);
- AdjustTest.addInfoToSend('costType', attribution.costType);
- AdjustTest.addInfoToSend('costAmount', attribution.costAmount);
- AdjustTest.addInfoToSend('costCurrency', attribution.costCurrency);
+ AdjustTest.addInfoToSend('click_label', attribution.clickLabel);
+ AdjustTest.addInfoToSend('cost_type', attribution.costType);
+ AdjustTest.addInfoToSend('cost_amount', attribution.costAmount);
+ AdjustTest.addInfoToSend('cost_currency', attribution.costCurrency);
if (device.platform === 'Android') {
- AdjustTest.addInfoToSend('fbInstallReferrer', attribution.fbInstallReferrer);
+ AdjustTest.addInfoToSend('fb_install_referrer', attribution.fbInstallReferrer);
}
AdjustTest.sendInfoToServer(_this.extraPath);
});
@@ -373,50 +330,50 @@ AdjustCommandExecutor.prototype.config = function(params) {
if ('sessionCallbackSendSuccess' in params) {
var _this = this;
- adjustConfig.setSessionTrackingSucceededCallbackListener(function(sessionSuccess) {
+ adjustConfig.setSessionTrackingSucceededCallback(function(sessionSuccess) {
AdjustTest.addInfoToSend('message', sessionSuccess.message);
AdjustTest.addInfoToSend('timestamp', sessionSuccess.timestamp);
AdjustTest.addInfoToSend('adid', sessionSuccess.adid);
- addJsonResponseInfo(sessionSuccess);
+ AdjustTest.addInfoToSend('jsonResponse', sessionSuccess.jsonResponse);
AdjustTest.sendInfoToServer(_this.extraPath);
});
}
if ('sessionCallbackSendFailure' in params) {
var _this = this;
- adjustConfig.setSessionTrackingFailedCallbackListener(function(sessionFailed) {
+ adjustConfig.setSessionTrackingFailedCallback(function(sessionFailed) {
AdjustTest.addInfoToSend('message', sessionFailed.message);
AdjustTest.addInfoToSend('timestamp', sessionFailed.timestamp);
AdjustTest.addInfoToSend('adid', sessionFailed.adid);
AdjustTest.addInfoToSend('willRetry', sessionFailed.willRetry);
- addJsonResponseInfo(sessionFailed);
+ AdjustTest.addInfoToSend('jsonResponse', sessionFailed.jsonResponse);
AdjustTest.sendInfoToServer(_this.extraPath);
});
}
if ('eventCallbackSendSuccess' in params) {
var _this = this;
- adjustConfig.setEventTrackingSucceededCallbackListener(function(eventSuccess) {
+ adjustConfig.setEventTrackingSucceededCallback(function(eventSuccess) {
AdjustTest.addInfoToSend('message', eventSuccess.message);
AdjustTest.addInfoToSend('timestamp', eventSuccess.timestamp);
AdjustTest.addInfoToSend('adid', eventSuccess.adid);
AdjustTest.addInfoToSend('eventToken', eventSuccess.eventToken);
AdjustTest.addInfoToSend('callbackId', eventSuccess.callbackId);
- addJsonResponseInfo(eventSuccess);
+ AdjustTest.addInfoToSend('jsonResponse', eventSuccess.jsonResponse);
AdjustTest.sendInfoToServer(_this.extraPath);
});
}
if ('eventCallbackSendFailure' in params) {
var _this = this;
- adjustConfig.setEventTrackingFailedCallbackListener(function(eventFailed) {
+ adjustConfig.setEventTrackingFailedCallback(function(eventFailed) {
AdjustTest.addInfoToSend('message', eventFailed.message);
AdjustTest.addInfoToSend('timestamp', eventFailed.timestamp);
AdjustTest.addInfoToSend('adid', eventFailed.adid);
AdjustTest.addInfoToSend('eventToken', eventFailed.eventToken);
AdjustTest.addInfoToSend('callbackId', eventFailed.callbackId);
AdjustTest.addInfoToSend('willRetry', eventFailed.willRetry);
- addJsonResponseInfo(eventFailed);
+ AdjustTest.addInfoToSend('jsonResponse', eventFailed.jsonResponse);
AdjustTest.sendInfoToServer(_this.extraPath);
});
}
@@ -426,35 +383,57 @@ AdjustCommandExecutor.prototype.config = function(params) {
var launchDeferredDeeplinkS = getFirstParameterValue(params, 'deferredDeeplinkCallback');
var launchDeferredDeeplink = launchDeferredDeeplinkS === 'true';
console.log(`[*] Launch deferred deeplink set to: ${launchDeferredDeeplink}`);
- adjustConfig.setShouldLaunchDeeplink(launchDeferredDeeplink);
- adjustConfig.setDeferredDeeplinkCallbackListener(function(uri) {
+ if (launchDeferredDeeplink == false) {
+ adjustConfig.disableDeferredDeeplinkOpening();
+ }
+ adjustConfig.setDeferredDeeplinkCallback(function(uri) {
AdjustTest.addInfoToSend('deeplink', uri);
AdjustTest.sendInfoToServer(_this.extraPath);
});
}
+ if ('skanCallback' in params) {
+ var _this = this;
+ adjustConfig.setSkanUpdatedCallback(function(data) {
+ var jsonObject = JSON.parse(JSON.stringify(data));
+ for (let [key, value] of Object.entries(jsonObject)) {
+ if (key === 'conversionValue') {
+ AdjustTest.addInfoToSend('conversion_value', value);
+ }
+ if (key === 'coarseValue') {
+ AdjustTest.addInfoToSend('coarse_value', value);
+ }
+ if (key === 'lockWindow') {
+ AdjustTest.addInfoToSend('lock_window', value);
+ }
+ }
+ AdjustTest.sendInfoToServer(_this.extraPath);
+ });
+ }
+
+ if ('attConsentWaitingSeconds' in params) {
+ var attConsentWaitingSecondsS = getFirstParameterValue(params, 'attConsentWaitingSeconds');
+ var attConsentWaitingSeconds = parseFloat(attConsentWaitingSecondsS);
+ adjustConfig.setAttConsentWaitingInterval(attConsentWaitingSeconds);
+ }
+
+ if ('eventDeduplicationIdsMaxSize' in params) {
+ var eventDeduplicationIdsMaxSizeS = getFirstParameterValue(params, 'eventDeduplicationIdsMaxSize');
+ var eventDeduplicationIdsMaxSize = parseInt(eventDeduplicationIdsMaxSizeS);
+ adjustConfig.setEventDeduplicationIdsMaxSize(eventDeduplicationIdsMaxSize);
+ }
+
if ('coppaCompliant' in params) {
var coppaCompliantEnabledS = getFirstParameterValue(params, 'coppaCompliant');
- var coppaCompliantEnabled = coppaCompliantEnabledS == 'true';
- adjustConfig.setCoppaCompliantEnabled(coppaCompliantEnabled);
+ if (coppaCompliantEnabledS == 'true') {
+ adjustConfig.enableCoppaCompliance();
+ }
}
if ('playStoreKids' in params) {
var playStoreKidsEnabledS = getFirstParameterValue(params, 'playStoreKids');
var playStoreKidsEnabled = playStoreKidsEnabledS == 'true';
- adjustConfig.setPlayStoreKidsAppEnabled(playStoreKidsEnabled);
- }
-
- if ('finalAttributionEnabled' in params) {
- var finalAttributionEnabledS = getFirstParameterValue(params, 'finalAttributionEnabled');
- var finalAttributionEnabled = finalAttributionEnabledS == 'true';
- adjustConfig.setFinalAndroidAttributionEnabled(finalAttributionEnabled);
- }
-
- if ('attConsentWaitingSeconds' in params) {
- var attConsentWaitingSecondsS = getFirstParameterValue(params, 'attConsentWaitingSeconds');
- var attConsentWaitingSeconds = parseFloat(attConsentWaitingSecondsS);
- adjustConfig.setAttConsentWaitingInterval(attConsentWaitingSeconds);
+ adjustConfig.enablePlayStoreKidsCompliance();
}
};
@@ -467,7 +446,7 @@ AdjustCommandExecutor.prototype.start = function(params) {
}
var adjustConfig = this.savedConfigs[configNumber];
- Adjust.create(adjustConfig);
+ Adjust.initSdk(adjustConfig);
delete this.savedConfigs[0];
};
@@ -538,15 +517,15 @@ AdjustCommandExecutor.prototype.event = function(params) {
adjustEvent.setPurchaseToken(purchaseToken);
}
- if ('receipt' in params) {
- var receipt = getFirstParameterValue(params, 'receipt');
- adjustEvent.setReceipt(receipt);
- }
-
if ('transactionId' in params) {
var transactionId = getFirstParameterValue(params, 'transactionId');
adjustEvent.setTransactionId(transactionId);
}
+
+ if ('deduplicationId' in params) {
+ var deduplicationId = getFirstParameterValue(params, 'deduplicationId');
+ adjustEvent.setDeduplicationId(deduplicationId);
+ }
};
AdjustCommandExecutor.prototype.trackEvent = function(params) {
@@ -563,11 +542,6 @@ AdjustCommandExecutor.prototype.trackEvent = function(params) {
delete this.savedEvents[0];
};
-AdjustCommandExecutor.prototype.setReferrer = function(params) {
- var referrer = getFirstParameterValue(params, 'referrer');
- Adjust.setReferrer(referrer);
-};
-
AdjustCommandExecutor.prototype.pause = function(params) {
Adjust.onPause('test');
};
@@ -577,69 +551,63 @@ AdjustCommandExecutor.prototype.resume = function(params) {
};
AdjustCommandExecutor.prototype.setEnabled = function(params) {
- var enabled = getFirstParameterValue(params, 'enabled') == 'true';
- Adjust.setEnabled(enabled);
+ if (getFirstParameterValue(params, 'enabled') == 'true') {
+ Adjust.enable();
+ } else {
+ Adjust.disable();
+ }
};
AdjustCommandExecutor.prototype.setOfflineMode = function(params) {
- var enabled = getFirstParameterValue(params, 'enabled') == 'true';
- Adjust.setOfflineMode(enabled);
-};
-
-AdjustCommandExecutor.prototype.sendFirstPackages = function(params) {
- Adjust.sendFirstPackages();
-};
-
-AdjustCommandExecutor.prototype.gdprForgetMe = function(params) {
- Adjust.gdprForgetMe();
-};
-
-AdjustCommandExecutor.prototype.disableThirdPartySharing = function(params) {
- Adjust.disableThirdPartySharing();
+ if (getFirstParameterValue(params, 'enabled') == 'true') {
+ Adjust.switchToOfflineMode();
+ } else {
+ Adjust.switchBackToOnlineMode();
+ }
};
-AdjustCommandExecutor.prototype.addSessionCallbackParameter = function(params) {
+AdjustCommandExecutor.prototype.addGlobalCallbackParameter = function(params) {
var list = getValueFromKey(params, 'KeyValue');
for (var i = 0; i < list.length; i += 2) {
var key = list[i];
var value = list[i+1];
- Adjust.addSessionCallbackParameter(key, value);
+ Adjust.addGlobalCallbackParameter(key, value);
}
};
-AdjustCommandExecutor.prototype.addSessionPartnerParameter = function(params) {
+AdjustCommandExecutor.prototype.addGlobalPartnerParameter = function(params) {
var list = getValueFromKey(params, 'KeyValue');
for (var i = 0; i < list.length; i += 2) {
var key = list[i];
var value = list[i+1];
- Adjust.addSessionPartnerParameter(key, value);
+ Adjust.addGlobalPartnerParameter(key, value);
}
};
-AdjustCommandExecutor.prototype.removeSessionCallbackParameter = function(params) {
+AdjustCommandExecutor.prototype.removeGlobalCallbackParameter = function(params) {
if ('key' in params) {
var list = getValueFromKey(params, 'key');
for (var i = 0; i < list.length; i += 1) {
- Adjust.removeSessionCallbackParameter(list[i]);
+ Adjust.removeGlobalCallbackParameter(list[i]);
}
}
};
-AdjustCommandExecutor.prototype.removeSessionPartnerParameter = function(params) {
+AdjustCommandExecutor.prototype.removeGlobalPartnerParameter = function(params) {
if ('key' in params) {
var list = getValueFromKey(params, 'key');
for (var i = 0; i < list.length; i += 1) {
- Adjust.removeSessionPartnerParameter(list[i]);
+ Adjust.removeGlobalPartnerParameter(list[i]);
}
}
};
-AdjustCommandExecutor.prototype.resetSessionCallbackParameters = function(params) {
- Adjust.resetSessionCallbackParameters();
+AdjustCommandExecutor.prototype.removeGlobalCallbackParameters = function(params) {
+ Adjust.removeGlobalCallbackParameters();
};
-AdjustCommandExecutor.prototype.resetSessionPartnerParameters = function(params) {
- Adjust.resetSessionPartnerParameters();
+AdjustCommandExecutor.prototype.removeGlobalPartnerParameters = function(params) {
+ Adjust.removeGlobalPartnerParameters();
};
AdjustCommandExecutor.prototype.setPushToken = function(params) {
@@ -649,30 +617,61 @@ AdjustCommandExecutor.prototype.setPushToken = function(params) {
AdjustCommandExecutor.prototype.openDeeplink = function(params) {
var deeplink = getFirstParameterValue(params, 'deeplink');
- Adjust.appWillOpenUrl(deeplink);
+ if (typeof deeplink !== 'string') {
+ return;
+ }
+ var adjustDeeplink = new AdjustDeeplink(deeplink);
+ Adjust.processDeeplink(adjustDeeplink);
};
-AdjustCommandExecutor.prototype.sendReferrer = function(params) {
- var referrer = getFirstParameterValue(params, 'referrer');
- Adjust.setReferrer(referrer);
+AdjustCommandExecutor.prototype.gdprForgetMe = function(params) {
+ Adjust.gdprForgetMe();
};
-AdjustCommandExecutor.prototype.trackAdRevenue = function(params) {
- var source = getFirstParameterValue(params, 'adRevenueSource');
- var payload = getFirstParameterValue(params, 'adRevenueJsonString');
- Adjust.trackAdRevenue(source, payload);
+AdjustCommandExecutor.prototype.trackThirdPartySharing = function(params) {
+ var isEnabled = null;
+ if ('isEnabled' in params) {
+ isEnabled = getFirstParameterValue(params, 'isEnabled') == 'true';
+ }
+ var adjustThirdPartySharing = new AdjustThirdPartySharing(isEnabled);
+
+ if ('granularOptions' in params) {
+ var granularOptions = getValueFromKey(params, 'granularOptions');
+ for (var i = 0; i < granularOptions.length; i += 3) {
+ var partnerName = granularOptions[i];
+ var key = granularOptions[i+1];
+ var value = granularOptions[i+2];
+ adjustThirdPartySharing.addGranularOption(partnerName, key, value);
+ }
+ }
+
+ if ('partnerSharingSettings' in params) {
+ var partnerSharingSettings = getValueFromKey(params, 'partnerSharingSettings');
+ for (var i = 0; i < partnerSharingSettings.length; i += 3) {
+ var partnerName = partnerSharingSettings[i];
+ var key = partnerSharingSettings[i+1];
+ var value = partnerSharingSettings[i+2] === 'true';
+ adjustThirdPartySharing.addPartnerSharingSetting(partnerName, key, value);
+ }
+ }
+
+ Adjust.trackThirdPartySharing(adjustThirdPartySharing);
+};
+
+AdjustCommandExecutor.prototype.trackMeasurementConsent = function(params) {
+ var isEnabled = getFirstParameterValue(params, 'isEnabled') == 'true';
+ Adjust.trackMeasurementConsent(isEnabled);
};
-AdjustCommandExecutor.prototype.trackSubscription = function(params) {
+AdjustCommandExecutor.prototype.trackAppStoreSubscription = function(params) {
if (device.platform === 'iOS') {
var price = getFirstParameterValue(params, 'revenue');
var currency = getFirstParameterValue(params, 'currency');
var transactionId = getFirstParameterValue(params, 'transactionId');
- var receipt = getFirstParameterValue(params, 'receipt');
var transactionDate = getFirstParameterValue(params, 'transactionDate');
var salesRegion = getFirstParameterValue(params, 'salesRegion');
- var subscription = new AdjustAppStoreSubscription(price, currency, transactionId, receipt);
+ var subscription = new AdjustAppStoreSubscription(price, currency, transactionId);
subscription.setTransactionDate(transactionDate);
subscription.setSalesRegion(salesRegion);
@@ -695,6 +694,7 @@ AdjustCommandExecutor.prototype.trackSubscription = function(params) {
}
Adjust.trackAppStoreSubscription(subscription);
+
} else if (device.platform === 'Android') {
var price = getFirstParameterValue(params, 'revenue');
var currency = getFirstParameterValue(params, 'currency');
@@ -704,8 +704,8 @@ AdjustCommandExecutor.prototype.trackSubscription = function(params) {
var orderId = getFirstParameterValue(params, 'transactionId');
var purchaseTime = getFirstParameterValue(params, 'transactionDate');
- var subscription = new AdjustPlayStoreSubscription(price, currency, sku, orderId, signature, purchaseToken);
- subscription.setPurchaseTime(purchaseTime);
+ var subscription = new AdjustPlayStoreSubscription(Number(price), currency, sku, orderId, signature, purchaseToken);
+ subscription.setPurchaseTime(Number(purchaseTime));
if ('callbackParams' in params) {
var callbackParams = getValueFromKey(params, 'callbackParams');
@@ -729,42 +729,7 @@ AdjustCommandExecutor.prototype.trackSubscription = function(params) {
}
};
-AdjustCommandExecutor.prototype.trackThirdPartySharing = function(params) {
- var isEnabled = null;
- if ('isEnabled' in params) {
- isEnabled = getFirstParameterValue(params, 'isEnabled') == 'true';
- }
- var adjustThirdPartySharing = new AdjustThirdPartySharing(isEnabled);
-
- if ('granularOptions' in params) {
- var granularOptions = getValueFromKey(params, 'granularOptions');
- for (var i = 0; i < granularOptions.length; i += 3) {
- var partnerName = granularOptions[i];
- var key = granularOptions[i+1];
- var value = granularOptions[i+2];
- adjustThirdPartySharing.addGranularOption(partnerName, key, value);
- }
- }
-
- if ('partnerSharingSettings' in params) {
- var partnerSharingSettings = getValueFromKey(params, 'partnerSharingSettings');
- for (var i = 0; i < partnerSharingSettings.length; i += 3) {
- var partnerName = partnerSharingSettings[i];
- var key = partnerSharingSettings[i+1];
- var value = partnerSharingSettings[i+2] === 'true';
- adjustThirdPartySharing.addPartnerSharingSetting(partnerName, key, value);
- }
- }
-
- Adjust.trackThirdPartySharing(adjustThirdPartySharing);
-};
-
-AdjustCommandExecutor.prototype.trackMeasurementConsent = function(params) {
- var isEnabled = getFirstParameterValue(params, 'isEnabled') == 'true';
- Adjust.trackMeasurementConsent(isEnabled);
-};
-
-AdjustCommandExecutor.prototype.trackAdRevenueV2 = function(params) {
+AdjustCommandExecutor.prototype.trackAdRevenue = function(params) {
var adjustAdRevenue;
var source = getFirstParameterValue(params, 'adRevenueSource');
// weird behaviour with null value
@@ -781,42 +746,12 @@ AdjustCommandExecutor.prototype.trackAdRevenueV2 = function(params) {
adjustAdRevenue.setRevenue(revenue, currency);
}
- if ('callbackParams' in params) {
- var callbackParams = getValueFromKey(params, 'callbackParams');
- for (var i = 0; i < callbackParams.length; i += 2) {
- var key = callbackParams[i];
- var value = callbackParams[i+1];
- adjustAdRevenue.addCallbackParameter(key, value);
- }
- }
-
- if ('partnerParams' in params) {
- var partnerParams = getValueFromKey(params, 'partnerParams');
- for (var i = 0; i < partnerParams.length; i += 2) {
- var key = partnerParams[i];
- var value = partnerParams[i+1];
- adjustAdRevenue.addPartnerParameter(key, value);
- }
- }
-
if ('adImpressionsCount' in params) {
var adImpressionsCount = getFirstParameterValue(params, 'adImpressionsCount');
var adImpressionsCountValue = parseInt(adImpressionsCount);
adjustAdRevenue.setAdImpressionsCount(adImpressionsCountValue);
}
- if ('adRevenueNetwork' in params) {
- var adRevenueNetwork = getFirstParameterValue(params, 'adRevenueNetwork');
-
- // test server might set adRevenueNetwork to be undefined/null, which gets
- // serialized/deserialized as string 'null', leading to failed test
- if (adRevenueNetwork === 'null') {
- adRevenueNetwork = null;
- }
-
- adjustAdRevenue.setAdRevenueNetwork(adRevenueNetwork);
- }
-
if ('adRevenueUnit' in params) {
var adRevenueUnit = getFirstParameterValue(params, 'adRevenueUnit');
@@ -841,25 +776,51 @@ AdjustCommandExecutor.prototype.trackAdRevenueV2 = function(params) {
adjustAdRevenue.setAdRevenuePlacement(adRevenuePlacement);
}
+ if ('adRevenueNetwork' in params) {
+ var adRevenueNetwork = getFirstParameterValue(params, 'adRevenueNetwork');
+
+ // test server might set adRevenueNetwork to be undefined/null, which gets
+ // serialized/deserialized as string 'null', leading to failed test
+ if (adRevenueNetwork === 'null') {
+ adRevenueNetwork = null;
+ }
+
+ adjustAdRevenue.setAdRevenueNetwork(adRevenueNetwork);
+ }
+
+ if ('callbackParams' in params) {
+ var callbackParams = getValueFromKey(params, 'callbackParams');
+ for (var i = 0; i < callbackParams.length; i += 2) {
+ var key = callbackParams[i];
+ var value = callbackParams[i+1];
+ adjustAdRevenue.addCallbackParameter(key, value);
+ }
+ }
+
+ if ('partnerParams' in params) {
+ var partnerParams = getValueFromKey(params, 'partnerParams');
+ for (var i = 0; i < partnerParams.length; i += 2) {
+ var key = partnerParams[i];
+ var value = partnerParams[i+1];
+ adjustAdRevenue.addPartnerParameter(key, value);
+ }
+ }
Adjust.trackAdRevenue(adjustAdRevenue);
};
AdjustCommandExecutor.prototype.getLastDeeplink = function(params) {
- if (device.platform === 'iOS') {
- var _this = this;
- Adjust.getLastDeeplink(function(lastDeeplink) {
- AdjustTest.addInfoToSend('last_deeplink', lastDeeplink);
- AdjustTest.sendInfoToServer(_this.extraPath);
- });
- }
+ var _this = this;
+ Adjust.getLastDeeplink(function(lastDeeplink) {
+ AdjustTest.addInfoToSend('last_deeplink', lastDeeplink);
+ AdjustTest.sendInfoToServer(_this.extraPath);
+ });
};
AdjustCommandExecutor.prototype.verifyPurchase = function(params) {
if (device.platform === 'iOS') {
- var receipt = getFirstParameterValue(params, 'receipt');
var productId = getFirstParameterValue(params, 'productId');
var transactionId = getFirstParameterValue(params, 'transactionId');
- var purchase = new AdjustAppStorePurchase(receipt, productId, transactionId);
+ var purchase = new AdjustAppStorePurchase(productId, transactionId);
var _this = this;
Adjust.verifyAppStorePurchase(purchase, function(verificationInfo) {
@@ -883,28 +844,69 @@ AdjustCommandExecutor.prototype.verifyPurchase = function(params) {
}
};
+AdjustCommandExecutor.prototype.verifyTrack = function(params) {
+ var _this = this;
+ this.event(params);
+ var eventNumber = 0;
+ if ('eventName' in params) {
+ var eventName = getFirstParameterValue(params, 'eventName');
+ eventNumber = parseInt(eventName.substr(eventName.length - 1))
+ }
+ var adjustEvent = this.savedEvents[eventNumber];
+ if (device.platform === 'iOS') {
+ Adjust.verifyAndTrackAppStorePurchase(adjustEvent, function(verificationResult) {
+ AdjustTest.addInfoToSend('verification_status', verificationResult.verificationStatus);
+ AdjustTest.addInfoToSend('code', verificationResult.code);
+ AdjustTest.addInfoToSend('message', verificationResult.message);
+ AdjustTest.sendInfoToServer(_this.extraPath);
+ });
+ } else if (device.platform === 'Android') {
+ Adjust.verifyAndTrackPlayStorePurchase(adjustEvent, function(verificationResult) {
+ AdjustTest.addInfoToSend('verification_status', verificationResult.verificationStatus);
+ AdjustTest.addInfoToSend('code', verificationResult.code);
+ AdjustTest.addInfoToSend('message', verificationResult.message);
+ AdjustTest.sendInfoToServer(_this.extraPath);
+ });
+ }
+
+ delete this.savedEvents[0];
+};
+
+
AdjustCommandExecutor.prototype.processDeeplink = function(params) {
var deeplink = getFirstParameterValue(params, 'deeplink');
+ if (typeof deeplink !== 'string') {
+ return;
+ }
+ var adjustDeeplink = new AdjustDeeplink(deeplink);
var _this = this;
- Adjust.processDeeplink(deeplink, function(resolvedLink) {
+ Adjust.processAndResolveDeeplink(adjustDeeplink, function(resolvedLink) {
AdjustTest.addInfoToSend('resolved_link', resolvedLink);
AdjustTest.sendInfoToServer(_this.extraPath);
});
};
-// Util methods
-
-function addJsonResponseInfo(event) {
- if (event.jsonResponse == null) {
- return;
- }
+AdjustCommandExecutor.prototype.attributionGetter = function(params) {
+ var _this = this;
+ Adjust.getAttribution(function(attribution) {
+ AdjustTest.addInfoToSend('tracker_token', attribution.trackerToken);
+ AdjustTest.addInfoToSend('tracker_name', attribution.trackerName);
+ AdjustTest.addInfoToSend('network', attribution.network);
+ AdjustTest.addInfoToSend('campaign', attribution.campaign);
+ AdjustTest.addInfoToSend('adgroup', attribution.adgroup);
+ AdjustTest.addInfoToSend('creative', attribution.creative);
+ AdjustTest.addInfoToSend('click_label', attribution.clickLabel);
+ AdjustTest.addInfoToSend('cost_type', attribution.costType);
+ AdjustTest.addInfoToSend('cost_amount', attribution.costAmount);
+ AdjustTest.addInfoToSend('cost_currency', attribution.costCurrency);
+ if (device.platform === 'Android') {
+ AdjustTest.addInfoToSend('fb_install_referrer', attribution.fbInstallReferrer);
+ }
+ AdjustTest.sendInfoToServer(_this.extraPath);
+ });
+};
- if (device.platform === 'Android') {
- AdjustTest.addInfoToSend('jsonResponse', event.jsonResponse);
- } else {
- AdjustTest.addInfoToSend('jsonResponse', JSON.stringify(event.jsonResponse));
- }
-}
+// Util methods
function getValueFromKey(params, key) {
if (key in params) {
diff --git a/test/app/www/js/index.js b/test/app/www/js/index.js
index 91a8b1b6..923fb3ce 100755
--- a/test/app/www/js/index.js
+++ b/test/app/www/js/index.js
@@ -1,7 +1,8 @@
function handleOpenURL(url) {
setTimeout(function() {
- console.log(`TestApp, handleOpenURL: initiate Adjust.appWillOpenUrl, with URL = ${url}`);
- Adjust.appWillOpenUrl(url);
+ console.log(`TestApp, handleOpenURL: initiate Adjust.processDeeplink, with URL = ${url}`);
+ var adjustDeeplink = new AdjustDeeplink(url);
+ Adjust.processDeeplink(adjustDeeplink);
}, 0);
}
@@ -20,7 +21,7 @@ var app = {
}
var urlOverwrite = "";
- var ipAddress = "192.168.86.53";
+ var ipAddress = "192.168.86.80";
if (device.platform === "Android") {
urlOverwrite = "https://" + ipAddress + ":8443";
} else if (device.platform === "iOS") {
@@ -30,6 +31,7 @@ var app = {
var commandExecutor = new CommandExecutor(urlOverwrite);
// AdjustTest.addTestDirectory('purchase-verification');
+
AdjustTest.startTestSession(urlOverwrite, controlUrl, sdkVersion, function(json) {
var commandDict = JSON.parse(json);
var className = commandDict['className'];
@@ -42,8 +44,8 @@ var app = {
},
didLaunchAppFromLink: function(eventData) {
- console.log(`TestApp, didLaunchAppFromLink: initiate Adjust.appWillOpenUrl, with URL = ${eventData.url}`);
- Adjust.appWillOpenUrl(eventData.url);
+ console.log(`TestApp, didLaunchAppFromLink: initiate Adjust.processDeeplink, with URL = ${eventData.url}`);
+ Adjust.processDeeplink(eventData.url);
},
receivedEvent: function(id) {
diff --git a/test/app/www/js/test_options.js b/test/app/www/js/test_options.js
index a6b4a39c..e75304c7 100644
--- a/test/app/www/js/test_options.js
+++ b/test/app/www/js/test_options.js
@@ -1,21 +1,17 @@
'use strict';
function AdjustTestOptions() {
- this.hasContext = false;
- this.baseUrl = null;
- this.gdprUrl = null;
- this.subscriptionUrl = null;
- this.purchaseVerificationUrl = null;
- this.basePath = null;
- this.gdprPath = null
- this.subscriptionPath = null
- this.purchaseVerificationPath = null;
- this.extraPath = null;
- this.useTestConnectionOptions = null;
+ this.testUrlOverwrite = null;
this.timerIntervalInMilliseconds = null;
this.timerStartInMilliseconds = null;
this.sessionIntervalInMilliseconds = null;
this.subsessionIntervalInMilliseconds = null;
- this.teardown = null;
+ this.attStatus = null;
+ this.idfa = null;
this.noBackoffWait = null;
+ this.adServicesFrameworkEnabled = null;
+ this.teardown = null;
+ this.extraPath = null;
+ this.deleteState = false;
+ this.ignoreSystemLifecycleBootstrap = null;
};
diff --git a/test/plugin/package.json b/test/plugin/package.json
index 320c4fd9..618c3ef8 100644
--- a/test/plugin/package.json
+++ b/test/plugin/package.json
@@ -1,5 +1,5 @@
{
- "version": "4.38.1",
+ "version": "5.0.0",
"name": "com.adjust.test",
"cordova_name": "Adjust Cordova Test Plugin",
"description": "Cordova Plugin For Adjust SDK Testing",
diff --git a/test/plugin/plugin.xml b/test/plugin/plugin.xml
index 324544e1..8af3065b 100644
--- a/test/plugin/plugin.xml
+++ b/test/plugin/plugin.xml
@@ -2,7 +2,7 @@
+ version="5.0.0">
Adjust Test
Adjust Plugin For Cordova SDK Testing
diff --git a/test/plugin/src/ios/ADJCommandListener.h b/test/plugin/src/ios/ADJCommandListener.h
index 388636ac..9e7005c5 100644
--- a/test/plugin/src/ios/ADJCommandListener.h
+++ b/test/plugin/src/ios/ADJCommandListener.h
@@ -3,7 +3,7 @@
// Adjust SDK
//
// Created by Abdullah Obaied (@obaied) on 20th February 2018.
-// Copyright (c) 2018 Adjust GmbH. All rights reserved.
+// Copyright (c) 2018-Present Adjust GmbH. All rights reserved.
//
#import
diff --git a/test/plugin/src/ios/ADJCommandListener.m b/test/plugin/src/ios/ADJCommandListener.m
index 93d5c606..0a3569e5 100644
--- a/test/plugin/src/ios/ADJCommandListener.m
+++ b/test/plugin/src/ios/ADJCommandListener.m
@@ -3,7 +3,7 @@
// Adjust SDK
//
// Created by Abdullah Obaied (@obaied) on 20th February 2018.
-// Copyright (c) 2018 Adjust GmbH. All rights reserved.
+// Copyright (c) 2018-Present Adjust GmbH. All rights reserved.
//
#import "ADJCommandListener.h"
diff --git a/test/plugin/src/ios/ADJCordovaTest.h b/test/plugin/src/ios/ADJCordovaTest.h
index 845941b3..eb941a9c 100644
--- a/test/plugin/src/ios/ADJCordovaTest.h
+++ b/test/plugin/src/ios/ADJCordovaTest.h
@@ -3,7 +3,7 @@
// Adjust SDK
//
// Created by Abdullah Obaied (@obaied) on 20th February 2018.
-// Copyright (c) 2018 Adjust GmbH. All rights reserved.
+// Copyright (c) 2018-Present Adjust GmbH. All rights reserved.
//
#import
diff --git a/test/plugin/src/ios/ADJCordovaTest.m b/test/plugin/src/ios/ADJCordovaTest.m
index d2364009..9709ced6 100644
--- a/test/plugin/src/ios/ADJCordovaTest.m
+++ b/test/plugin/src/ios/ADJCordovaTest.m
@@ -3,7 +3,7 @@
// Adjust SDK
//
// Created by Abdullah Obaied (@obaied) on 20th February 2018.
-// Copyright (c) 2018 Adjust GmbH. All rights reserved.
+// Copyright (c) 2018-Present Adjust GmbH. All rights reserved.
//
#import
diff --git a/test/plugin/src/ios/AdjustTestLibrary.framework/AdjustTestLibrary b/test/plugin/src/ios/AdjustTestLibrary.framework/AdjustTestLibrary
index 35916271..633bbf7e 100644
Binary files a/test/plugin/src/ios/AdjustTestLibrary.framework/AdjustTestLibrary and b/test/plugin/src/ios/AdjustTestLibrary.framework/AdjustTestLibrary differ
diff --git a/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLControlSignal.h b/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLControlSignal.h
new file mode 100644
index 00000000..22f0ab7d
--- /dev/null
+++ b/test/plugin/src/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/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLNetworking.h b/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLNetworking.h
new file mode 100644
index 00000000..90c2a109
--- /dev/null
+++ b/test/plugin/src/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/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLTestInfo.h b/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLTestInfo.h
deleted file mode 100644
index 06ac38a0..00000000
--- a/test/plugin/src/ios/AdjustTestLibrary.framework/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/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLTestLibrary.h b/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLTestLibrary.h
index 099414dd..14f763ba 100644
--- a/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLTestLibrary.h
+++ b/test/plugin/src/ios/AdjustTestLibrary.framework/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/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLUtilNetworking.h b/test/plugin/src/ios/AdjustTestLibrary.framework/Headers/ATLUtilNetworking.h
deleted file mode 100644
index d7370b74..00000000
--- a/test/plugin/src/ios/AdjustTestLibrary.framework/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/www/adjust.js b/www/adjust.js
index 1a7bb526..38743d43 100644
--- a/www/adjust.js
+++ b/www/adjust.js
@@ -48,198 +48,255 @@ function callCordovaStringifyCallback(action, data, callback) {
}
var Adjust = {
- create: function(adjustConfig) {
+ initSdk: function(adjustConfig) {
if (adjustConfig) {
adjustConfig.sdkPrefix = this.getSdkPrefix();
}
-
- if (adjustConfig.hasAttributionListener()) {
+ if (adjustConfig.hasAttributionCallback()) {
callCordovaCallback('setAttributionCallback', adjustConfig.getAttributionCallback());
}
- if (adjustConfig.hasEventTrackingSucceededListener()) {
+ if (adjustConfig.hasEventTrackingSucceededCallback()) {
callCordovaCallback('setEventTrackingSucceededCallback', adjustConfig.getEventTrackingSucceededCallback());
}
- if (adjustConfig.hasEventTrackingFailedListener()) {
+ if (adjustConfig.hasEventTrackingFailedCallback()) {
callCordovaCallback('setEventTrackingFailedCallback', adjustConfig.getEventTrackingFailedCallback());
}
- if (adjustConfig.hasSessionTrackingSucceededListener()) {
+ if (adjustConfig.hasSessionTrackingSucceededCallback()) {
callCordovaCallback('setSessionTrackingSucceededCallback', adjustConfig.getSessionTrackingSucceededCallback());
}
- if (adjustConfig.hasSessionTrackingFailedListener()) {
+ if (adjustConfig.hasSessionTrackingFailedCallback()) {
callCordovaCallback('setSessionTrackingFailedCallback', adjustConfig.getSessionTrackingFailedCallback());
}
- if (adjustConfig.hasDeferredDeeplinkCallbackListener()) {
+ if (adjustConfig.hasDeferredDeeplinkCallback()) {
callCordovaCallback('setDeferredDeeplinkCallback', adjustConfig.getDeferredDeeplinkCallback());
}
- if (adjustConfig.hasConversionValueUpdatedCallbackListener()) {
- callCordovaCallback('setConversionValueUpdatedCallback', adjustConfig.getConversionValueUpdatedCallback());
- }
- if (adjustConfig.hasSkad4ConversionValueUpdatedCallbackListener()) {
- callCordovaCallback('setSkad4ConversionValueUpdatedCallback', adjustConfig.getSkad4ConversionValueUpdatedCallback());
+ if (adjustConfig.hasSkanUpdatedCallback()) {
+ if (device.platform === 'iOS') {
+ callCordovaCallback('setSkanUpdatedCallback', adjustConfig.getSkanUpdatedCallback());
+ }
}
- callCordovaStringify('create', adjustConfig);
+ callCordovaStringify('initSdk', adjustConfig);
},
- trackEvent: function(adjustEvent) {
- callCordovaStringify('trackEvent', adjustEvent);
+ setPushToken: function(token) {
+ if (typeof token !== 'string') {
+ console.log("[Adjust] Push token is not of type string");
+ return;
+ }
+ callCordova('setPushToken', token);
},
- setOfflineMode: function(enabled) {
- callCordova('setOfflineMode', enabled);
+ getAttribution: function(callback) {
+ callCordovaCallback('getAttribution', callback);
},
- appWillOpenUrl: function(url) {
- callCordova('appWillOpenUrl', url);
+ getAdid: function(callback) {
+ callCordovaCallback('getAdid', callback);
},
- setEnabled: function(enabled) {
- callCordova('setEnabled', enabled);
+ getGoogleAdId: function(callback) {
+ if (device.platform === 'Android') {
+ callCordovaCallback('getGoogleAdId', callback);
+ }
},
- setPushToken: function(pushToken) {
- callCordova('setPushToken', pushToken);
+ getAmazonAdId: function(callback) {
+ if (device.platform === 'Android') {
+ callCordovaCallback('getAmazonAdId', callback);
+ }
},
- setReferrer: function(referrer) {
- callCordova('setReferrer', referrer);
+ getSdkVersion: function(callback) {
+ var sdkPrefix = this.getSdkPrefix();
+ callCordovaCallback('getSdkVersion', function(sdkVersion) {
+ callback(sdkPrefix + "@" + sdkVersion);
+ });
},
- isEnabled: function(callback) {
- callCordovaCallback('isEnabled', callback);
+ getSdkPrefix: function () {
+ return 'cordova5.0.0';
},
- gdprForgetMe: function() {
- callCordova('gdprForgetMe');
+ addGlobalCallbackParameter: function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Global callback parameter key or value is not of type string");
+ return;
+ }
+ callCordova('addGlobalCallbackParameter', key, value);
},
- disableThirdPartySharing: function() {
- callCordova('disableThirdPartySharing');
+ removeGlobalCallbackParameter: function(key) {
+ if (typeof key !== 'string') {
+ console.log("[Adjust] Global callback parameter key is not of type string");
+ return;
+ }
+ callCordova('removeGlobalCallbackParameter', key);
},
- trackAdRevenue: function(source, payload = undefined) {
- if (payload === undefined) {
- // new API
- callCordovaStringify('trackAdRevenue', source);
- } else {
- // old API
- callCordova('trackAdRevenue', source, payload);
- }
+ removeGlobalCallbackParameters: function() {
+ callCordova('removeGlobalCallbackParameters');
},
- trackAppStoreSubscription: function(subscription) {
- callCordovaStringify('trackAppStoreSubscription', subscription);
+ addGlobalPartnerParameter: function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Global partner parameter key or value is not of type string");
+ return;
+ }
+ callCordova('addGlobalPartnerParameter', key, value);
},
- trackPlayStoreSubscription: function(subscription) {
- callCordovaStringify('trackPlayStoreSubscription', subscription);
+ removeGlobalPartnerParameter: function(key) {
+ if (typeof key !== 'string') {
+ console.log("[Adjust] Global partner parameter key is not of type string");
+ return;
+ }
+ callCordova('removeGlobalPartnerParameter', key);
},
- verifyAppStorePurchase: function(purchase, callback) {
- callCordovaStringifyCallback('verifyAppStorePurchase', purchase, callback);
+ removeGlobalPartnerParameters: function() {
+ callCordova('removeGlobalPartnerParameters');
},
- verifyPlayStorePurchase: function(purchase, callback) {
- callCordovaStringifyCallback('verifyPlayStorePurchase', purchase, callback);
+ switchToOfflineMode: function() {
+ callCordova('switchToOfflineMode');
},
- getGoogleAdId: function(callback) {
- callCordovaCallback('getGoogleAdId', callback);
+ switchBackToOnlineMode: function() {
+ callCordova('switchBackToOnlineMode');
},
- getAmazonAdId: function(callback) {
- callCordovaCallback('getAmazonAdId', callback);
+ enable: function() {
+ callCordova('enable');
},
- getIdfa: function(callback) {
- callCordovaCallback('getIdfa', callback);
+ disable: function() {
+ callCordova('disable');
},
- getAdid: function(callback) {
- callCordovaCallback('getAdid', callback);
+ isEnabled: function(callback) {
+ callCordovaCallback('isEnabled', callback);
},
- getAttribution: function(callback) {
- callCordovaCallback('getAttribution', callback);
+ gdprForgetMe: function() {
+ callCordova('gdprForgetMe');
},
- getSdkVersion: function(callback) {
- var sdkPrefix = this.getSdkPrefix();
- callCordovaCallback('getSdkVersion', function(sdkVersion) {
- callback(sdkPrefix + "@" + sdkVersion);
- });
+ onPause: function(testParam) {
+ if (testParam === null || testParam === undefined || testParam !== 'test') {
+ return;
+ }
+ callCordova('onPause');
+ },
+ onResume: function(testParam) {
+ if (testParam === null || testParam === undefined || testParam !== 'test') {
+ return;
+ }
+ callCordova('onResume');
},
- getSdkPrefix: function () {
- return 'cordova4.38.1';
+ trackEvent: function(adjustEvent) {
+ callCordovaStringify('trackEvent', adjustEvent);
},
- addSessionCallbackParameter: function(key, value) {
- callCordova('addSessionCallbackParameter', key, value);
+ trackAdRevenue: function(adjustAdrevenue) {
+ callCordovaStringify('trackAdRevenue', adjustAdrevenue);
},
- removeSessionCallbackParameter: function(key) {
- callCordova('removeSessionCallbackParameter', key);
+ trackPlayStoreSubscription: function(adjustPlayStoreSubscription) {
+ if (device.platform === 'Android') {
+ callCordovaStringify('trackPlayStoreSubscription', adjustPlayStoreSubscription);
+ }
},
- resetSessionCallbackParameters: function() {
- callCordova('resetSessionCallbackParameters');
+ verifyPlayStorePurchase: function(adjustPlayStorePurchase, callback) {
+ if (device.platform === 'Android') {
+ callCordovaStringifyCallback('verifyPlayStorePurchase', adjustPlayStorePurchase, callback);
+ }
},
- addSessionPartnerParameter: function(key, value) {
- callCordova('addSessionPartnerParameter', key, value);
+ verifyAndTrackPlayStorePurchase: function(adjustEvent, callback) {
+ if (device.platform === 'Android') {
+ callCordovaStringifyCallback('verifyAndTrackPlayStorePurchase', adjustEvent, callback);
+ }
},
- removeSessionPartnerParameter: function(key) {
- callCordova('removeSessionPartnerParameter', key);
+ trackThirdPartySharing: function(adjustThirdPartySharing) {
+ callCordovaStringify('trackThirdPartySharing', adjustThirdPartySharing);
},
- resetSessionPartnerParameters: function() {
- callCordova('resetSessionPartnerParameters');
+ trackMeasurementConsent: function(measurementConsent) {
+ if (typeof measurementConsent !== 'boolean') {
+ console.log("[Adjust] Measurement consent is not of type boolean");
+ return;
+ }
+ callCordova('trackMeasurementConsent', measurementConsent);
},
- sendFirstPackages: function() {
- callCordova('sendFirstPackages');
+ processDeeplink: function(adjustDeeplink) {
+ callCordovaStringify('processDeeplink', adjustDeeplink);
},
- requestTrackingAuthorizationWithCompletionHandler: function(callback) {
- callCordovaCallback('requestTrackingAuthorizationWithCompletionHandler', callback);
+ processAndResolveDeeplink: function(adjustDeeplink, callback) {
+ callCordovaStringifyCallback('processAndResolveDeeplink', adjustDeeplink, callback);
},
- updateConversionValue: function(conversionValue) {
- callCordova('updateConversionValue', conversionValue);
+ getLastDeeplink: function(callback) {
+ callCordovaCallback('getLastDeeplink', callback);
},
- updateConversionValueWithErrorCallback: function(callback, conversionValue) {
- callCordovaCallback('updateConversionValueWithErrorCallback', callback, conversionValue);
+ trackAppStoreSubscription: function(adjustAppStoreSubscription) {
+ if (device.platform === 'iOS') {
+ callCordovaStringify('trackAppStoreSubscription', adjustAppStoreSubscription);
+ }
},
- updateSkad4ConversionValueWithErrorCallback: function(callback, fineValue, coarseValue, lockWindow) {
- callCordovaCallback('updateSkad4ConversionValueWithErrorCallback', callback, fineValue, coarseValue, lockWindow);
+ verifyAppStorePurchase: function(adjustAppStorePurchase, callback) {
+ if (device.platform === 'iOS') {
+ callCordovaStringifyCallback('verifyAppStorePurchase', adjustAppStorePurchase, callback);
+ }
},
- getAppTrackingAuthorizationStatus: function(callback) {
- callCordovaCallback('getAppTrackingAuthorizationStatus', callback);
+ verifyAndTrackAppStorePurchase: function(adjustEvent, callback) {
+ if (device.platform === 'iOS') {
+ callCordovaStringifyCallback('verifyAndTrackAppStorePurchase', adjustEvent, callback);
+ }
},
- trackThirdPartySharing: function(adjustThirdPartySharing) {
- callCordovaStringify('trackThirdPartySharing', adjustThirdPartySharing);
+ requestAppTrackingAuthorization: function(callback) {
+ if (device.platform === 'iOS') {
+ callCordovaCallback('requestAppTrackingAuthorization', callback);
+ }
},
- trackMeasurementConsent: function(measurementConsent) {
- callCordova('trackMeasurementConsent', measurementConsent);
+ getAppTrackingAuthorizationStatus: function(callback) {
+ if (device.platform === 'iOS') {
+ callCordovaCallback('getAppTrackingAuthorizationStatus', callback);
+ }
},
- getLastDeeplink: function(callback) {
- callCordovaCallback('getLastDeeplink', callback);
+ updateSkanConversionValue: function(conversionValue, coarseValue, lockWindow, callback) {
+ if (device.platform === 'iOS') {
+ if (!Number.isInteger(conversionValue) ||
+ typeof coarseValue !== 'string' ||
+ typeof lockWindow !== 'boolean') {
+ console.log("[Adjust] SKAN parameters are not of a proper data types");
+ return;
+ }
+ callCordovaCallback('updateSkanConversionValue', callback, conversionValue, coarseValue, lockWindow);
+ }
},
- getIdfv: function(callback) {
- callCordovaCallback('getIdfv', callback);
+ getIdfa: function(callback) {
+ if (device.platform === 'iOS') {
+ callCordovaCallback('getIdfa', callback);
+ }
},
- processDeeplink: function(deeplink, callback) {
- callCordovaCallback('processDeeplink', callback, deeplink);
+ getIdfv: function(callback) {
+ if (device.platform === 'iOS') {
+ callCordovaCallback('getIdfv', callback);
+ }
},
setTestOptions: function(testOptions) {
@@ -251,36 +308,7 @@ var Adjust = {
return;
}
callCordova('teardown');
- },
-
- onResume: function(testParam) {
- if(testParam === null || testParam === undefined || testParam !== 'test') {
- return;
- }
- callCordova('onResume');
- },
-
- onPause: function(testParam) {
- if(testParam === null || testParam === undefined || testParam !== 'test') {
- return;
- }
- callCordova('onPause');
- },
-
- checkForNewAttStatus: function() {
- callCordova('checkForNewAttStatus');
}
};
-function onPause() {
- callCordova('onPause');
-}
-
-function onResume() {
- callCordova('onResume');
-}
-
-document.addEventListener('resume', onResume, false);
-document.addEventListener('pause', onPause, false);
-
-module.exports = Adjust;
+module.exports = Adjust;
\ No newline at end of file
diff --git a/www/adjust_ad_revenue.js b/www/adjust_ad_revenue.js
index 28ef47af..f0c01171 100644
--- a/www/adjust_ad_revenue.js
+++ b/www/adjust_ad_revenue.js
@@ -1,4 +1,4 @@
-var AdjustAdRevenue = function(source) {
+function AdjustAdRevenue(source) {
this.source = source;
this.revenue = null;
this.currency = null;
@@ -8,33 +8,51 @@ var AdjustAdRevenue = function(source) {
this.adRevenuePlacement = null;
this.callbackParameters = [];
this.partnerParameters = [];
-};
+}
AdjustAdRevenue.prototype.setRevenue = function(revenue, currency) {
- if (revenue != null) {
- this.revenue = revenue.toString();
- this.currency = currency;
+ if (typeof revenue !== 'number' || typeof currency !== 'string') {
+ console.log("[Adjust] Ad revenue or currency is not of a proper data type");
}
+ this.revenue = revenue;
+ this.currency = currency;
};
AdjustAdRevenue.prototype.setAdImpressionsCount = function(adImpressionsCount) {
- this.adImpressionsCount = adImpressionsCount.toString();
+ if (!Number.isInteger(adImpressionsCount)) {
+ console.log("[Adjust] Ad impressions count is not of type integer");
+ return;
+ }
+ this.adImpressionsCount = adImpressionsCount;
};
AdjustAdRevenue.prototype.setAdRevenueNetwork = function(adRevenueNetwork) {
+ if (typeof adRevenueNetwork !== 'string') {
+ console.log("[Adjust] Ad revenue network is not of type string");
+ return;
+ }
this.adRevenueNetwork = adRevenueNetwork;
};
AdjustAdRevenue.prototype.setAdRevenueUnit = function(adRevenueUnit) {
+ if (typeof adRevenueUnit !== 'string') {
+ console.log("[Adjust] Ad revenue unit is not of type string");
+ return;
+ }
this.adRevenueUnit = adRevenueUnit;
};
AdjustAdRevenue.prototype.setAdRevenuePlacement = function(adRevenuePlacement) {
+ if (typeof adRevenuePlacement !== 'string') {
+ console.log("[Adjust] Ad revenue placement is not of type string");
+ return;
+ }
this.adRevenuePlacement = adRevenuePlacement;
};
AdjustAdRevenue.prototype.addCallbackParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Ad revenue callback parameter key or value is not of type string");
return;
}
this.callbackParameters.push(key);
@@ -43,6 +61,7 @@ AdjustAdRevenue.prototype.addCallbackParameter = function(key, value) {
AdjustAdRevenue.prototype.addPartnerParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Ad revenue partner parameter key or value is not of type string");
return;
}
this.partnerParameters.push(key);
diff --git a/www/adjust_app_store_purchase.js b/www/adjust_app_store_purchase.js
index 50a46707..86794ba8 100644
--- a/www/adjust_app_store_purchase.js
+++ b/www/adjust_app_store_purchase.js
@@ -1,5 +1,4 @@
-function AdjustAppStorePurchase(receipt, productId, transactionId) {
- this.receipt = receipt;
+function AdjustAppStorePurchase(productId, transactionId) {
this.productId = productId;
this.transactionId = transactionId;
}
diff --git a/www/adjust_app_store_subscription.js b/www/adjust_app_store_subscription.js
index b274075c..991a4c7e 100644
--- a/www/adjust_app_store_subscription.js
+++ b/www/adjust_app_store_subscription.js
@@ -1,8 +1,7 @@
-function AdjustAppStoreSubscription(price, currency, transactionId, receipt) {
+function AdjustAppStoreSubscription(price, currency, transactionId) {
this.price = price;
this.currency = currency;
this.transactionId = transactionId;
- this.receipt = receipt;
this.transactionDate = null;
this.salesRegion = null;
this.callbackParameters = [];
@@ -10,19 +9,35 @@ function AdjustAppStoreSubscription(price, currency, transactionId, receipt) {
}
AdjustAppStoreSubscription.prototype.setTransactionDate = function(transactionDate) {
+ if (typeof transactionDate !== 'string') {
+ console.log("[Adjust] App Store subscription transaction date is not of type string");
+ return;
+ }
this.transactionDate = transactionDate;
};
AdjustAppStoreSubscription.prototype.setSalesRegion = function(salesRegion) {
+ if (typeof salesRegion !== 'string') {
+ console.log("[Adjust] App Store subscription sales region is not of type string");
+ return;
+ }
this.salesRegion = salesRegion;
};
AdjustAppStoreSubscription.prototype.addCallbackParameter = function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] App Store subscription callback parameter key or value is not of type string");
+ return;
+ }
this.callbackParameters.push(key);
this.callbackParameters.push(value);
};
AdjustAppStoreSubscription.prototype.addPartnerParameter = function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] App Store subscription partner parameter key or value is not of type string");
+ return;
+ }
this.partnerParameters.push(key);
this.partnerParameters.push(value);
};
diff --git a/www/adjust_config.js b/www/adjust_config.js
index bab7844c..f2abb1ad 100644
--- a/www/adjust_config.js
+++ b/www/adjust_config.js
@@ -1,51 +1,44 @@
function AdjustConfig(appToken, environment) {
- this.appToken = appToken;
- this.environment = environment;
- this.delayStart = 0.0;
- this.logLevel = null;
- this.userAgent = null;
- this.isDeviceKnown = null;
- this.defaultTracker = null;
- this.externalDeviceId = null;
- this.urlStrategy = null;
- this.sendInBackground = null;
- this.shouldLaunchDeeplink = null;
- this.eventBufferingEnabled = null;
- this.needsCost = null;
+ // Adjust callbacks
this.attributionCallback = null;
this.eventTrackingSucceededCallback = null;
this.eventTrackingFailedCallback = null;
this.sessionTrackingSucceededCallback = null;
this.sessionTrackingFailedCallback = null;
this.deferredDeeplinkCallback = null;
- this.conversionValueUpdatedCallback = null;
- this.skad4ConversionValueUpdatedCallback = null;
- this.coppaCompliantEnabled = null;
- this.readDeviceInfoOnceEnabled = null;
+ this.skanUpdatedCallback = null;
+
+ // Common configuration fields
+ this.appToken = appToken;
+ this.environment = environment;
+ this.isSendingInBackgroundEnabled = null;
+ this.isCostDataInAttributionEnabled = null;
+ this.isDeviceIdsReadingOnceEnabled = null;
+ this.urlStrategyDomains = null;
+ this.useSubdomains = null;
+ this.isDataResidency = null;
this.sdkPrefix = null;
- this.secretId = null;
- this.info1 = null;
- this.info2 = null;
- this.info3 = null;
- this.info4 = null;
+ this.logLevel = null;
+ this.defaultTracker = null;
+ this.externalDeviceId = null;
+ this.eventDeduplicationIdsMaxSize = null;
+ this.isDeferredDeeplinkOpeningEnabled = null;
+ this.isCoppaComplianceEnabled = null;
+
// Android only
- this.referrer = null;
this.processName = null;
- this.readMobileEquipmentIdentity = null;
- this.preinstallTrackingEnabled = null;
+ this.isPreinstallTrackingEnabled = null;
this.preinstallFilePath = null;
- this.oaidReadingEnabled = null;
- this.playStoreKidsAppEnabled = null;
- this.finalAndroidAttributionEnabled = null;
+ this.isPlayStoreKidsComplianceEnabled = null;
this.fbAppId = null;
// iOS only
- this.allowiAdInfoReading = null;
- this.allowAdServicesInfoReading = null;
- this.allowIdfaReading = null;
- this.handleSkAdNetwork = null;
- this.linkMeEnabled = null;
+ this.isAdServicesEnabled = null;
+ this.isIdfaReadingEnabled = null;
+ this.isIdfvReadingEnabled = null;
+ this.isSkanAttributionEnabled = null;
+ this.isLinkMeEnabled = null;
this.attConsentWaitingInterval = null;
-};
+}
AdjustConfig.EnvironmentSandbox = "sandbox";
AdjustConfig.EnvironmentProduction = "production";
@@ -58,294 +51,212 @@ AdjustConfig.LogLevelError = "ERROR";
AdjustConfig.LogLevelAssert = "ASSERT";
AdjustConfig.LogLevelSuppress = "SUPPRESS";
-AdjustConfig.UrlStrategyChina = "china";
-AdjustConfig.UrlStrategyIndia = "india";
-AdjustConfig.UrlStrategyCn = "cn";
-AdjustConfig.UrlStrategyCnOnly = "cn-only";
-
-AdjustConfig.DataResidencyEU = "data-residency-eu";
-AdjustConfig.DataResidencyTR = "data-residency-tr";
-AdjustConfig.DataResidencyUS = "data-residency-us";
-AdjustConfig.AdRevenueSourceAppLovinMAX = "applovin_max_sdk";
-AdjustConfig.AdRevenueSourceMopub = "mopub";
-AdjustConfig.AdRevenueSourceAdMob = "admob_sdk";
-AdjustConfig.AdRevenueSourceIronSource = "ironsource_sdk";
-AdjustConfig.AdRevenueSourceAdMost = "admost_sdk";
-AdjustConfig.AdRevenueSourceUnity = "unity_sdk";
-AdjustConfig.AdRevenueSourceHeliumChartboost = "helium_chartboost_sdk";
-AdjustConfig.AdRevenueSourcePublisher = "publisher_sdk";
-AdjustConfig.AdRevenueSourceTopOn = "topon_sdk";
-AdjustConfig.AdRevenueSourceAdx = "adx_sdk";
-
-AdjustConfig.prototype.getUserAgent = function() {
- return this.userAgent;
-};
-
-AdjustConfig.prototype.getDelayStart = function() {
- return this.delayStart;
-};
-
-AdjustConfig.prototype.getReferrer = function() {
- return this.referrer;
+// Adjust Callbacks
+AdjustConfig.prototype.getAttributionCallback = function() {
+ return this.attributionCallback;
};
-
-AdjustConfig.prototype.getSendInBackground = function() {
- return this.sendInBackground;
+AdjustConfig.prototype.setAttributionCallback = function(callback) {
+ this.attributionCallback = callback;
};
-
-AdjustConfig.prototype.getShouldLaunchDeeplink = function() {
- return this.shouldLaunchDeeplink;
+AdjustConfig.prototype.hasAttributionCallback = function() {
+ return this.attributionCallback !== null;
};
-AdjustConfig.prototype.getAttributionCallback = function() {
- return this.attributionCallback;
-};
AdjustConfig.prototype.getEventTrackingSucceededCallback = function() {
return this.eventTrackingSucceededCallback;
};
-
-AdjustConfig.prototype.getEventTrackingFailedCallback = function() {
- return this.eventTrackingFailedCallback;
-};
-
-AdjustConfig.prototype.getSessionTrackingSucceededCallback = function() {
- return this.sessionTrackingSucceededCallback;
+AdjustConfig.prototype.setEventTrackingSucceededCallback = function(callback) {
+ this.eventTrackingSucceededCallback = callback;
};
-
-AdjustConfig.prototype.getSessionTrackingFailedCallback = function() {
- return this.sessionTrackingFailedCallback;
-};
-
-AdjustConfig.prototype.getDeferredDeeplinkCallback = function() {
- return this.deferredDeeplinkCallback;
+AdjustConfig.prototype.hasEventTrackingSucceededCallback = function() {
+ return this.eventTrackingSucceededCallback !== null;
};
-AdjustConfig.prototype.getConversionValueUpdatedCallback = function() {
- return this.conversionValueUpdatedCallback;
-};
-AdjustConfig.prototype.getSkad4ConversionValueUpdatedCallback = function() {
- return this.skad4ConversionValueUpdatedCallback;
+AdjustConfig.prototype.getEventTrackingFailedCallback = function() {
+ return this.eventTrackingFailedCallback;
};
-
-AdjustConfig.prototype.setEventBufferingEnabled = function(isEnabled) {
- this.eventBufferingEnabled = isEnabled;
+AdjustConfig.prototype.setEventTrackingFailedCallback = function(callback) {
+ this.eventTrackingFailedCallback = callback;
};
-
-AdjustConfig.prototype.setPreinstallTrackingEnabled = function(isEnabled) {
- this.preinstallTrackingEnabled = isEnabled;
+AdjustConfig.prototype.hasEventTrackingFailedCallback = function() {
+ return this.eventTrackingFailedCallback !== null;
};
-AdjustConfig.prototype.setPreinstallFilePath = function(preinstallFilePath) {
- this.preinstallFilePath = preinstallFilePath;
-};
-AdjustConfig.prototype.setOaidReadingEnabled = function(enableOaidReading) {
- this.oaidReadingEnabled = enableOaidReading;
+AdjustConfig.prototype.getSessionTrackingSucceededCallback = function() {
+ return this.sessionTrackingSucceededCallback;
};
-
-AdjustConfig.prototype.setNeedsCost = function(needsCost) {
- this.needsCost = needsCost;
+AdjustConfig.prototype.setSessionTrackingSucceededCallback = function(callback) {
+ this.sessionTrackingSucceededCallback = callback;
};
-
-AdjustConfig.prototype.setLogLevel = function(logLevel) {
- this.logLevel = logLevel;
+AdjustConfig.prototype.hasSessionTrackingSucceededCallback = function() {
+ return this.sessionTrackingSucceededCallback !== null;
};
-AdjustConfig.prototype.setProcessName = function(processName) {
- this.processName = processName;
-};
-AdjustConfig.prototype.setDefaultTracker = function(defaultTracker) {
- this.defaultTracker = defaultTracker;
+AdjustConfig.prototype.getSessionTrackingFailedCallback = function() {
+ return this.sessionTrackingFailedCallback;
};
-
-AdjustConfig.prototype.setExternalDeviceId = function(externalDeviceId) {
- this.externalDeviceId = externalDeviceId;
+AdjustConfig.prototype.setSessionTrackingFailedCallback = function(callback) {
+ this.sessionTrackingFailedCallback = callback;
};
-
-AdjustConfig.prototype.setUrlStrategy = function(urlStrategy) {
- this.urlStrategy = urlStrategy;
+AdjustConfig.prototype.hasSessionTrackingFailedCallback = function() {
+ return this.sessionTrackingFailedCallback !== null;
};
-AdjustConfig.prototype.setUserAgent = function(userAgent) {
- this.userAgent = userAgent;
-};
-AdjustConfig.prototype.setDeviceKnown = function(isDeviceKnown) {
- this.isDeviceKnown = isDeviceKnown;
+AdjustConfig.prototype.getDeferredDeeplinkCallback = function() {
+ return this.deferredDeeplinkCallback;
};
-
-AdjustConfig.prototype.getSdkPrefix = function() {
- return this.sdkPrefix;
+AdjustConfig.prototype.setDeferredDeeplinkCallback = function(callback) {
+ this.deferredDeeplinkCallback = callback;
};
-
-AdjustConfig.prototype.setSdkPrefix = function(sdkPrefix) {
- this.sdkPrefix = sdkPrefix;
+AdjustConfig.prototype.hasDeferredDeeplinkCallback = function() {
+ return this.deferredDeeplinkCallback !== null;
};
-// @deprecated
-AdjustConfig.prototype.setAllowiAdInfoReading = function(allowiAdInfoReading) {
- console.warn("Calling deprecated function! Apple Search Ads attribution with usage of iAd.framework has been sunset by Apple as of February 7th 2023.");
- // this.allowiAdInfoReading = allowiAdInfoReading;
-};
-AdjustConfig.prototype.setAllowAdServicesInfoReading = function(allowAdServicesInfoReading) {
- this.allowAdServicesInfoReading = allowAdServicesInfoReading;
+AdjustConfig.prototype.getSkanUpdatedCallback = function() {
+ return this.skanUpdatedCallback;
};
-
-AdjustConfig.prototype.setAllowIdfaReading = function(allowIdfaReading) {
- this.allowIdfaReading = allowIdfaReading;
+AdjustConfig.prototype.setSkanUpdatedCallback = function(callback) {
+ this.skanUpdatedCallback = callback;
};
-
-AdjustConfig.prototype.deactivateSKAdNetworkHandling = function() {
- this.handleSkAdNetwork = false;
+AdjustConfig.prototype.hasSkanUpdatedCallback = function() {
+ return this.skanUpdatedCallback !== null;
};
-AdjustConfig.prototype.setLinkMeEnabled = function(linkMeEnabled) {
- this.linkMeEnabled = linkMeEnabled;
+// Configuration fields - common
+AdjustConfig.prototype.enableSendingInBackground = function() {
+ this.isSendingInBackgroundEnabled = true;
};
-AdjustConfig.prototype.setAttConsentWaitingInterval = function(attConsentWaitingInterval) {
- this.attConsentWaitingInterval = attConsentWaitingInterval;
+AdjustConfig.prototype.enableCostDataInAttribution = function() {
+ this.isCostDataInAttributionEnabled = true;
};
-// @deprecated
-AdjustConfig.prototype.setReadMobileEquipmentIdentity = function(readMobileEquipmentIdentity) {
- console.warn("Calling deprecated function! This functionality has been removed from the SDK.");
- // this.readMobileEquipmentIdentity = readMobileEquipmentIdentity;
+AdjustConfig.prototype.enableDeviceIdsReadingOnce = function () {
+ this.isDeviceIdsReadingOnceEnabled = true;
};
-AdjustConfig.prototype.setAppSecret = function(secretId, info1, info2, info3, info4) {
- if (secretId !== null) {
- this.secretId = secretId.toString();
- }
- if (info1 !== null) {
- this.info1 = info1.toString();
- }
- if (info2 !== null) {
- this.info2 = info2.toString();
- }
- if (info3 !== null) {
- this.info3 = info3.toString();
- }
- if (info4 !== null) {
- this.info4 = info4.toString();
+AdjustConfig.prototype.setSdkPrefix = function(sdkPrefix) {
+ if (typeof sdkPrefix !== 'string') {
+ console.log("[Adjust] SDK prefix is not of type string");
+ return;
}
+ this.sdkPrefix = sdkPrefix;
};
-AdjustConfig.prototype.setDelayStart = function(delayStart) {
- this.delayStart = delayStart;
-};
-
-AdjustConfig.prototype.setReferrer = function(referrer) {
- this.referrer = referrer;
-};
-
-AdjustConfig.prototype.setSendInBackground = function(sendInBackground) {
- this.sendInBackground = sendInBackground;
-};
-
-AdjustConfig.prototype.setShouldLaunchDeeplink = function(shouldLaunchDeeplink) {
- this.shouldLaunchDeeplink = shouldLaunchDeeplink;
-};
-
-// @deprecated
-AdjustConfig.prototype.setCallbackListener = function(callbackListener) {
- console.warn("Calling deprecated function! Use the setAttributionCallbackListener instead. Check adjust_config.js for more info.");
- this.attributionCallback = callbackListener;
-};
-
-AdjustConfig.prototype.setAttributionCallbackListener = function(attributionCallback) {
- this.attributionCallback = attributionCallback;
-};
-
-AdjustConfig.prototype.setEventTrackingSucceededCallbackListener = function(eventTrackingSucceededCallback) {
- this.eventTrackingSucceededCallback = eventTrackingSucceededCallback;
-};
-
-AdjustConfig.prototype.setEventTrackingFailedCallbackListener = function(eventTrackingFailedCallback) {
- this.eventTrackingFailedCallback = eventTrackingFailedCallback;
-};
-
-AdjustConfig.prototype.setSessionTrackingSucceededCallbackListener = function(sessionTrackingSucceededCallback) {
- this.sessionTrackingSucceededCallback = sessionTrackingSucceededCallback;
-};
-
-AdjustConfig.prototype.setSessionTrackingFailedCallbackListener = function(sessionTrackingFailedCallback) {
- this.sessionTrackingFailedCallback = sessionTrackingFailedCallback;
+AdjustConfig.prototype.setLogLevel = function(logLevel) {
+ if (typeof logLevel !== 'string') {
+ console.log("[Adjust] Log level is not of type string");
+ return;
+ }
+ this.logLevel = logLevel;
};
-AdjustConfig.prototype.setDeferredDeeplinkCallbackListener = function(deferredDeeplinkCallback) {
- this.deferredDeeplinkCallback = deferredDeeplinkCallback;
+AdjustConfig.prototype.setDefaultTracker = function(defaultTracker) {
+ if (typeof defaultTracker !== 'string') {
+ console.log("[Adjust] Default tracker is not of type string");
+ return;
+ }
+ this.defaultTracker = defaultTracker;
};
-AdjustConfig.prototype.setConversionValueUpdatedCallbackListener = function(conversionValueUpdatedCallback) {
- this.conversionValueUpdatedCallback = conversionValueUpdatedCallback;
+AdjustConfig.prototype.setExternalDeviceId = function(externalDeviceId) {
+ if (typeof externalDeviceId !== 'string') {
+ console.log("[Adjust] External device ID is not of type string");
+ return;
+ }
+ this.externalDeviceId = externalDeviceId;
};
-AdjustConfig.prototype.setSkad4ConversionValueUpdatedCallbackListener = function(skad4ConversionValueUpdatedCallback) {
- this.skad4ConversionValueUpdatedCallback = skad4ConversionValueUpdatedCallback;
+AdjustConfig.prototype.setEventDeduplicationIdsMaxSize = function(eventDeduplicationIdsMaxSize) {
+ if (!Number.isInteger(eventDeduplicationIdsMaxSize)) {
+ console.log("[Adjust] Maximum number of event deduplication IDs is not of type integer");
+ return;
+ }
+ this.eventDeduplicationIdsMaxSize = eventDeduplicationIdsMaxSize;
};
-// @deprecated
-AdjustConfig.prototype.hasListener = function() {
- console.warn("Calling deprecated function! Use the hasAttributionListener instead. Check adjust_config.js for more info");
- return this.attributionCallback !== null;
+AdjustConfig.prototype.disableDeferredDeeplinkOpening = function() {
+ this.isDeferredDeeplinkOpeningEnabled = false;
};
-AdjustConfig.prototype.hasAttributionListener = function() {
- return this.attributionCallback !== null;
+AdjustConfig.prototype.enableCoppaCompliance = function() {
+ this.isCoppaComplianceEnabled = true;
};
-AdjustConfig.prototype.hasEventTrackingSucceededListener = function() {
- return this.eventTrackingSucceededCallback !== null;
+AdjustConfig.prototype.setProcessName = function(processName) {
+ this.processName = processName;
};
-AdjustConfig.prototype.hasEventTrackingFailedListener = function() {
- return this.eventTrackingFailedCallback !== null;
+AdjustConfig.prototype.enablePreinstallTracking = function() {
+ this.isPreinstallTrackingEnabled = true;
};
-AdjustConfig.prototype.hasSessionTrackingSucceededListener = function() {
- return this.sessionTrackingSucceededCallback !== null;
+AdjustConfig.prototype.setPreinstallFilePath = function(preinstallFilePath) {
+ if (typeof preinstallFilePath !== 'string') {
+ console.log("[Adjust] Preinstall file path is not of type string");
+ return;
+ }
+ this.preinstallFilePath = preinstallFilePath;
};
-AdjustConfig.prototype.hasSessionTrackingFailedListener = function() {
- return this.sessionTrackingFailedCallback !== null;
+AdjustConfig.prototype.enablePlayStoreKidsCompliance = function () {
+ this.isPlayStoreKidsComplianceEnabled = true;
};
-AdjustConfig.prototype.hasDeferredDeeplinkCallbackListener = function() {
- return this.deferredDeeplinkCallback !== null;
+AdjustConfig.prototype.setFbAppId = function (fbAppId) {
+ if (typeof fbAppId !== 'string') {
+ console.log("[Adjust] FB app ID is not of type string");
+ return;
+ }
+ this.fbAppId = fbAppId;
};
-AdjustConfig.prototype.hasConversionValueUpdatedCallbackListener = function() {
- return this.conversionValueUpdatedCallback !== null;
+// Configuration fields - iOS only
+AdjustConfig.prototype.disableAdServices = function() {
+ this.isAdServicesEnabled = false;
};
-AdjustConfig.prototype.hasSkad4ConversionValueUpdatedCallbackListener = function() {
- return this.skad4ConversionValueUpdatedCallback !== null;
+AdjustConfig.prototype.disableIdfaReading = function() {
+ this.isIdfaReadingEnabled = false;
};
-AdjustConfig.prototype.setCoppaCompliantEnabled = function (isEnabled) {
- this.coppaCompliantEnabled = isEnabled;
+AdjustConfig.prototype.disableIdfvReading = function() {
+ this.isIdfvReadingEnabled = false;
};
-AdjustConfig.prototype.setReadDeviceInfoOnceEnabled = function (isEnabled) {
- this.readDeviceInfoOnceEnabled = isEnabled;
+AdjustConfig.prototype.disableSkanAttribution = function() {
+ this.isSkanAttributionEnabled = false;
};
-AdjustConfig.prototype.setPlayStoreKidsAppEnabled = function (isEnabled) {
- this.playStoreKidsAppEnabled = isEnabled;
+AdjustConfig.prototype.enableLinkMe = function() {
+ this.isLinkMeEnabled = true;
};
-AdjustConfig.prototype.setFinalAndroidAttributionEnabled = function (isEnabled) {
- this.finalAndroidAttributionEnabled = isEnabled;
+AdjustConfig.prototype.setAttConsentWaitingInterval = function(attConsentWaitingInterval) {
+ if (!Number.isInteger(attConsentWaitingInterval)) {
+ console.log("[Adjust] ATT consent waiting interval is not of type integer");
+ return;
+ }
+ this.attConsentWaitingInterval = attConsentWaitingInterval;
};
-AdjustConfig.prototype.setFbAppId = function (fbAppId) {
- this.fbAppId = fbAppId;
+AdjustConfig.prototype.setUrlStrategy = function(urlStrategyDomains, useSubdomains, isDataResidency) {
+ if (!Array.isArray(urlStrategyDomains) ||
+ typeof useSubdomains !== 'boolean' ||
+ typeof isDataResidency !== 'boolean') {
+ console.log("[Adjust] URL strategy parameters are not of a proper data types");
+ return;
+ }
+ this.urlStrategyDomains = urlStrategyDomains;
+ this.useSubdomains = useSubdomains;
+ this.isDataResidency = isDataResidency;
};
module.exports = AdjustConfig;
diff --git a/www/adjust_deeplink.js b/www/adjust_deeplink.js
new file mode 100644
index 00000000..32542aa4
--- /dev/null
+++ b/www/adjust_deeplink.js
@@ -0,0 +1,5 @@
+function AdjustDeeplink(deeplink) {
+ this.deeplink = deeplink;
+}
+
+module.exports = AdjustDeeplink;
\ No newline at end of file
diff --git a/www/adjust_event.js b/www/adjust_event.js
index 6cfa6f90..ae22cef6 100644
--- a/www/adjust_event.js
+++ b/www/adjust_event.js
@@ -2,63 +2,83 @@ function AdjustEvent(eventToken) {
this.eventToken = eventToken;
this.revenue = null;
this.currency = null;
- this.productId = null;
- this.transactionId = null;
+ this.deduplicationId = null;
this.callbackId = null;
+ this.productId = null;
this.callbackParameters = [];
this.partnerParameters = [];
// iOS only
- this.receipt = null;
- this.isReceiptSet = false;
+ this.transactionId = null;
// Android only
this.purchaseToken = null;
}
AdjustEvent.prototype.setRevenue = function(revenue, currency) {
+ if (typeof revenue !== 'number' || typeof currency !== 'string') {
+ console.log("[Adjust] Event revenue or currency is not of a proper data type");
+ }
this.revenue = revenue;
this.currency = currency;
};
AdjustEvent.prototype.addCallbackParameter = function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Event callback parameter key or value is not of type string");
+ return;
+ }
this.callbackParameters.push(key);
this.callbackParameters.push(value);
};
AdjustEvent.prototype.addPartnerParameter = function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Event partner parameter key or value is not of type string");
+ return;
+ }
this.partnerParameters.push(key);
this.partnerParameters.push(value);
};
AdjustEvent.prototype.setCallbackId = function(callbackId) {
+ if (typeof callbackId !== 'string') {
+ console.log("[Adjust] Event callback ID is not of type string");
+ return;
+ }
this.callbackId = callbackId;
};
+AdjustEvent.prototype.setDeduplicationId = function(deduplicationId) {
+ if (typeof deduplicationId !== 'string') {
+ console.log("[Adjust] Event deduplication ID is not of type string");
+ return;
+ }
+ this.deduplicationId = deduplicationId;
+};
+
AdjustEvent.prototype.setProductId = function(productId) {
+ if (typeof productId !== 'string') {
+ console.log("[Adjust] Event product ID is not of type string");
+ return;
+ }
this.productId = productId;
};
AdjustEvent.prototype.setTransactionId = function(transactionId) {
+ if (typeof transactionId !== 'string') {
+ console.log("[Adjust] Event transaction ID is not of type string");
+ return;
+ }
this.transactionId = transactionId;
};
-// iOS only
-
-AdjustEvent.prototype.setReceipt = function(receipt) {
- this.receipt = receipt;
-};
-
// Android only
AdjustEvent.prototype.setPurchaseToken = function(purchaseToken) {
+ if (typeof purchaseToken !== 'string') {
+ console.log("[Adjust] Event purchase token is not of type string");
+ return;
+ }
this.purchaseToken = purchaseToken;
};
-// @deprecated
-AdjustEvent.prototype.setReceiptForTransactionId = function(receipt, transactionId) {
- console.warn("Calling deprecated function! Please use official purchase verification method.");
- // this.receipt = receipt;
- // this.transactionId = transactionId;
- // this.isReceiptSet = true;
-};
-
-module.exports = AdjustEvent;
+module.exports = AdjustEvent;
\ No newline at end of file
diff --git a/www/adjust_play_store_subscription.js b/www/adjust_play_store_subscription.js
index dc13d59f..bf454c9e 100644
--- a/www/adjust_play_store_subscription.js
+++ b/www/adjust_play_store_subscription.js
@@ -11,17 +11,29 @@ function AdjustPlayStoreSubscription(price, currency, sku, orderId, signature, p
}
AdjustPlayStoreSubscription.prototype.setPurchaseTime = function(purchaseTime) {
+ if (!Number.isInteger(purchaseTime)) {
+ console.log("[Adjust] Play Store subscription purchase time is not of type integer");
+ return;
+ }
this.purchaseTime = purchaseTime;
};
AdjustPlayStoreSubscription.prototype.addCallbackParameter = function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Play Store subscription callback parameter key or value is not of type string");
+ return;
+ }
this.callbackParameters.push(key);
this.callbackParameters.push(value);
};
AdjustPlayStoreSubscription.prototype.addPartnerParameter = function(key, value) {
+ if (typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Play Store subscription partner parameter key or value is not of type string");
+ return;
+ }
this.partnerParameters.push(key);
this.partnerParameters.push(value);
};
-module.exports = AdjustPlayStoreSubscription;
+module.exports = AdjustPlayStoreSubscription;
\ No newline at end of file
diff --git a/www/adjust_third_party_sharing.js b/www/adjust_third_party_sharing.js
index 8cc734ff..25d9c326 100644
--- a/www/adjust_third_party_sharing.js
+++ b/www/adjust_third_party_sharing.js
@@ -10,6 +10,7 @@ function AdjustThirdPartySharing(isEnabled) {
AdjustThirdPartySharing.prototype.addGranularOption = function(partnerName, key, value) {
if (typeof partnerName !== 'string' || typeof key !== 'string' || typeof value !== 'string') {
+ console.log("[Adjust] Granular option parameterName, key or value is not of a type string");
return;
}
this.granularOptions.push(partnerName);
@@ -19,6 +20,7 @@ AdjustThirdPartySharing.prototype.addGranularOption = function(partnerName, key,
AdjustThirdPartySharing.prototype.addPartnerSharingSetting = function(partnerName, key, value) {
if (typeof partnerName !== 'string' || typeof key !== 'string' || typeof value !== 'boolean') {
+ console.log("[Adjust] Partner sharing setting parameters are not of a proper data type");
return;
}
this.partnerSharingSettings.push(partnerName);
@@ -26,4 +28,4 @@ AdjustThirdPartySharing.prototype.addPartnerSharingSetting = function(partnerNam
this.partnerSharingSettings.push(value);
};
-module.exports = AdjustThirdPartySharing;
+module.exports = AdjustThirdPartySharing;
\ No newline at end of file