Skip to content

Commit

Permalink
Merge pull request #261 from AppsFlyerSDK/releases/6.x.x/6.13.x/6.13.…
Browse files Browse the repository at this point in the history
…0-rc2

Releases/6.x.x/6.13.x/6.13.0 rc2
af-vero authored Feb 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 7476d82 + 571941b commit 262b140
Showing 23 changed files with 424 additions and 34 deletions.
42 changes: 41 additions & 1 deletion Assets/AppsFlyer/AppsFlyer.cs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ namespace AppsFlyerSDK
public class AppsFlyer : MonoBehaviour
{

public static readonly string kAppsFlyerPluginVersion = "6.12.22";
public static readonly string kAppsFlyerPluginVersion = "6.13.0";
public static string CallBackObjectName = null;
private static EventHandler onRequestResponse;
private static EventHandler onInAppResponse;
@@ -222,6 +222,21 @@ public static void setAppInviteOneLinkID(string oneLinkId)
}


}

/// <summary>
/// Set the deepLink timeout value that should be used for DDL.
/// </summary>
/// <param name="deepLinkTimeout">deepLink timeout in milliseconds.</param>
public static void setDeepLinkTimeout(long deepLinkTimeout)
{

if (instance != null)
{
instance.setDeepLinkTimeout(deepLinkTimeout);
}


}

/// <summary>
@@ -306,6 +321,18 @@ public static void setCurrencyCode(string currencyCode)
}
}

/// <summary>
/// Sets or updates the user consent data related to GDPR and DMA regulations for advertising and data usage purposes within the application.
/// </summary>
/// <param name = "appsFlyerConsent" >instance of AppsFlyerConsent.</param>
public static void setConsentData(AppsFlyerConsent appsFlyerConsent)
{
if (instance != null)
{
instance.setConsentData(appsFlyerConsent);
}
}

/// <summary>
/// Manually record the location of the user.
/// </summary>
@@ -339,6 +366,19 @@ public static void anonymizeUser(bool shouldAnonymizeUser)

}

/// <summary>
/// Calling enableTCFDataCollection(true) will enable collecting and sending any TCF related data.
/// Calling enableTCFDataCollection(false) will disable the collection of TCF related data and from sending it.
/// </summary>
/// <param name = "shouldCollectTcfData" >should start TCF Data collection boolean.</param>
public static void enableTCFDataCollection(bool shouldCollectTcfData)
{
if (instance != null)
{
instance.enableTCFDataCollection(shouldCollectTcfData);
}
}

/// <summary>
/// Get AppsFlyer's unique device ID which is created for every new install of an app.
/// </summary>
35 changes: 35 additions & 0 deletions Assets/AppsFlyer/AppsFlyerAndroid.cs
Original file line number Diff line number Diff line change
@@ -197,6 +197,17 @@ public void setAdditionalData(Dictionary<string, string> customData)
#endif
}

//// <summary>
/// Set the deepLink timeout value that should be used for DDL.
/// </summary>
/// <param name="deepLinkTimeout">deepLink timeout in milliseconds.</param>
public void setDeepLinkTimeout(long deepLinkTimeout)
{
#if !UNITY_EDITOR
appsFlyerAndroid.CallStatic("setDeepLinkTimeout", deepLinkTimeout);
#endif
}

/// <summary>
/// Set the user emails.
/// </summary>
@@ -353,6 +364,18 @@ public void anonymizeUser(bool isDisabled)
#endif
}

/// <summary>
/// Calling enableTCFDataCollection(true) will enable collecting and sending any TCF related data.
/// Calling enableTCFDataCollection(false) will disable the collection of TCF related data and from sending it.
/// </summary>
/// <param name = "shouldCollectTcfData" >should start TCF Data collection boolean.</param>
public void enableTCFDataCollection(bool shouldCollectTcfData)
{
#if !UNITY_EDITOR
appsFlyerAndroid.CallStatic("enableTCFDataCollection", shouldCollectTcfData);
#endif
}

/// <summary>
/// Enable the collection of Facebook Deferred AppLinks.
/// Requires Facebook SDK and Facebook app on target/client device.
@@ -366,6 +389,18 @@ public void enableFacebookDeferredApplinks(bool isEnabled)
#endif
}

/// <summary>
/// Sets or updates the user consent data related to GDPR and DMA regulations for advertising and data usage purposes within the application.
/// call this method when GDPR user is true
/// </summary>
/// <param name = "hasConsentForDataUsage" >hasConsentForDataUsage boolean.</param>
/// <param name = "hasConsentForAdsPersonalization" >hasConsentForAdsPersonalization boolean.</param>
public void setConsentData(AppsFlyerConsent appsFlyerConsent)
{
#if !UNITY_EDITOR
appsFlyerAndroid.CallStatic("setConsentData", appsFlyerConsent.isUserSubjectToGDPR, appsFlyerConsent.hasConsentForDataUsage, appsFlyerConsent.hasConsentForAdsPersonalization);
#endif
}

/// <summary>
/// Restrict reengagement via deep-link to once per each unique deep-link.
51 changes: 51 additions & 0 deletions Assets/AppsFlyer/AppsFlyerConsent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;

namespace AppsFlyerSDK
{
/// <summary>
// Data class representing a user's consent for data processing in accordance with GDPR and DMA
// (Digital Markets Act) compliance, specifically regarding advertising preferences.

// This class should be used to notify and record the user's applicability
// under GDPR, their general consent to data usage, and their consent to personalized
// advertisements based on user data.

// Note that the consent for data usage and ads personalization pair is only applicable when the user is
// subject to GDPR guidelines. Therefore, the following factory methods should be used accordingly:
// - Use [forGDPRUser] when the user is subject to GDPR.
// - Use [forNonGDPRUser] when the user is not subject to GDPR.

// @property isUserSubjectToGDPR Indicates whether GDPR regulations apply to the user (true if the user is
// a subject of GDPR). It also serves as a flag for compliance with relevant aspects of DMA regulations.
// @property hasConsentForDataUsage Indicates whether the user has consented to the use of their data for advertising
// purposes under both GDPR and DMA guidelines (true if the user has consented, nullable if not subject to GDPR).
// @property hasConsentForAdsPersonalization Indicates whether the user has consented to the use of their data for
// personalized advertising within the boundaries of GDPR and DMA rules (true if the user has consented to
// personalized ads, nullable if not subject to GDPR).
/// </summary>
public class AppsFlyerConsent
{
public bool isUserSubjectToGDPR { get; private set; }
public bool hasConsentForDataUsage { get; private set; }
public bool hasConsentForAdsPersonalization { get; private set; }

private AppsFlyerConsent(bool isGDPR, bool hasForDataUsage, bool hasForAdsPersonalization)
{
isUserSubjectToGDPR = isGDPR;
hasConsentForDataUsage = hasForDataUsage;
hasConsentForAdsPersonalization = hasForAdsPersonalization;
}

public static AppsFlyerConsent ForGDPRUser(bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization)
{
return new AppsFlyerConsent(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);
}

public static AppsFlyerConsent ForNonGDPRUser()
{
return new AppsFlyerConsent(false, false, false);
}
}

}
11 changes: 11 additions & 0 deletions Assets/AppsFlyer/AppsFlyerConsent.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions Assets/AppsFlyer/AppsFlyeriOS.cs
Original file line number Diff line number Diff line change
@@ -185,6 +185,40 @@ public void setAppInviteOneLinkID(string appInviteOneLinkID)
#endif
}

/// <summary>
/// Set the deepLink timeout value that should be used for DDL.
/// </summary>
/// <param name="deepLinkTimeout">deepLink timeout in milliseconds.</param>
public void setDeepLinkTimeout(long deepLinkTimeout)
{
#if !UNITY_EDITOR
_setDeepLinkTimeout(deepLinkTimeout);
#endif
}

/// <summary>
/// Calling enableTCFDataCollection(true) will enable collecting and sending any TCF related data.
/// Calling enableTCFDataCollection(false) will disable the collection of TCF related data and from sending it.
/// </summary>
/// <param name = "shouldCollectTcfData" >should start TCF Data collection boolean.</param>
public void enableTCFDataCollection(bool shouldCollectTcfData)
{
#if !UNITY_EDITOR
_enableTCFDataCollection(shouldCollectTcfData);
#endif
}

/// <summary>
/// Sets or updates the user consent data related to GDPR and DMA regulations for advertising and data usage purposes within the application.
/// </summary>
/// <param name = "appsFlyerConsent" >instance of AppsFlyerConsent.</param>
public void setConsentData(AppsFlyerConsent appsFlyerConsent)
{
#if !UNITY_EDITOR
_setConsentData(appsFlyerConsent.isUserSubjectToGDPR, appsFlyerConsent.hasConsentForDataUsage, appsFlyerConsent.hasConsentForAdsPersonalization);
#endif
}

/// <summary>
/// Anonymize user Data.
/// Use this API during the SDK Initialization to explicitly anonymize a user's installs, events and sessions.
@@ -675,13 +709,34 @@ public static void getCallback(string gameObjectName, string callbackName, strin
#endif
private static extern void _setAppInviteOneLinkID(string appInviteOneLinkID);

#if UNITY_IOS
[DllImport("__Internal")]
#elif UNITY_STANDALONE_OSX
[DllImport("AppsFlyerBundle")]
#endif
private static extern void _setDeepLinkTimeout(long deepLinkTimeout);

#if UNITY_IOS
[DllImport("__Internal")]
#elif UNITY_STANDALONE_OSX
[DllImport("AppsFlyerBundle")]
#endif
private static extern void _anonymizeUser(bool shouldAnonymizeUser);

#if UNITY_IOS
[DllImport("__Internal")]
#elif UNITY_STANDALONE_OSX
[DllImport("AppsFlyerBundle")]
#endif
private static extern void _enableTCFDataCollection(bool shouldCollectTcfData);

#if UNITY_IOS
[DllImport("__Internal")]
#elif UNITY_STANDALONE_OSX
[DllImport("AppsFlyerBundle")]
#endif
private static extern void _setConsentData(bool isUserSubjectToGDPR, bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization);

#if UNITY_IOS
[DllImport("__Internal")]
#elif UNITY_STANDALONE_OSX
6 changes: 3 additions & 3 deletions Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml
Original file line number Diff line number Diff line change
@@ -2,16 +2,16 @@
<dependencies>

<androidPackages>
<androidPackage spec="com.appsflyer:af-android-sdk:6.12.2">
<androidPackage spec="com.appsflyer:af-android-sdk:6.13.0">
</androidPackage>
<androidPackage spec="com.appsflyer:unity-wrapper:6.12.22">
<androidPackage spec="com.appsflyer:unity-wrapper:6.13.01">
</androidPackage>
<androidPackage spec="com.android.installreferrer:installreferrer:2.1">
</androidPackage>
</androidPackages>

<iosPods>
<iosPod name="AppsFlyerFramework" version="6.12.2" minTargetSdk="9.0">
<iosPod name="AppsFlyerFramework" version="6.13.0" minTargetSdk="9.0">
</iosPod>
</iosPods>

6 changes: 6 additions & 0 deletions Assets/AppsFlyer/IAppsFlyerNativeBridge.cs
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ public interface IAppsFlyerNativeBridge

void setAdditionalData(Dictionary<string, string> customData);

void setDeepLinkTimeout(long deepLinkTimeout);

void setResolveDeepLinkURLs(params string[] urls);

void setOneLinkCustomDomain(params string[] domains);
@@ -37,6 +39,10 @@ public interface IAppsFlyerNativeBridge

string getAppsFlyerId();

void enableTCFDataCollection(bool shouldCollectTcfData);

void setConsentData(AppsFlyerConsent appsFlyerConsent);

void setMinTimeBetweenSessions(int seconds);

void setHost(string hostPrefixName, string hostName);
20 changes: 19 additions & 1 deletion Assets/AppsFlyer/Plugins/iOS/AppsFlyeriOSWrapper.mm
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ static void unityCallBack(NSString* objectName, const char* method, const char*

const void _startSDK(bool shouldCallback, const char* objectName) {
[[AppsFlyerLib shared] setPluginInfoWith: AFSDKPluginUnity
pluginVersion:@"6.12.22"
pluginVersion:@"6.13.0"
additionalParams:nil];
startRequestObjectName = stringFromChar(objectName);
AppsFlyeriOSWarpper.didCallStart = YES;
@@ -75,10 +75,28 @@ const void _setAppInviteOneLinkID (const char* appInviteOneLinkID) {
[[AppsFlyerLib shared] setAppInviteOneLink:stringFromChar(appInviteOneLinkID)];
}

const void _setDeepLinkTimeout (long deepLinkTimeout) {
[AppsFlyerLib shared].deepLinkTimeout = deepLinkTimeout;
}

const void _anonymizeUser (bool anonymizeUser) {
[AppsFlyerLib shared].anonymizeUser = anonymizeUser;
}

const void _enableTCFDataCollection (bool shouldCollectTcfData) {
[[AppsFlyerLib shared] enableTCFDataCollection:shouldCollectTcfData];
}

const void _setConsentData(bool isUserSubjectToGDPR, bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization) {
AppsFlyerConsent *consentData = nil;
if (isUserSubjectToGDPR) {
consentData = [[AppsFlyerConsent alloc] initForGDPRUserWithHasConsentForDataUsage:hasConsentForDataUsage hasConsentForAdsPersonalization:hasConsentForAdsPersonalization];
} else {
consentData = [[AppsFlyerConsent alloc] initNonGDPRUser];
}
[[AppsFlyerLib shared] setConsentData:consentData];
}

const void _setDisableCollectIAd (bool disableCollectASA) {
[AppsFlyerLib shared].disableCollectASA = disableCollectASA;
}
2 changes: 1 addition & 1 deletion Assets/AppsFlyer/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"name": "appsflyer-unity-plugin",
"displayName": "AppsFlyer",
"description": "AppsFlyer Unity plugin",
"version": "6.12.22",
"version": "6.13.0",
"unity": "2019.4",
"license": "MIT"
}
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Versions

## v6.12.52
* Update iOS SDK version - 6.12.3
* Update Android SDK version - 6.12.5
## v6.13.0
* Update iOS SDK version - 6.13.0
* Update Android SDK version - 6.13.0
* Added new iOS and Android API `setDeepLinkTimeout`
* Added new iOS and Android API `enableTCFDataCollection`
* Added new iOS and Android API `setConsentData`

## v6.12.22
* Update EDM4U - 1.2.177
@@ -246,4 +248,3 @@
Changes and fixes:
- New plugin with breaking changes. Please see migration doc with details.


4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@

### <a id="plugin-build-for"> This plugin is built for

- Android AppsFlyer SDK **v6.12.2**
- iOS AppsFlyer SDK **v6.12.2**
- Android AppsFlyer SDK v6.13.0
- iOS AppsFlyer SDK v6.13.0

---
### <a id="init-sdk-deeplink"> AD_ID permission for Android
4 changes: 2 additions & 2 deletions android-unity-wrapper/gradle.properties
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ android.enableJetifier=true

GROUP=com.appsflyer

VERSION_CODE=31
VERSION_NAME=6.12.22
VERSION_CODE=36
VERSION_NAME=6.13.01

POM_ARTIFACT_ID=unity-wrapper
POM_PACKAGING=aar
Loading

0 comments on commit 262b140

Please sign in to comment.