diff --git a/sdk-intergration/Assets/MaxSdk/Resources/AppLovinSettings.asset b/sdk-intergration/Assets/MaxSdk/Resources/AppLovinSettings.asset index 5ec7a1f..1117c96 100644 --- a/sdk-intergration/Assets/MaxSdk/Resources/AppLovinSettings.asset +++ b/sdk-intergration/Assets/MaxSdk/Resources/AppLovinSettings.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: AppLovinSettings m_EditorClassIdentifier: qualityServiceEnabled: 1 - sdkKey: OmDRO8whS_xJT0fChdR0d_v0wqSKGaEhzs6W8SKO-Lspt2WA_ZpCmlTTHBVTEEDMET5hw4vN9SmtK5x4_eEHsR + sdkKey: rW51GKWqpT99uzHaOQH36OihVd51teKXIfDdTnAzXH70rsTUMSQuyMb7SqmEZzq2qN4B1sFZZPPdlHTOhxQPIC setAttributionReportEndpoint: 0 addApsSkAdNetworkIds: 0 customGradleVersionUrl: diff --git a/sdk-intergration/Assets/Scripts/SDKTest.cs b/sdk-intergration/Assets/Scripts/SDKTest.cs index b6ba70b..0aff496 100644 --- a/sdk-intergration/Assets/Scripts/SDKTest.cs +++ b/sdk-intergration/Assets/Scripts/SDKTest.cs @@ -169,14 +169,29 @@ public class SDKTest : MonoBehaviour public void OnGaBtn() { - Debug.LogError("Ga ask"); - using (var e = GAEvent.TackEvent("idcheckdone")) - { - e.AddContent("test ga", true); - } + //Debug.LogError("Ga ask"); + //using (var e = GAEvent.TackEvent("idcheckdone")) + //{ + //e.AddContent("test ga", true); + //} } - const string AD_ID = "427b872c314ad1f3"; + /* + Android AD ID +c6c49a100de8496c +05c86d0f2be7b55b +7cf556b464448b7b +b6c56eb121b10c98 + + iOS AD ID +24414b2f75660ea4 +86409c4730a1d9bb +ec3c8fd688cdb5e2 +eb68f93a08156e04 +*/ + + + const string AD_ID = "24414b2f75660ea4"; public void OnAppMaxBtn() { @@ -250,14 +265,14 @@ public class SDKTest : MonoBehaviour { string msg = $"[AD LOG]Rewarded ad received reward. ID: {adUnitId}. Type: {reward}. Amount: {reward.Amount}"; _messageTxt.text = msg; - Debug.Log(msg); + Debug.Log($"[AD LOG]Rewarded ad received reward \n {reward.ToString()} \n {adInfo.ToString()}"); } private void OnRewardedAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo) { string msg = $"[AD LOG]Rewarded ad revenue paid. ID: {adUnitId}."; _messageTxt.text = msg; - Debug.Log(msg); + Debug.Log($"[AD LOG]Rewarded ad revenue paid \n {adInfo.ToString()}"); } diff --git a/sdk-intergration/Packages/tysdk/Editor/IOSBuildProcessor.cs b/sdk-intergration/Packages/tysdk/Editor/IOSBuildProcessor.cs index b09ea42..a2e36f2 100644 --- a/sdk-intergration/Packages/tysdk/Editor/IOSBuildProcessor.cs +++ b/sdk-intergration/Packages/tysdk/Editor/IOSBuildProcessor.cs @@ -41,9 +41,15 @@ namespace tysdk.editor private static void XcodeOverwriteFiles(string projPath, PBXProject proj) { - var mainAppPath = Path.Combine(projPath, "Classes", "Preprocessor.h"); - var mainContent = File.ReadAllText(mainAppPath); - var newContent = mainContent.Replace("#define UNITY_USES_REMOTE_NOTIFICATIONS 0", "#define UNITY_USES_REMOTE_NOTIFICATIONS 1"); + + string mainAppPath = Path.Combine(projPath, "MainApp", "main.mm"); + string mainContent = File.ReadAllText(mainAppPath); + string newContent = mainContent.Replace("#include ", @"#include ""../UnityFramework/UnityFramework.h"""); + File.WriteAllText(mainAppPath, newContent); + + mainAppPath = Path.Combine(projPath, "Classes", "Preprocessor.h"); + mainContent = File.ReadAllText(mainAppPath); + newContent = mainContent.Replace("#define UNITY_USES_REMOTE_NOTIFICATIONS 0", "#define UNITY_USES_REMOTE_NOTIFICATIONS 1"); File.WriteAllText(mainAppPath, newContent); } diff --git a/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs b/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs index b951f28..dc0baf3 100644 --- a/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs +++ b/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade.cs @@ -12,11 +12,21 @@ namespace tysdk { public class AccountInfo { +#if UNITY_ANDROID + + private static Dictionary accoutTypeMap = new Dictionary(){ + {EAccoutType.hwGoogle.ToString(), EAccoutType.hwGoogle}, + {EAccoutType.hwFacebook.ToString(), EAccoutType.hwFacebook}, + {"tyGuest", EAccoutType.hwGuest} + }; +#else + private static Dictionary accoutTypeMap = new Dictionary(){ {"google", EAccoutType.hwGoogle}, {"fb", EAccoutType.hwFacebook}, {"tyGuest", EAccoutType.hwGuest} }; +#endif public int userId; public string token; @@ -128,7 +138,7 @@ namespace tysdk =================================================*/ - public bool IsLoggedIn => _accountInfo != null; + public static bool IsLoggedIn => _accountInfo != null; public void Logout() { @@ -180,7 +190,7 @@ namespace tysdk public async Task LoginByToken() { var accoutInfo = AccountInfo.GetSavedAccoutInfo(); - if(accoutInfo == null) new LoginInfo(); + if(accoutInfo == null) return new LoginInfo(); var taskSource = new TaskCompletionSource(); callbacks.Add("LoginResult", (ITYSdkCallback callback) => diff --git a/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade_GA.cs b/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade_GA.cs index d2c01a0..f8cc660 100644 --- a/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade_GA.cs +++ b/sdk-intergration/Packages/tysdk/Runtime/TYSdkFacade_GA.cs @@ -1,5 +1,3 @@ -using System; -using Newtonsoft.Json.Linq; using UnityEngine; namespace tysdk @@ -38,14 +36,15 @@ namespace tysdk GA_ABTest = 10, //abtest相关事件 } + /* public class GAEvent : IDisposable { private GATrackType eventType; private string eventName; bool AFSend = true; - public static string ABTestValue = "0"; private JObject content = new JObject(); + public static Dictionary extraContent = new Dictionary(); public GAEvent(GATrackType eventType, string eventName, bool AFSend = true) { @@ -57,8 +56,7 @@ namespace tysdk public GAEvent AddContent(string key, string value) { content[key] = value; - return this; - } + return this; } public GAEvent AddContent(string key, int value) { @@ -78,11 +76,40 @@ namespace tysdk return this; } + public GAEvent AddContent(string key, JToken value) + { + content[key] = value; + return this; + } + public void Dispose() { - content["ABTestValue"] = ABTestValue; - TYSdkFacade.Instance.EventTrack((int)eventType, eventName, content.ToString()); + foreach (var item in extraContent) + { + content[item.Key] = item.Value; + } + + string msg = content.ToString(); + if (msg == String.Empty) return; + + if (AFSend) + { + SendAfEvent(eventType,eventName,msg); + } + + TYSdkFacade.Instance.EventTrack((int)eventType, eventName, msg); + + content.RemoveAll(); } + + private void SendAfEvent(GATrackType type,string eventName,string logMessage) + { + Dictionary eventValues = new Dictionary(); + eventValues.Add("GA_TYPE", type.ToString()); + eventValues.Add(eventName, logMessage); + AppsFlyer.sendEvent(AFInAppEvents.GA, eventValues); + } +*/ /* *GA_TRACK(默认类型) @@ -98,6 +125,7 @@ namespace tysdk *GA_PROFILE(设置用户特征 */ //TOD SDK + /* public static GAEvent TackEvent(string eventName, bool afSend = true) { return new GAEvent(GATrackType.GA_TRACK, eventName, afSend); @@ -128,4 +156,5 @@ namespace tysdk return new GAEvent(GATrackType.GA_LOGIN, eventName, afSend); } } -} \ No newline at end of file + */ +} diff --git a/sdk-intergration/Packages/tysdk/Runtime/TYSdkModel.cs b/sdk-intergration/Packages/tysdk/Runtime/TYSdkModel.cs index ea1ed88..cec85b5 100644 --- a/sdk-intergration/Packages/tysdk/Runtime/TYSdkModel.cs +++ b/sdk-intergration/Packages/tysdk/Runtime/TYSdkModel.cs @@ -1,4 +1,4 @@ - + using System.Collections.Generic; using System.Linq; @@ -58,10 +58,11 @@ namespace tysdk return new SKUDetail() { price = x["price"].ToString(), productId = x["productId"].ToString(), - LocaleCurrencyCode = x["LocaleCurrencyCode"].ToString(), + price_currency_code = x["LocaleCurrencyCode"].ToString(), localeCurrencySymbol = x["localeCurrencySymbol"].ToString(), localizedDescription = x["localizedDescription"].ToString(), - title = x["localizedTitle"].ToString() + title = x["localizedTitle"].ToString(), + ProdKey = x["productIdentifier"].ToString() }; }).ToList(); products = prodList; @@ -90,13 +91,14 @@ namespace tysdk public string ProdPriceStr => price; public float ProdPrice => float.Parse(price_amount_micros) / 1000000; public string ProdID => ourProductId; + public string ProdKey => productId; } #elif UNITY_IOS public class SKUDetail { public string price; public string productId; - public string LocaleCurrencyCode; + public string price_currency_code; public string localeCurrencySymbol; public string localizedDescription; public string title; @@ -105,6 +107,7 @@ namespace tysdk public string ProdPriceStr => price; public float ProdPrice => float.Parse(price); public string ProdID => productId; + public string ProdKey; public override string ToString() { diff --git a/sdk-intergration/Packages/tysdk/Runtime/tysdk.asmdef b/sdk-intergration/Packages/tysdk/Runtime/tysdk.asmdef index 445894d..96408a6 100644 --- a/sdk-intergration/Packages/tysdk/Runtime/tysdk.asmdef +++ b/sdk-intergration/Packages/tysdk/Runtime/tysdk.asmdef @@ -1,9 +1,7 @@ { "name": "tysdk", "rootNamespace": "tysdk", - "references": [ - "GUID:2a37df438292d4903b4e5159c5de3bf9" - ], + "references": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, diff --git a/sdk-intergration/ProjectSettings/ProjectSettings.asset b/sdk-intergration/ProjectSettings/ProjectSettings.asset index 64a66c1..41f2a59 100644 --- a/sdk-intergration/ProjectSettings/ProjectSettings.asset +++ b/sdk-intergration/ProjectSettings/ProjectSettings.asset @@ -261,7 +261,7 @@ PlayerSettings: AndroidTargetDevices: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} - AndroidKeystoreName: '{inproject}: keystore/bamboogame.keystore' + AndroidKeystoreName: /Users/tech/workspace/n3-world/client/Client/KeyStore/bamboogame.keystore AndroidKeyaliasName: fishing AndroidEnableArmv9SecurityFeatures: 0 AndroidBuildApkPerCpuArchitecture: 0