From 78033e031f6c9067174a0a3712f9ab8c7b6824a6 Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 19 Jul 2023 11:29:22 +0800 Subject: [PATCH] AF --- .../Common/SDK/BFThirdReportSDKManager.cs | 19 ++ Assets/ThirdParty/AppsFlyerAdrevenue.meta | 8 + .../AppsFlyerAdrevenue/AFAdRevenueEvent.cs | 34 ++++ .../AFAdRevenueEvent.cs.meta | 11 ++ .../AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs | 173 ++++++++++++++++++ .../AppsFlyerAdRevenue.cs.meta | 11 ++ .../ThirdParty/AppsFlyerAdrevenue/Editor.meta | 8 + .../Editor/AppsFlyerAdRevenueDependencies.xml | 13 ++ .../AppsFlyerAdRevenueDependencies.xml.meta | 7 + .../AppsFlyerAdrevenue/Plugins.meta | 8 + .../AppsFlyerAdrevenue/Plugins/iOS.meta | 8 + .../Plugins/iOS/AppsFlyerAdRevenueWrapper.h | 17 ++ .../iOS/AppsFlyerAdRevenueWrapper.h.meta | 27 +++ .../Plugins/iOS/AppsFlyerAdRevenueWrapper.mm | 38 ++++ .../iOS/AppsFlyerAdRevenueWrapper.mm.meta | 37 ++++ .../Plugins/iOS/SwiftForUnity.swift | 1 + .../Plugins/iOS/SwiftForUnity.swift.meta | 37 ++++ Assets/XLua/Gen/AFAdRevenueEventWrap.cs | 89 +++++++++ .../AppsFlyerSDK_AppsFlyerAdRevenueWrap.cs | 165 +++++++++++++++++ .../Gen/BF_BFThirdReportSDKManagerWrap.cs | 62 ++++++- Assets/XLua/Gen/XLuaGenAutoRegister.cs | 44 +++-- Assets/XLua/Gen/link.xml | 2 + 22 files changed, 799 insertions(+), 20 deletions(-) create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Editor.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm.meta create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift create mode 100644 Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift.meta create mode 100644 Assets/XLua/Gen/AFAdRevenueEventWrap.cs create mode 100644 Assets/XLua/Gen/AppsFlyerSDK_AppsFlyerAdRevenueWrap.cs diff --git a/Assets/Scripts/Common/SDK/BFThirdReportSDKManager.cs b/Assets/Scripts/Common/SDK/BFThirdReportSDKManager.cs index 930f7745c..2cc95b853 100644 --- a/Assets/Scripts/Common/SDK/BFThirdReportSDKManager.cs +++ b/Assets/Scripts/Common/SDK/BFThirdReportSDKManager.cs @@ -3,6 +3,7 @@ using UnityEngine; using BF.NativeCore.ThirdPlatform; using Newtonsoft.Json; using com.adjust.sdk; +using AppsFlyerSDK; namespace BF { @@ -10,6 +11,7 @@ namespace BF { private ThinkingAnalyticsSdk TASdk = new ThinkingAnalyticsSdk(); private AppsFlyerSdk AFSdk = new AppsFlyerSdk(); + private bool isInitAFAdRevenue = false; void Start() { @@ -30,6 +32,16 @@ namespace BF AFSdk.SetTaAccountId(id); } + public void InitAppsFlyerAdRevenue() + { + if (isInitAFAdRevenue) + { + return; + } + isInitAFAdRevenue = true; + AppsFlyerAdRevenue.start(); + } + // 清除账户id public void ClearThinkingAnalyticsAccountId() { @@ -144,5 +156,12 @@ namespace BF { Adjust.setDeviceToken(token); } + + public void LogAppsFlyerAdRevenue(int mediationNetwork, string monetizationNetwork, double eventRevenue, string data) + { + var properties = JsonConvert.DeserializeObject>(data); + var mediationNetworkType = (AppsFlyerAdRevenueMediationNetworkType)mediationNetwork; + AppsFlyerAdRevenue.logAdRevenue(monetizationNetwork, mediationNetworkType, eventRevenue, "USD", properties); + } } } diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue.meta b/Assets/ThirdParty/AppsFlyerAdrevenue.meta new file mode 100644 index 000000000..0d50d4f13 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 630dd76fcc178442fa3ca0f30af6b492 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs b/Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs new file mode 100644 index 000000000..6ed2afb6b --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs @@ -0,0 +1,34 @@ +using System.Collections; +using UnityEngine; + +public class AFAdRevenueEvent { + + /** + *Pre-defined keys for non-mandatory dictionary + *Code ISO 3166-1 format + **/ + public const string COUNTRY = "country"; + + /** + *ID of the ad unit for the impression + **/ + public const string AD_UNIT = "ad_unit"; + + /** + *Format of the ad + **/ + public const string AD_TYPE = "ad_type"; + + /** + *ID of the ad placement for the impression + **/ + public const string PLACEMENT = "placement"; + + /** + *Provided by Facebook Audience Network only, and will be reported to publishers + *approved by Facebook Audience Network within the closed beta + **/ + public const string ECPM_PAYLOAD = "ecpm_payload"; + + +} diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs.meta new file mode 100644 index 000000000..977c8a72d --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/AFAdRevenueEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 597a8e5b837f64353b0aa9af2fe9aa84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs b/Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs new file mode 100644 index 000000000..a1aa78ee4 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs @@ -0,0 +1,173 @@ +using System.Collections.Generic; +using UnityEngine; +using System.Runtime.InteropServices; +using System; + +namespace AppsFlyerSDK +{ + public class AppsFlyerAdRevenue : MonoBehaviour + { + + public static readonly string kAppsFlyerAdRevenueVersion = "6.5.4"; + +#if UNITY_ANDROID && !UNITY_EDITOR + private static AndroidJavaClass appsFlyerAndroid = new AndroidJavaClass("com.appsflyer.unity.afunityadrevenuegenericplugin.AdRevenueUnityWrapper"); +#endif + + public static void start() + { +#if UNITY_IOS && !UNITY_EDITOR + + _start(); + +#elif UNITY_ANDROID && !UNITY_EDITOR + + using(AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) { + + using(AndroidJavaObject cls_Activity = cls_UnityPlayer.GetStatic("currentActivity")) { + + AndroidJavaObject cls_Application = cls_Activity.Call("getApplication"); + + appsFlyerAndroid.CallStatic("start", cls_Application); + } + } + +#else + +#endif + } + + + public static void setIsDebug(bool isDebug) + { +#if UNITY_IOS && !UNITY_EDITOR + _setIsDebugAdrevenue(isDebug); +#elif UNITY_ANDROID && !UNITY_EDITOR + +#else + +#endif + } + + public static void logAdRevenue(string monetizationNetwork, + AppsFlyerAdRevenueMediationNetworkType mediationNetwork, + double eventRevenue, + string revenueCurrency, + Dictionary additionalParameters) + { +#if UNITY_IOS && !UNITY_EDITOR + + _logAdRevenue(monetizationNetwork, mediationNetwork, eventRevenue, revenueCurrency, AFMiniJSON.Json.Serialize(additionalParameters)); + +#elif UNITY_ANDROID && !UNITY_EDITOR + + int mediationNetworkAndroid = setMediationNetworkTypeAndroid(mediationNetwork); + if (mediationNetworkAndroid == -1) + { + Debug.Log("Please choose a valid mediationNetwork"); + } else + { + appsFlyerAndroid.CallStatic("logAdRevenue", + monetizationNetwork, + mediationNetworkAndroid, + revenueCurrency, + eventRevenue, + convertDictionaryToJavaMap(additionalParameters)); + + } +#else + +#endif + } + +#if UNITY_IOS && !UNITY_EDITOR + + [DllImport("__Internal")] + private static extern void _start(); + + [DllImport("__Internal")] + private static extern void _setIsDebugAdrevenue(bool isDebug); + + [DllImport("__Internal")] + private static extern void _logAdRevenue(string monetizationNetwork, + AppsFlyerAdRevenueMediationNetworkType mediationNetwork, + double eventRevenue, + string revenueCurrency, + string additionalParameters); + +#elif UNITY_ANDROID && !UNITY_EDITOR + +#else + +#endif + private static int setMediationNetworkTypeAndroid(AppsFlyerAdRevenueMediationNetworkType mediationNetwork) + { + switch (mediationNetwork) + { + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeIronSource: + return 0; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeApplovinMax: + return 1; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeGoogleAdMob: + return 2; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeFyber: + return 3; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeAppodeal: + return 4; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeAdmost: + return 5; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeTopon: + return 6; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeTradplus: + return 7; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeYandex: + return 8; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeChartBoost: + return 9; + case AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeUnity: + return 10; + default: + return -1; + } + + } + private static AndroidJavaObject convertDictionaryToJavaMap(Dictionary dictionary) + { + AndroidJavaObject map = new AndroidJavaObject("java.util.HashMap"); + IntPtr putMethod = AndroidJNIHelper.GetMethodID(map.GetRawClass(), "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); + jvalue[] val; + if (dictionary != null) + { + foreach (var entry in dictionary) + { + val = AndroidJNIHelper.CreateJNIArgArray(new object[] { entry.Key, entry.Value }); + AndroidJNI.CallObjectMethod(map.GetRawObject(), putMethod, val); + AndroidJNI.DeleteLocalRef(val[0].l); + AndroidJNI.DeleteLocalRef(val[1].l); + } + } + + return map; + } + } + + + public enum AppsFlyerAdRevenueMediationNetworkType + { + AppsFlyerAdRevenueMediationNetworkTypeGoogleAdMob = 1, + AppsFlyerAdRevenueMediationNetworkTypeIronSource = 2, + AppsFlyerAdRevenueMediationNetworkTypeApplovinMax = 3, + AppsFlyerAdRevenueMediationNetworkTypeFyber = 4, + AppsFlyerAdRevenueMediationNetworkTypeAppodeal = 5, + AppsFlyerAdRevenueMediationNetworkTypeAdmost = 6, + AppsFlyerAdRevenueMediationNetworkTypeTopon = 7, + AppsFlyerAdRevenueMediationNetworkTypeTradplus = 8, + AppsFlyerAdRevenueMediationNetworkTypeYandex = 9, + AppsFlyerAdRevenueMediationNetworkTypeChartBoost = 10, + AppsFlyerAdRevenueMediationNetworkTypeUnity = 11 + + } + + + +} \ No newline at end of file diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs.meta new file mode 100644 index 000000000..a5bf96192 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/AppsFlyerAdRevenue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ede466cf9e884fcb90bfec949dc6f04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Editor.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Editor.meta new file mode 100644 index 000000000..503ec9a82 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0609a17cae7624f34a54832ea3d1c0c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml b/Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml new file mode 100644 index 000000000..080359d2a --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml.meta new file mode 100644 index 000000000..bcab80a66 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Editor/AppsFlyerAdRevenueDependencies.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: be56133c4df9044cd80f33b9f323a35d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins.meta new file mode 100644 index 000000000..431db0a0b --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f213c52c0a9334f30a7d716ba4f2bfbf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS.meta new file mode 100644 index 000000000..a28e78a9d --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2aa6c4c4e493f462a999a5bb638f5233 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h new file mode 100644 index 000000000..5ac6fec93 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h @@ -0,0 +1,17 @@ +// +// AppsFlyerAdRevenueWrapper.h +// Unity-iPhone +// +// Created by Jonathan Wesfield on 01/12/2019. +// + +#import + +#import "AFUnityUtils.mm" +#if __has_include() +#import +#endif + +@interface AppsFlyerAdRevenueWrapper : NSObject + +@end diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h.meta new file mode 100644 index 000000000..1a8834616 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.h.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 403bcefbab2d04a9da127ba76b99627b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm new file mode 100644 index 000000000..a23bd7239 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm @@ -0,0 +1,38 @@ +// +// AppsFlyerAdRevenueWrapper.mm +// Unity-iPhone +// +// Created by Jonathan Wesfield on 25/11/2019. +// + +#import "AppsFlyerAdRevenueWrapper.h" + + +@implementation AppsFlyerAdRevenueWrapper + + +extern "C" { + + + const void _start(int length, int* adRevenueTypes){ + [AppsFlyerAdRevenue start]; + } + const void _setIsDebugAdrevenue(bool isDebug){ + [[AppsFlyerAdRevenue shared] setIsDebug:isDebug]; + } + + const void _logAdRevenue(const char* monetizationNetwork, + int mediationNetwork, + double eventRevenue, + const char* revenueCurrency, + const char* additionalParameters){ + [[AppsFlyerAdRevenue shared] logAdRevenueWithMonetizationNetwork:stringFromChar(monetizationNetwork) + mediationNetwork:(AppsFlyerAdRevenueMediationNetworkType) mediationNetwork + eventRevenue:[NSNumber numberWithDouble:eventRevenue] + revenueCurrency:stringFromChar(revenueCurrency) + additionalParameters:dictionaryFromJson(additionalParameters)]; + + } +} + +@end diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm.meta new file mode 100644 index 000000000..a05b67a6c --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/AppsFlyerAdRevenueWrapper.mm.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: 476b7c27be2254b7abe547c3679f9d9f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift new file mode 100644 index 000000000..521d0e4dd --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift @@ -0,0 +1 @@ +import Foundation \ No newline at end of file diff --git a/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift.meta b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift.meta new file mode 100644 index 000000000..89ca72b54 --- /dev/null +++ b/Assets/ThirdParty/AppsFlyerAdrevenue/Plugins/iOS/SwiftForUnity.swift.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: fd2ed24dc5b354bb29dcd1b72840370c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/XLua/Gen/AFAdRevenueEventWrap.cs b/Assets/XLua/Gen/AFAdRevenueEventWrap.cs new file mode 100644 index 000000000..71113b243 --- /dev/null +++ b/Assets/XLua/Gen/AFAdRevenueEventWrap.cs @@ -0,0 +1,89 @@ +#if USE_UNI_LUA +using LuaAPI = UniLua.Lua; +using RealStatePtr = UniLua.ILuaState; +using LuaCSFunction = UniLua.CSharpFunctionDelegate; +#else +using LuaAPI = XLua.LuaDLL.Lua; +using RealStatePtr = System.IntPtr; +using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; +#endif + +using XLua; +using System.Collections.Generic; + + +namespace XLua.CSObjectWrap +{ + using Utils = XLua.Utils; + public class AFAdRevenueEventWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(AFAdRevenueEvent); + Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0); + + + + + + + Utils.EndObjectRegister(type, L, translator, null, null, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 6, 0, 0); + + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "COUNTRY", AFAdRevenueEvent.COUNTRY); + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "AD_UNIT", AFAdRevenueEvent.AD_UNIT); + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "AD_TYPE", AFAdRevenueEvent.AD_TYPE); + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "PLACEMENT", AFAdRevenueEvent.PLACEMENT); + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "ECPM_PAYLOAD", AFAdRevenueEvent.ECPM_PAYLOAD); + + + + + Utils.EndClassRegister(type, L, translator); + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __CreateInstance(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + if(LuaAPI.lua_gettop(L) == 1) + { + + var gen_ret = new AFAdRevenueEvent(); + translator.Push(L, gen_ret); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to AFAdRevenueEvent constructor!"); + + } + + + + + + + + + + + + + + + + + + } +} diff --git a/Assets/XLua/Gen/AppsFlyerSDK_AppsFlyerAdRevenueWrap.cs b/Assets/XLua/Gen/AppsFlyerSDK_AppsFlyerAdRevenueWrap.cs new file mode 100644 index 000000000..b193b997c --- /dev/null +++ b/Assets/XLua/Gen/AppsFlyerSDK_AppsFlyerAdRevenueWrap.cs @@ -0,0 +1,165 @@ +#if USE_UNI_LUA +using LuaAPI = UniLua.Lua; +using RealStatePtr = UniLua.ILuaState; +using LuaCSFunction = UniLua.CSharpFunctionDelegate; +#else +using LuaAPI = XLua.LuaDLL.Lua; +using RealStatePtr = System.IntPtr; +using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; +#endif + +using XLua; +using System.Collections.Generic; + + +namespace XLua.CSObjectWrap +{ + using Utils = XLua.Utils; + public class AppsFlyerSDKAppsFlyerAdRevenueWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(AppsFlyerSDK.AppsFlyerAdRevenue); + Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0); + + + + + + + Utils.EndObjectRegister(type, L, translator, null, null, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 5, 0, 0); + Utils.RegisterFunc(L, Utils.CLS_IDX, "start", _m_start_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "setIsDebug", _m_setIsDebug_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "logAdRevenue", _m_logAdRevenue_xlua_st_); + + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "kAppsFlyerAdRevenueVersion", AppsFlyerSDK.AppsFlyerAdRevenue.kAppsFlyerAdRevenueVersion); + + + + + Utils.EndClassRegister(type, L, translator); + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __CreateInstance(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + if(LuaAPI.lua_gettop(L) == 1) + { + + var gen_ret = new AppsFlyerSDK.AppsFlyerAdRevenue(); + translator.Push(L, gen_ret); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to AppsFlyerSDK.AppsFlyerAdRevenue constructor!"); + + } + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_start_xlua_st_(RealStatePtr L) + { + try { + + + + + { + + AppsFlyerSDK.AppsFlyerAdRevenue.start( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_setIsDebug_xlua_st_(RealStatePtr L) + { + try { + + + + + { + bool _isDebug = LuaAPI.lua_toboolean(L, 1); + + AppsFlyerSDK.AppsFlyerAdRevenue.setIsDebug( _isDebug ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_logAdRevenue_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + string _monetizationNetwork = LuaAPI.lua_tostring(L, 1); + AppsFlyerSDK.AppsFlyerAdRevenueMediationNetworkType _mediationNetwork;translator.Get(L, 2, out _mediationNetwork); + double _eventRevenue = LuaAPI.lua_tonumber(L, 3); + string _revenueCurrency = LuaAPI.lua_tostring(L, 4); + System.Collections.Generic.Dictionary _additionalParameters = (System.Collections.Generic.Dictionary)translator.GetObject(L, 5, typeof(System.Collections.Generic.Dictionary)); + + AppsFlyerSDK.AppsFlyerAdRevenue.logAdRevenue( _monetizationNetwork, _mediationNetwork, _eventRevenue, _revenueCurrency, _additionalParameters ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + + + + + + + } +} diff --git a/Assets/XLua/Gen/BF_BFThirdReportSDKManagerWrap.cs b/Assets/XLua/Gen/BF_BFThirdReportSDKManagerWrap.cs index 96d63d9a6..a40a3ecf8 100644 --- a/Assets/XLua/Gen/BF_BFThirdReportSDKManagerWrap.cs +++ b/Assets/XLua/Gen/BF_BFThirdReportSDKManagerWrap.cs @@ -21,10 +21,11 @@ namespace XLua.CSObjectWrap { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(BF.BFThirdReportSDKManager); - Utils.BeginObjectRegister(type, L, translator, 0, 14, 0, 0); + Utils.BeginObjectRegister(type, L, translator, 0, 16, 0, 0); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetThinkingAnalyticsAccountId", _m_SetThinkingAnalyticsAccountId); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitAppsFlyerAdRevenue", _m_InitAppsFlyerAdRevenue); Utils.RegisterFunc(L, Utils.METHOD_IDX, "ClearThinkingAnalyticsAccountId", _m_ClearThinkingAnalyticsAccountId); Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostThinkingAnalyticsEvent", _m_PostThinkingAnalyticsEvent); Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostThinkingAnalyticsEventName", _m_PostThinkingAnalyticsEventName); @@ -37,6 +38,7 @@ namespace XLua.CSObjectWrap Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustPartnerTrackEvent", _m_PostAdjustPartnerTrackEvent); Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustAdRevenueAppLovinMAX", _m_PostAdjustAdRevenueAppLovinMAX); Utils.RegisterFunc(L, Utils.METHOD_IDX, "AdjustSetDeviceToken", _m_AdjustSetDeviceToken); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "LogAppsFlyerAdRevenue", _m_LogAppsFlyerAdRevenue); @@ -131,6 +133,33 @@ namespace XLua.CSObjectWrap + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_InitAppsFlyerAdRevenue(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + BF.BFThirdReportSDKManager gen_to_be_invoked = (BF.BFThirdReportSDKManager)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.InitAppsFlyerAdRevenue( ); + + + return 0; } @@ -556,6 +585,37 @@ namespace XLua.CSObjectWrap } + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LogAppsFlyerAdRevenue(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + BF.BFThirdReportSDKManager gen_to_be_invoked = (BF.BFThirdReportSDKManager)translator.FastGetCSObj(L, 1); + + + + { + int _mediationNetwork = LuaAPI.xlua_tointeger(L, 2); + string _monetizationNetwork = LuaAPI.lua_tostring(L, 3); + double _eventRevenue = LuaAPI.lua_tonumber(L, 4); + string _data = LuaAPI.lua_tostring(L, 5); + + gen_to_be_invoked.LogAppsFlyerAdRevenue( _mediationNetwork, _monetizationNetwork, _eventRevenue, _data ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + diff --git a/Assets/XLua/Gen/XLuaGenAutoRegister.cs b/Assets/XLua/Gen/XLuaGenAutoRegister.cs index c01ff7616..4c811c93d 100644 --- a/Assets/XLua/Gen/XLuaGenAutoRegister.cs +++ b/Assets/XLua/Gen/XLuaGenAutoRegister.cs @@ -2271,6 +2271,9 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(MonkeyPost), MonkeyPostWrap.__Register); + translator.DelayWrapLoader(typeof(AFAdRevenueEvent), AFAdRevenueEventWrap.__Register); + + translator.DelayWrapLoader(typeof(UIInputHelper), UIInputHelperWrap.__Register); @@ -2369,14 +2372,14 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(IronSourceConstants), IronSourceConstantsWrap.__Register); - - translator.DelayWrapLoader(typeof(IronSourceError), IronSourceErrorWrap.__Register); - } static void wrapInit15(LuaEnv luaenv, ObjectTranslator translator) { + translator.DelayWrapLoader(typeof(IronSourceError), IronSourceErrorWrap.__Register); + + translator.DelayWrapLoader(typeof(IronSourceEvents), IronSourceEventsWrap.__Register); @@ -2479,6 +2482,9 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(IronSourceJSON.Json), IronSourceJSONJsonWrap.__Register); + translator.DelayWrapLoader(typeof(AppsFlyerSDK.AppsFlyerAdRevenue), AppsFlyerSDKAppsFlyerAdRevenueWrap.__Register); + + translator.DelayWrapLoader(typeof(com.adjust.sdk.JSONNode), comadjustsdkJSONNodeWrap.__Register); @@ -2523,16 +2529,16 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(com.adjust.sdk.AdjustLogLevelExtension), comadjustsdkAdjustLogLevelExtensionWrap.__Register); + } + + static void wrapInit16(LuaEnv luaenv, ObjectTranslator translator) + { translator.DelayWrapLoader(typeof(com.adjust.sdk.AdjustPlayStoreSubscription), comadjustsdkAdjustPlayStoreSubscriptionWrap.__Register); translator.DelayWrapLoader(typeof(com.adjust.sdk.AdjustSessionFailure), comadjustsdkAdjustSessionFailureWrap.__Register); - } - - static void wrapInit16(LuaEnv luaenv, ObjectTranslator translator) - { translator.DelayWrapLoader(typeof(com.adjust.sdk.AdjustSessionSuccess), comadjustsdkAdjustSessionSuccessWrap.__Register); @@ -2680,16 +2686,16 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(UnityEngine.Camera.RenderRequestOutputSpace), UnityEngineCameraRenderRequestOutputSpaceWrap.__Register); + } + + static void wrapInit17(LuaEnv luaenv, ObjectTranslator translator) + { translator.DelayWrapLoader(typeof(UnityEngine.TextCore.FaceInfo), UnityEngineTextCoreFaceInfoWrap.__Register); translator.DelayWrapLoader(typeof(UnityEngine.Rendering.LightShadowResolution), UnityEngineRenderingLightShadowResolutionWrap.__Register); - } - - static void wrapInit17(LuaEnv luaenv, ObjectTranslator translator) - { translator.DelayWrapLoader(typeof(UnityEngine.RenderTextureFormat), UnityEngineRenderTextureFormatWrap.__Register); @@ -2837,16 +2843,16 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(UnityEngine.UI.ScrollRect.MovementType), UnityEngineUIScrollRectMovementTypeWrap.__Register); + } + + static void wrapInit18(LuaEnv luaenv, ObjectTranslator translator) + { translator.DelayWrapLoader(typeof(UnityEngine.UI.ScrollRect.ScrollbarVisibility), UnityEngineUIScrollRectScrollbarVisibilityWrap.__Register); translator.DelayWrapLoader(typeof(UnityEngine.UI.Slider.Direction), UnityEngineUISliderDirectionWrap.__Register); - } - - static void wrapInit18(LuaEnv luaenv, ObjectTranslator translator) - { translator.DelayWrapLoader(typeof(UnityEngine.UI.Toggle.ToggleTransition), UnityEngineUIToggleToggleTransitionWrap.__Register); @@ -2994,16 +3000,16 @@ namespace XLua.CSObjectWrap translator.DelayWrapLoader(typeof(ThinkingAnalytics.ThinkingAnalyticsAPI.TATimeZone), ThinkingAnalyticsThinkingAnalyticsAPITATimeZoneWrap.__Register); + } + + static void wrapInit19(LuaEnv luaenv, ObjectTranslator translator) + { translator.DelayWrapLoader(typeof(ThinkingAnalytics.ThinkingAnalyticsAPI.TAMode), ThinkingAnalyticsThinkingAnalyticsAPITAModeWrap.__Register); translator.DelayWrapLoader(typeof(ThinkingAnalytics.ThinkingAnalyticsAPI.NetworkType), ThinkingAnalyticsThinkingAnalyticsAPINetworkTypeWrap.__Register); - } - - static void wrapInit19(LuaEnv luaenv, ObjectTranslator translator) - { translator.DelayWrapLoader(typeof(Http.RequestState), HttpRequestStateWrap.__Register); diff --git a/Assets/XLua/Gen/link.xml b/Assets/XLua/Gen/link.xml index 487ec2815..07cb23734 100644 --- a/Assets/XLua/Gen/link.xml +++ b/Assets/XLua/Gen/link.xml @@ -201,6 +201,7 @@ + @@ -269,6 +270,7 @@ +