Skip to content

Commit

Permalink
Merge pull request #44 from adjust/v4370
Browse files Browse the repository at this point in the history
Version 4.37.0
  • Loading branch information
uerceg authored Jan 22, 2024
2 parents 8189ea0 + ab7bca4 commit bb80d08
Show file tree
Hide file tree
Showing 70 changed files with 1,827 additions and 190 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
### Version 4.37.0 (22nd January 2024)
#### Added
- Added support for SKAD 4.0.
- Added ability to verify purchase events.
- Added ability to read App Set ID on Android platform in case you opt in by adding the `com.google.android.gms:play-services-appset` dependency to your Android app.
- Added ability to delay SDK start on iOS platform in order to wait for an answer to the ATT dialog. You can set the number of seconds to wait (capped internally to 120) by calling the `setAttConsentWaitingInterval` method of the `AdjustConfig2dx` instance.
- Added support for SigV3 library. Update authorization header building logic to use `adj_signing_id`.
- Added ability to indicate if only final Android attribution is needed in attribution callback (by default attribution callback return intermediate attribution as well before final attribution if not enabled with this setter method) calling the `setFinalAttributionEnabled` method of the `AdjustConfig2dx` instance.
- Added ability to get IDFV value of the iOS device. You can achieve this by invoking `getIdfv()` method of the `Adjust2dx` instance.
- Added support for Meta install referrer.
- Added support for Google Play Games on PC.
- Added support for `TopOn` and `AD(X)` ad revenue tracking.
- Added `setReadDeviceInfoOnceEnabled` method to `AdjustConfig2dx` to indicate if device info should be read only once.
- Added ability to process shortened deep links and provide the unshortened link back as a response. You can achieve this by invoking `processDeeplink` method of the `Adjust2dx` instance.
- Added support for setting a new China URL strategy (with fallback to other endpoints) and China only URL strategy (without fallbacks). You can choose this setting by calling `setUrlStrategy` method of `AdjustConfig2dx` instance with `AdjustUrlStrategyCn` / `AdjustUrlStrategyCnOnly` parameter.

#### Native SDKs
- [iOS@v4.37.0][ios_sdk_v4.37.0]
- [Android@v4.38.0][android_sdk_v4.38.0]

---

### Version 4.32.0 (20th October 2022)
#### Added
- Added ability to mark your app as COPPA compliant. You can enable this setting by calling `setCoppaCompliantEnabled` method of `AdjustConfig2dx` instance with boolean parameter `true`.
Expand Down Expand Up @@ -392,6 +414,7 @@
[ios_sdk_v4.28.0]: https://github.com/adjust/ios_sdk/tree/v4.28.0
[ios_sdk_v4.29.6]: https://github.com/adjust/ios_sdk/tree/v4.29.6
[ios_sdk_v4.32.1]: https://github.com/adjust/ios_sdk/tree/v4.32.1
[ios_sdk_v4.37.0]: https://github.com/adjust/ios_sdk/tree/v4.37.0

[android_sdk_v4.0.8]: https://github.com/adjust/android_sdk/tree/v4.0.8
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
Expand All @@ -415,5 +438,6 @@
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0
[android_sdk_v4.28.4]: https://github.com/adjust/android_sdk/tree/v4.28.4
[android_sdk_v4.33.0]: https://github.com/adjust/android_sdk/tree/v4.33.0
[android_sdk_v4.38.0]: https://github.com/adjust/android_sdk/tree/v4.38.0

[windows_sdk_v4.0.3]: https://github.com/adjust/windows_sdk/tree/v4.0.3
166 changes: 140 additions & 26 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.32.0
4.37.0
7 changes: 7 additions & 0 deletions dist/ADJAdjust2dx.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "ADJAppStoreSubscription2dx.h"
#include "ADJThirdPartySharing2dx.h"
#include "ADJAdRevenue2dx.h"
#include "ADJAppStorePurchase2dx.h"
#include "AdjustAttribution2dx.h"

extern const std::string ADJEnvironmentSandbox2dx;
Expand Down Expand Up @@ -53,8 +54,14 @@ class ADJAdjust2dx {
static void trackThirdPartySharing(ADJThirdPartySharing2dx thirdPartySharing);
static void trackMeasurementConsent(bool measurementConsent);
static void updateConversionValue(int conversionValue);
static void updatePostbackConversionValue(int conversionValue, void (*errorCallback)(std::string error));
static void updatePostbackConversionValue(int conversionValue, std::string coarseValue, void (*errorCallback)(std::string error));
static void updatePostbackConversionValue(int conversionValue, std::string coarseValue, bool lockWindow, void (*errorCallback)(std::string error));
static void checkForNewAttStatus();
static std::string getLastDeeplink();
static void verifyAppStorePurchase(ADJAppStorePurchase2dx purchase, void (*verificationCallback)(std::string verificationStatus, int code, std::string message));
static std::string getIdfv();
static void processDeeplink(std::string url, void (*resolvedLinkCallback)(std::string resolvedLink));
// For testing purposes only.
static void setTestOptions(std::map<std::string, std::string> testOptionsMap);
static void teardown();
Expand Down
118 changes: 91 additions & 27 deletions dist/ADJAdjust2dx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,33 @@
BOOL isSessionFailureCallbackImplemented = NULL != adjustConfig.getSessionFailureCallback() ? YES : NO;
BOOL isDeferredDeeplinkCallbackImplemented = NULL != adjustConfig.getDeferredDeeplinkCallback() ? YES : NO;
BOOL isConversionValueUpdatedListenerImplemented = NULL != adjustConfig.getConversionValueUpdatedCallback() ? YES : NO;

BOOL isPostbackConversionValueUpdatedCallbackImplemented = NULL != adjustConfig.getPostbackConversionValueUpdatedCallback() ? YES : NO;

if (isAttributionCallbackImplemented
|| isEventSuccessCallbackImplemented
|| isEventFailureCallbackImplemented
|| isSessionSuccessCallbackImplemented
|| isSessionFailureCallbackImplemented
|| isDeferredDeeplinkCallbackImplemented
|| isConversionValueUpdatedListenerImplemented) {
((ADJConfig *)adjustConfig.getConfig()).delegate = [ADJDelegate2dx getInstanceWithSwizzleOfAttributionCallback:isAttributionCallbackImplemented
swizzleOfEventSuccessCallback:isEventSuccessCallbackImplemented
swizzleOfEventFailureCallback:isEventFailureCallbackImplemented
swizzleOfSessionSuccessCallback:isSessionSuccessCallbackImplemented
swizzleOfSessionFailureCallback:isSessionFailureCallbackImplemented
swizzleOfDeferredDeeplinkCallback:isDeferredDeeplinkCallbackImplemented
swizzleOfConversionValueUpdatedCallback:isConversionValueUpdatedListenerImplemented
andAttributionCallbackId:adjustConfig.getAttributionCallback()
eventSuccessCallbackId:adjustConfig.getEventSuccessCallback()
eventFailureCallbackId:adjustConfig.getEventFailureCallback()
sessionSuccessCallbackId:adjustConfig.getSessionSuccessCallback()
sessionFailureCallbackId:adjustConfig.getSessionFailureCallback()
deferredDeeplinkCallbackId:adjustConfig.getDeferredDeeplinkCallback()
conversionValueUpdatedCallbackId:adjustConfig.getConversionValueUpdatedCallback()];
|| isConversionValueUpdatedListenerImplemented
|| isPostbackConversionValueUpdatedCallbackImplemented) {
((ADJConfig *)adjustConfig.getConfig()).delegate =
[ADJDelegate2dx getInstanceWithSwizzleOfAttributionCallback:isAttributionCallbackImplemented
swizzleOfEventSuccessCallback:isEventSuccessCallbackImplemented
swizzleOfEventFailureCallback:isEventFailureCallbackImplemented
swizzleOfSessionSuccessCallback:isSessionSuccessCallbackImplemented
swizzleOfSessionFailureCallback:isSessionFailureCallbackImplemented
swizzleOfDeferredDeeplinkCallback:isDeferredDeeplinkCallbackImplemented
swizzleOfConversionValueUpdatedCallback:isConversionValueUpdatedListenerImplemented
swizzleOfPostbackConversionValueUpdatedCallback:isPostbackConversionValueUpdatedCallbackImplemented
andAttributionCallbackId:adjustConfig.getAttributionCallback()
eventSuccessCallbackId:adjustConfig.getEventSuccessCallback()
eventFailureCallbackId:adjustConfig.getEventFailureCallback()
sessionSuccessCallbackId:adjustConfig.getSessionSuccessCallback()
sessionFailureCallbackId:adjustConfig.getSessionFailureCallback()
deferredDeeplinkCallbackId:adjustConfig.getDeferredDeeplinkCallback()
conversionValueUpdatedCallbackId:adjustConfig.getConversionValueUpdatedCallback()
postbackConversionValueUpdatedCallbackId:adjustConfig.getPostbackConversionValueUpdatedCallback()];
}

[Adjust appDidLaunch:(ADJConfig *)adjustConfig.getConfig()];
Expand All @@ -56,6 +61,16 @@
[Adjust trackSubscription:(ADJSubscription *)subscription.getSubscription()];
}

void ADJAdjust2dx::verifyAppStorePurchase(ADJAppStorePurchase2dx purchase, void (*verificationCallback)(std::string verificationStatus, int code, std::string message)) {
[Adjust verifyPurchase:(ADJPurchase *)purchase.getPurchase() completionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
if (verificationCallback != NULL) {
verificationCallback(std::string([verificationResult.verificationStatus UTF8String]),
verificationResult.code,
std::string([verificationResult.message UTF8String]));
}
}];
}

void ADJAdjust2dx::trackSubsessionStart() {
[Adjust trackSubsessionStart];
}
Expand Down Expand Up @@ -132,12 +147,13 @@
}

std::string ADJAdjust2dx::getIdfa() {
if (nil == [Adjust idfa]) {
NSString *idfa = [Adjust idfa];
if (nil == idfa) {
return "";
}

std::string idfa = std::string([[Adjust idfa] UTF8String]);
return idfa;
std::string strIdfa = std::string([idfa UTF8String]);
return strIdfa;
}

std::string ADJAdjust2dx::getAdid() {
Expand Down Expand Up @@ -227,7 +243,9 @@

void ADJAdjust2dx::requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status)) {
[Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
trackingStatusCallback((int)status);
if (trackingStatusCallback != NULL) {
trackingStatusCallback((int)status);
}
}];
}

Expand All @@ -239,6 +257,35 @@
[Adjust updateConversionValue:conversionValue];
}

void ADJAdjust2dx::updatePostbackConversionValue(int conversionValue, void (*errorCallback)(std::string error)) {
[Adjust updatePostbackConversionValue:conversionValue completionHandler:^(NSError * _Nullable error) {
if (errorCallback != NULL) {
errorCallback(std::string([error.localizedDescription UTF8String]));
}
}];
}

void ADJAdjust2dx::updatePostbackConversionValue(int conversionValue, std::string coarseValue, void (*errorCallback)(std::string error)) {
[Adjust updatePostbackConversionValue:conversionValue
coarseValue:[NSString stringWithUTF8String:coarseValue.c_str()]
completionHandler:^(NSError * _Nullable error) {
if (errorCallback != NULL) {
errorCallback(std::string([error.localizedDescription UTF8String]));
}
}];
}

void ADJAdjust2dx::updatePostbackConversionValue(int conversionValue, std::string coarseValue, bool lockWindow, void (*errorCallback)(std::string error)) {
[Adjust updatePostbackConversionValue:conversionValue
coarseValue:[NSString stringWithUTF8String:coarseValue.c_str()]
lockWindow:lockWindow
completionHandler:^(NSError * _Nullable error) {
if (errorCallback != NULL) {
errorCallback(std::string([error.localizedDescription UTF8String]));
}
}];
}

void ADJAdjust2dx::trackThirdPartySharing(ADJThirdPartySharing2dx thirdPartySharing) {
[Adjust trackThirdPartySharing:(ADJThirdPartySharing *)thirdPartySharing.getThirdPartySharing()];
}
Expand All @@ -265,11 +312,35 @@
return stdStrLastDeeplink;
}

std::string ADJAdjust2dx::getIdfv() {
NSString *idfv = [Adjust idfv];
if (nil == idfv) {
return "";
}

std::string strIdfv = std::string([idfv UTF8String]);
return strIdfv;
}

void ADJAdjust2dx::processDeeplink(std::string url, void (*resolvedLinkCallback)(std::string resolvedLink)) {
NSURL *pUrl = [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]];
[Adjust processDeeplink:pUrl completionHandler:^(NSString * _Nonnull resolvedLink) {
if (resolvedLinkCallback != NULL) {
if (resolvedLink != nil) {
resolvedLinkCallback(std::string([resolvedLink UTF8String]));
} else {
resolvedLinkCallback("");
}
}
}];
}

void ADJAdjust2dx::setTestOptions(std::map<std::string, std::string> testOptionsMap) {
AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
testOptions.baseUrl = [NSString stringWithUTF8String:testOptionsMap["baseUrl"].c_str()];
testOptions.gdprUrl = [NSString stringWithUTF8String:testOptionsMap["gdprUrl"].c_str()];
testOptions.subscriptionUrl = [NSString stringWithUTF8String:testOptionsMap["subscriptionUrl"].c_str()];
testOptions.purchaseVerificationUrl = [NSString stringWithUTF8String:testOptionsMap["purchaseVerificationUrl"].c_str()];

if (testOptionsMap.find("extraPath") != testOptionsMap.end()) {
testOptions.extraPath = [NSString stringWithUTF8String:testOptionsMap["extraPath"].c_str()];
Expand Down Expand Up @@ -311,13 +382,6 @@
testOptions.noBackoffWait = YES;
}
}
testOptions.iAdFrameworkEnabled = NO;
if (testOptionsMap.find("iAdFrameworkEnabled") != testOptionsMap.end()) {
NSString *iAdFrameworkEnabled = [NSString stringWithUTF8String:testOptionsMap["iAdFrameworkEnabled"].c_str()];
if ([iAdFrameworkEnabled isEqualToString:@"true"]) {
testOptions.iAdFrameworkEnabled = YES;
}
}
testOptions.adServicesFrameworkEnabled = NO;
if (testOptionsMap.find("adServicesFrameworkEnabled") != testOptionsMap.end()) {
NSString *adServicesFrameworkEnabled = [NSString stringWithUTF8String:testOptionsMap["adServicesFrameworkEnabled"].c_str()];
Expand Down
28 changes: 28 additions & 0 deletions dist/ADJAppStorePurchase2dx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// ADJAppStorePurchase2dx.h
// Adjust SDK
//
// Created by Uglješa Erceg (@uerceg) on 17th January 2024.
// Copyright © 2015-Present Adjust GmbH. All rights reserved.
//

#ifndef _ADJUST_ADJAPPSTOREPURCHASE2DX_H_
#define _ADJUST_ADJAPPSTOREPURCHASE2DX_H_

#include <iostream>

class ADJAppStorePurchase2dx {
private:
void* purchase;
void initPurchase(std::string productId, std::string transactionId, std::string receipt);

public:
ADJAppStorePurchase2dx() {}
ADJAppStorePurchase2dx(std::string productId, std::string transactionId, std::string receipt) {
initPurchase(productId, transactionId, receipt);
}

void* getPurchase();
};

#endif /* _ADJUST_ADJAPPSTOREPURCHASE2DX_H_ */
23 changes: 23 additions & 0 deletions dist/ADJAppStorePurchase2dx.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// ADJAppStorePurchase2dx.mm
// Adjust SDK
//
// Created by Uglješa Erceg (@uerceg) on 17th January 2024.
// Copyright © 2015-Present Adjust GmbH. All rights reserved.
//

#include "ADJAppStorePurchase2dx.h"
#include <AdjustSdk/ADJPurchase.h>

void ADJAppStorePurchase2dx::initPurchase(std::string productId, std::string transactionId, std::string receipt) {
NSString *strProductId = [NSString stringWithUTF8String:productId.c_str()];
NSString *strTransactionId = [NSString stringWithUTF8String:transactionId.c_str()];
NSString *strReceipt = [NSString stringWithUTF8String:receipt.c_str()];
purchase = [[ADJPurchase alloc] initWithTransactionId:strTransactionId
productId:strProductId
andReceipt:[strReceipt dataUsingEncoding:NSUTF8StringEncoding]];
}

void* ADJAppStorePurchase2dx::getPurchase() {
return purchase;
}
5 changes: 5 additions & 0 deletions dist/ADJConfig2dx.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ADJConfig2dx {
void (*sessionFailureCallback)(AdjustSessionFailure2dx sessionFailure) = NULL;
bool (*deferredDeeplinkCallback)(std::string deeplink) = NULL;
void (*conversionValueUpdatedCallback)(int conversionValue) = NULL;
void (*postbackConversionValueUpdatedCallback)(int conversionValue, std::string coarseValue, bool lockWindow) = NULL;
void initConfig(std::string appToken, std::string environment, bool allowSuppressLogLevel, std::string sdkPrefix);

public:
Expand Down Expand Up @@ -64,13 +65,16 @@ class ADJConfig2dx {
void deactivateSkAdNetworkHandling();
void setCoppaCompliantEnabled(bool isEnabled);
void setLinkMeEnabled(bool isEnabled);
void setAttConsentWaitingInterval(int numberOfSeconds);
void setAttributionCallback(void(*callbackMethod)(AdjustAttribution2dx attribution));
void setEventSuccessCallback(void(*callbackMethod)(AdjustEventSuccess2dx eventSuccess));
void setEventFailureCallback(void(*callbackMethod)(AdjustEventFailure2dx eventFailure));
void setSessionSuccessCallback(void(*callbackMethod)(AdjustSessionSuccess2dx sessionSuccess));
void setSessionFailureCallback(void(*callbackMethod)(AdjustSessionFailure2dx sessionFailure));
void setDeferredDeeplinkCallback(bool(*callbackMethod)(std::string deeplink));
void setConversionValueUpdatedCallback(void(*callbackMethod)(int conversionValue));
void setPostbackConversionValueUpdatedCallback(void(*callbackMethod)(int conversionValue, std::string coarseValue, bool lockWindow));
void setReadDeviceInfoOnceEnabled(bool isEnabled);
void* getConfig();
void(*getAttributionCallback())(AdjustAttribution2dx);
void(*getEventSuccessCallback())(AdjustEventSuccess2dx);
Expand All @@ -79,6 +83,7 @@ class ADJConfig2dx {
void(*getSessionFailureCallback())(AdjustSessionFailure2dx);
bool(*getDeferredDeeplinkCallback())(std::string);
void(*getConversionValueUpdatedCallback())(int);
void(*getPostbackConversionValueUpdatedCallback())(int, std::string, bool);
};

#endif /* _ADJUST_ADJCONFIG2DX_H_ */
Loading

0 comments on commit bb80d08

Please sign in to comment.