diff --git a/AppsFlyerSDK/AppsFlyerSDK.uplugin b/AppsFlyerSDK/AppsFlyerSDK.uplugin index 4b85aa3..a176f43 100644 --- a/AppsFlyerSDK/AppsFlyerSDK.uplugin +++ b/AppsFlyerSDK/AppsFlyerSDK.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 2, - "VersionName": "6.12.2", + "VersionName": "6.13.0", "FriendlyName": "AppsFlyerSDK", "Description": "UE4/UE5 AppsFlyer Plugin", "Category": "Misc", diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml index 722ed88..f401ea9 100644 --- a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml +++ b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml @@ -6,7 +6,7 @@ } dependencies { implementation 'com.android.installreferrer:installreferrer:2.1' - implementation 'com.appsflyer:af-android-sdk:6.12.2' + implementation 'com.appsflyer:af-android-sdk:6.13.0' } android { compileOptions { @@ -77,15 +77,27 @@ public void afSetPluginInfo(String pluginVersion, String engineVersion) { - Map<String, String> additionalData = new HashMap<String,String>(); additionalData.put("engine_version", engineVersion); PluginInfo pluginInfo = new PluginInfo(Plugin.UNREAL, pluginVersion, additionalData); AppsFlyerLib.getInstance().setPluginInfo(pluginInfo); - } + public void afEnableTCFDataCollection(boolean isTCFDataCollectionEnabled) { + AppsFlyerLib.getInstance().enableTCFDataCollection(isTCFDataCollectionEnabled); + } + + public void afSetConsentData(boolean isGDPR, boolean hasConsentForDataUsage, boolean hasConsentForAdsPersonalization) { + AppsFlyerConsent consent; + if (isGDPR == true) { + consent = AppsFlyerConsent.forGDPRUser(hasConsentForDataUsage, hasConsentForAdsPersonalization); + } else { + consent = AppsFlyerConsent.forNonGDPRUser(); + } + + AppsFlyerLib.getInstance().setConsentData(consent); + } diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp index b71f424..7bb78c0 100755 --- a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp +++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp @@ -13,6 +13,7 @@ // Core #include "Misc/EngineVersion.h" + #if PLATFORM_ANDROID #include "Android/AndroidJNI.h" #include "Android/AndroidApplication.h" @@ -150,6 +151,8 @@ void UAppsFlyerSDKBlueprint::configure() const UAppsFlyerSDKSettings *defaultSettings = GetDefault(); const bool isDebug = defaultSettings->bIsDebug; const bool isAutoStart = defaultSettings->bEnableAutoStart; + const bool isTCFDataCollectionEnabled = defaultSettings->bEnableTCFDataCollection; + #if PLATFORM_ANDROID JNIEnv* env = FAndroidApplication::GetJavaEnv(); @@ -168,6 +171,13 @@ void UAppsFlyerSDKBlueprint::configure() FJavaWrapper::CallVoidMethod(env, FJavaWrapper::GameActivityThis, appsflyer, key, isDebug); } + if (isTCFDataCollectionEnabled) + { + jmethodID UPLMethod = FJavaWrapper::FindMethod(env, FJavaWrapper::GameActivityClassID, "afEnableTCFDataCollection", "(Z)V", false); + FJavaWrapper::CallVoidMethod(env, FJavaWrapper::GameActivityThis, UPLMethod, true); + } + + #elif PLATFORM_IOS dispatch_async(dispatch_get_main_queue(), ^ { if ((!defaultSettings->appsFlyerDevKeyIOS.IsEmpty() || !defaultSettings->appsFlyerDevKey.IsEmpty()) && !defaultSettings->appleAppID.IsEmpty()) { @@ -189,6 +199,10 @@ void UAppsFlyerSDKBlueprint::configure() [AppsFlyerLib shared].currencyCode = currencyCode; } + if (isTCFDataCollectionEnabled) { + [[AppsFlyerLib shared] enableTCFDataCollection:YES]; + } + FIOSCoreDelegates::OnOpenURL.AddStatic(&OnOpenURL); UE4AFSDKDelegate *delegate = [[UE4AFSDKDelegate alloc] init]; delegate.onConversionDataSuccess = onConversionDataSuccess; @@ -389,3 +403,32 @@ void UAppsFlyerSDKBlueprint::setAdditionalData(TMap customDat return; #endif } + +void UAppsFlyerSDKBlueprint::SetConsentForNonGDPRUser() +{ +#if PLATFORM_ANDROID + JNIEnv* env = FAndroidApplication::GetJavaEnv(); + jmethodID UPLMethod1 = FJavaWrapper::FindMethod(env, FJavaWrapper::GameActivityClassID, "afSetConsentData", "(ZZZ)V", false); + FJavaWrapper::CallVoidMethod(env, FJavaWrapper::GameActivityThis, UPLMethod1, false, false, false); +#elif PLATFORM_IOS + AppsFlyerConsent *consent = [[AppsFlyerConsent alloc] initNonGDPRUser]; + [[AppsFlyerLib shared] setConsentData:consent]; +#else + return; +#endif +} + +void UAppsFlyerSDKBlueprint::SetConsentForGDPRUser(bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization) +{ +#if PLATFORM_ANDROID + JNIEnv* env = FAndroidApplication::GetJavaEnv(); + jmethodID UPLMethod = FJavaWrapper::FindMethod(env, FJavaWrapper::GameActivityClassID, "afSetConsentData", "(ZZZ)V", false); + FJavaWrapper::CallVoidMethod(env, FJavaWrapper::GameActivityThis, UPLMethod, true, hasConsentForDataUsage, hasConsentForAdsPersonalization); +#elif PLATFORM_IOS + AppsFlyerConsent *consent = [[AppsFlyerConsent alloc] initForGDPRUserWithHasConsentForDataUsage:hasConsentForDataUsage + hasConsentForAdsPersonalization:hasConsentForAdsPersonalization]; + [[AppsFlyerLib shared] setConsentData:consent]; +#else + return; +#endif +} diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKSettings.cpp b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKSettings.cpp index f0adc08..b59b96d 100644 --- a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKSettings.cpp +++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKSettings.cpp @@ -13,5 +13,6 @@ UAppsFlyerSDKSettings::UAppsFlyerSDKSettings(const FObjectInitializer& ObjectIni , currencyCode("") , bDisableSKAdNetwork(false) , bEnableAutoStart(true) + , bEnableTCFDataCollection(false) { } diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKBlueprint.h b/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKBlueprint.h index 8926e7a..0ff8c0f 100755 --- a/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKBlueprint.h +++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKBlueprint.h @@ -53,4 +53,9 @@ class APPSFLYERSDK_API UAppsFlyerSDKBlueprint : public UBlueprintFunctionLibrary UFUNCTION(BlueprintCallable, Category = AppsFlyerSDK, DisplayName = "AppsFlyerSDK add custom data to events in the payload") static void setAdditionalData(TMap customData); + UFUNCTION(BlueprintCallable, Category = AppsFlyerSDK, DisplayName = "AppsFlyerConsent For *Non GDPR* User") + static void SetConsentForNonGDPRUser(); + + UFUNCTION(BlueprintCallable, Category = AppsFlyerSDK, DisplayName = "AppsFlyerConsent For *GDPR* User") + static void SetConsentForGDPRUser(bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization); }; diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKSettings.h b/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKSettings.h index dfa0543..a0b8927 100644 --- a/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKSettings.h +++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Public/AppsFlyerSDKSettings.h @@ -41,4 +41,7 @@ class UAppsFlyerSDKSettings : public UObject // Enable AppsFlyerSDK automatic start UPROPERTY(Config, EditAnywhere, config, Category = "AppsFlyer", meta = (DisplayName = "Automatically start the AppsFlyer SDK")) bool bEnableAutoStart; + + UPROPERTY(Config, EditAnywhere, config, Category = "AppsFlyer", meta = (DisplayName = "Instruct the SDK to collect the TCF data from the device")) + bool bEnableTCFDataCollection; }; diff --git a/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip b/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip index 9352894..67f5d7d 100644 Binary files a/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip and b/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip differ diff --git a/Demo/.gitignore b/Demo/.gitignore index 11e18f5..6e4b3a7 100644 --- a/Demo/.gitignore +++ b/Demo/.gitignore @@ -1,3 +1,4 @@ + # Visual Studio 2015 user specific files .vs/ diff --git a/UE_5.1_Demo/Demo/.gitignore b/UE_5.1_Demo/Demo/.gitignore index 4883bb9..818e3c4 100644 --- a/UE_5.1_Demo/Demo/.gitignore +++ b/UE_5.1_Demo/Demo/.gitignore @@ -76,4 +76,13 @@ Plugins/*/Intermediate/* ./AppsFlyerSDK/Intermediate/* # Cache files for the editor to use -DerivedDataCache/* \ No newline at end of file +DerivedDataCache/* + +/Saved +/Demo (IOS).xcworkspace +/Content +/DerivedDataCache +/Demo (Mac).xcworkspace +/.vscode +/Intermediate +/Plugins/AppsFlyerSDK/Intermediate diff --git a/UE_5.1_Demo/Demo/Config/DefaultEngine.ini b/UE_5.1_Demo/Demo/Config/DefaultEngine.ini index 566af27..e1023c6 100644 --- a/UE_5.1_Demo/Demo/Config/DefaultEngine.ini +++ b/UE_5.1_Demo/Demo/Config/DefaultEngine.ini @@ -205,4 +205,8 @@ ManualIPAddress= appsFlyerDevKey=LYPnLsdJuSwjgAQ2GTZehc appleAppID=1217828636 bIsDebug=True +bEnableTCFDataCollection=True + +[/Script/MacTargetPlatform.XcodeProjectSettings] +CodeSigningTeam=6UQAD4B3U2 diff --git a/UE_5.1_Demo/Demo/Content/AFLevel1.umap b/UE_5.1_Demo/Demo/Content/AFLevel1.umap index c920137..463aaa8 100644 Binary files a/UE_5.1_Demo/Demo/Content/AFLevel1.umap and b/UE_5.1_Demo/Demo/Content/AFLevel1.umap differ diff --git a/UE_5.1_Demo/Demo/Content/StarterContent/Audio/Collapse01.uasset b/UE_5.1_Demo/Demo/Content/StarterContent/Audio/Collapse01.uasset index 4341ab4..9c68be4 100644 Binary files a/UE_5.1_Demo/Demo/Content/StarterContent/Audio/Collapse01.uasset and b/UE_5.1_Demo/Demo/Content/StarterContent/Audio/Collapse01.uasset differ diff --git a/UE_5.1_Demo/Demo/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/UE_5.1_Demo/Demo/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 9b1f1be..ca4b6f2 100644 Binary files a/UE_5.1_Demo/Demo/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset and b/UE_5.1_Demo/Demo/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset differ diff --git a/UE_5.1_Demo/Demo/Demo.uproject b/UE_5.1_Demo/Demo/Demo.uproject index b214143..7e290d9 100644 --- a/UE_5.1_Demo/Demo/Demo.uproject +++ b/UE_5.1_Demo/Demo/Demo.uproject @@ -1,6 +1,6 @@ { "FileVersion": 3, - "EngineAssociation": "{89CF005C-2E45-EE90-3C62-39B910725CF3}", + "EngineAssociation": "5.3", "Category": "", "Description": "", "Modules": [ diff --git a/UE_5.1_Demo/Demo/Plugins/AppsFlyerSDK b/UE_5.1_Demo/Demo/Plugins/AppsFlyerSDK index 7c63902..3aeb9c5 120000 --- a/UE_5.1_Demo/Demo/Plugins/AppsFlyerSDK +++ b/UE_5.1_Demo/Demo/Plugins/AppsFlyerSDK @@ -1 +1 @@ -/Volumes/T7 Shield/appsflyer-unreal-plugin/AppsFlyerSDK \ No newline at end of file +../../../AppsFlyerSDK \ No newline at end of file