diff --git a/AppsFlyerSDK/AppsFlyerSDK.uplugin b/AppsFlyerSDK/AppsFlyerSDK.uplugin
index f785fe8..4b85aa3 100644
--- a/AppsFlyerSDK/AppsFlyerSDK.uplugin
+++ b/AppsFlyerSDK/AppsFlyerSDK.uplugin
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 2,
- "VersionName": "6.10.1",
+ "VersionName": "6.12.2",
"FriendlyName": "AppsFlyerSDK",
"Description": "UE4/UE5 AppsFlyer Plugin",
"Category": "Misc",
diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyerSDK.Build.cs b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyerSDK.Build.cs
index 25a462a..c364325 100644
--- a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyerSDK.Build.cs
+++ b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyerSDK.Build.cs
@@ -38,12 +38,16 @@ public AppsFlyerSDK(ReadOnlyTargetRules Target) : base(Target)
"CFNetwork"
}
);
+
+ //UPL
+ string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
+ AdditionalPropertiesForReceipt.Add("IOSPlugin", Path.Combine(PluginPath, "AppsFlyer_UPL_IOS.xml"));
}
else if (Target.Platform == UnrealTargetPlatform.Android)
{
// Unreal Plugin Language
string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
- AdditionalPropertiesForReceipt.Add("AndroidPlugin", System.IO.Path.Combine(PluginPath, "AppsFlyer_UPL.xml"));
+ AdditionalPropertiesForReceipt.Add("AndroidPlugin", System.IO.Path.Combine(PluginPath, "AppsFlyer_UPL_Android.xml"));
// JNI
PublicIncludePathModuleNames.Add("Launch");
}
diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL.xml b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml
similarity index 76%
rename from AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL.xml
rename to AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml
index 638cd49..722ed88 100644
--- a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL.xml
+++ b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_Android.xml
@@ -5,8 +5,8 @@
mavenCentral()
}
dependencies {
- implementation 'com.android.installreferrer:installreferrer:1.0'
- implementation 'com.appsflyer:af-android-sdk:6.9.1'
+ implementation 'com.android.installreferrer:installreferrer:2.1'
+ implementation 'com.appsflyer:af-android-sdk:6.12.2'
}
android {
compileOptions {
@@ -37,6 +37,10 @@
import android.app.Application;
import com.appsflyer.*;
+ import com.appsflyer.internal.platform_extension.Plugin;
+ import com.appsflyer.internal.platform_extension.PluginInfo;
+ import java.util.HashMap;
+ import java.util.Map;
@@ -70,6 +74,18 @@
public void afSetAdditionalData(Map<String, Object> customData) {
AppsFlyerLib.getInstance().setAdditionalData(customData);
}
+
+ 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);
+
+ }
+
diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_IOS.xml b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_IOS.xml
new file mode 100644
index 0000000..c2d3bc0
--- /dev/null
+++ b/AppsFlyerSDK/Source/AppsFlyerSDK/AppsFlyer_UPL_IOS.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp
index c1e831f..b71f424 100755
--- a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp
+++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/AppsFlyerSDKBlueprint.cpp
@@ -18,7 +18,7 @@
#include "Android/AndroidApplication.h"
#elif PLATFORM_IOS
#import
-#import "UE4AFSDKDelegate.h"
+#import "IOS/UE4AFSDKDelegate.h"
#include "IOSAppDelegate.h"
#import
@@ -151,10 +151,18 @@ void UAppsFlyerSDKBlueprint::configure()
const bool isDebug = defaultSettings->bIsDebug;
const bool isAutoStart = defaultSettings->bEnableAutoStart;
#if PLATFORM_ANDROID
- if(isAutoStart){
- JNIEnv* env = FAndroidApplication::GetJavaEnv();
- jmethodID appsflyer =
- FJavaWrapper::FindMethod(env, FJavaWrapper::GameActivityClassID, "afStart", "(Ljava/lang/String;Z)V", false);
+ JNIEnv* env = FAndroidApplication::GetJavaEnv();
+
+ jmethodID PluginMethodID = FJavaWrapper::FindMethod(env, FJavaWrapper::GameActivityClassID, "afSetPluginInfo", "(Ljava/lang/String;Ljava/lang/String;)V", false);
+ jstring jVersionName = env->NewStringUTF(TCHAR_TO_UTF8(*VersionName));
+ jstring jEngineVersion = env->NewStringUTF(TCHAR_TO_UTF8(*EngineVersion));
+ FJavaWrapper::CallVoidMethod(env, FJavaWrapper::GameActivityThis, PluginMethodID, jVersionName, jEngineVersion);
+ env->DeleteLocalRef(jVersionName);
+ env->DeleteLocalRef(jEngineVersion);
+
+ if (isAutoStart)
+ {
+ jmethodID appsflyer = FJavaWrapper::FindMethod(env, FJavaWrapper::GameActivityClassID, "afStart", "(Ljava/lang/String;Z)V", false);
jstring key = env->NewStringUTF(TCHAR_TO_UTF8(*defaultSettings->appsFlyerDevKey));
FJavaWrapper::CallVoidMethod(env, FJavaWrapper::GameActivityThis, appsflyer, key, isDebug);
diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/UE4AFSDKDelegate.h b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/IOS/UE4AFSDKDelegate.h
similarity index 94%
rename from AppsFlyerSDK/Source/AppsFlyerSDK/Private/UE4AFSDKDelegate.h
rename to AppsFlyerSDK/Source/AppsFlyerSDK/Private/IOS/UE4AFSDKDelegate.h
index feec95d..e59b03d 100644
--- a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/UE4AFSDKDelegate.h
+++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/IOS/UE4AFSDKDelegate.h
@@ -6,8 +6,6 @@
// Copyright © 2019 Epic Games, Inc. All rights reserved.
//
-#ifndef PLATFORM_IOS
-#else
#if PLATFORM_IOS
#import
@@ -26,4 +24,3 @@ NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_END
#endif
-#endif
diff --git a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/UE4AFSDKDelegate.mm b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/IOS/UE4AFSDKDelegate.mm
similarity index 98%
rename from AppsFlyerSDK/Source/AppsFlyerSDK/Private/UE4AFSDKDelegate.mm
rename to AppsFlyerSDK/Source/AppsFlyerSDK/Private/IOS/UE4AFSDKDelegate.mm
index 2309c0e..f96ba8b 100644
--- a/AppsFlyerSDK/Source/AppsFlyerSDK/Private/UE4AFSDKDelegate.mm
+++ b/AppsFlyerSDK/Source/AppsFlyerSDK/Private/IOS/UE4AFSDKDelegate.mm
@@ -6,13 +6,10 @@
// Copyright © 2019 Epic Games, Inc. All rights reserved.
//
-#ifndef PLATFORM_IOS
-#else
#if PLATFORM_IOS
#import "UE4AFSDKDelegate.h"
-
@implementation UE4AFSDKDelegate
- (instancetype)init {
@@ -77,4 +74,3 @@ + (NSDictionary *)dictionaryByReplacingNullsWithStrings:(NSDictionary *)dict {
@end
#endif
-#endif
diff --git a/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip b/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip
index 818014a..9352894 100644
Binary files a/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip and b/AppsFlyerSDK/Source/ThirdParty/iOS/AppsFlyerLib.embeddedframework.zip differ