fix:1、sdk更换。2、修复bug
This commit is contained in:
Binary file not shown.
@@ -1,14 +0,0 @@
|
||||
<linker>
|
||||
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.TextAsset" preserve="all" />
|
||||
</assembly>
|
||||
</linker>
|
||||
@@ -92,6 +92,7 @@ namespace IgnoreOPS
|
||||
|
||||
public string X_Redeemcode;
|
||||
public string X_ShopURL;
|
||||
public int StatementSwitch;
|
||||
|
||||
|
||||
public CommonModel(string key) : base(key)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using SGModule.ConfigLoader;
|
||||
|
||||
namespace IgnoreOPS
|
||||
{
|
||||
public class ExchangeRateModel : ConfigModel<ExchangeRateModel, ExchangeRate>
|
||||
{
|
||||
public ExchangeRateModel(string key) : base(key)
|
||||
{
|
||||
}
|
||||
}
|
||||
public class ExchangeRate
|
||||
{
|
||||
public int ID;
|
||||
public List<string> CountryKey;
|
||||
public float Multi;
|
||||
public string Payicon;
|
||||
public string Currency;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d752db403aea40898931f762a1a83e5b
|
||||
timeCreated: 1783386736
|
||||
@@ -8,6 +8,7 @@ namespace FGUI.Login_05
|
||||
public partial class com_login_privacy : GComponent
|
||||
{
|
||||
public GRichTextField text_privacy_user;
|
||||
public GRichTextField text_privacy_user1;
|
||||
public const string URL = "ui://8u2p5uv6opwg8";
|
||||
|
||||
public static com_login_privacy CreateInstance()
|
||||
@@ -20,6 +21,7 @@ namespace FGUI.Login_05
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
text_privacy_user = (GRichTextField)GetChildAt(2);
|
||||
text_privacy_user1 = (GRichTextField)GetChildAt(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,8 +50,10 @@ namespace FGUI.tixian
|
||||
public cash_levelcom com_chlevel;
|
||||
public GGroup group_;
|
||||
public GTextField lab_mn;
|
||||
public GTextField text_rate1;
|
||||
public GList list_kicket;
|
||||
public GTextField lab_mn2;
|
||||
public GTextField text_rate;
|
||||
public GTextField lab_ticket;
|
||||
public GTextField lab_code;
|
||||
public btn_code btn_copy;
|
||||
@@ -116,8 +118,10 @@ namespace FGUI.tixian
|
||||
com_chlevel = (cash_levelcom)GetChildAt(60);
|
||||
group_ = (GGroup)GetChildAt(61);
|
||||
lab_mn = (GTextField)GetChildAt(65);
|
||||
text_rate1 = (GTextField)GetChildAt(68);
|
||||
list_kicket = (GList)GetChildAt(70);
|
||||
lab_mn2 = (GTextField)GetChildAt(75);
|
||||
text_rate = (GTextField)GetChildAt(78);
|
||||
lab_ticket = (GTextField)GetChildAt(83);
|
||||
lab_code = (GTextField)GetChildAt(85);
|
||||
btn_copy = (btn_code)GetChildAt(86);
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace FGUI.tixian
|
||||
public btn_top btn_level1;
|
||||
public btn_top btn_level2;
|
||||
public GGroup group_;
|
||||
public GTextField text_title_2;
|
||||
public GTextField text_smaill_title;
|
||||
public com_enter com_info;
|
||||
public com_firstname com_fname;
|
||||
@@ -40,8 +39,10 @@ namespace FGUI.tixian
|
||||
public btn_pay btn_watch;
|
||||
public GImage card_;
|
||||
public GTextField lab_mn;
|
||||
public GTextField text_rate1;
|
||||
public GList list_kicket;
|
||||
public GTextField lab_mn2;
|
||||
public GTextField text_rate;
|
||||
public GTextField lab_ticket;
|
||||
public GTextField lab_code;
|
||||
public btn_code btn_copy;
|
||||
@@ -81,31 +82,32 @@ namespace FGUI.tixian
|
||||
btn_level1 = (btn_top)GetChildAt(22);
|
||||
btn_level2 = (btn_top)GetChildAt(23);
|
||||
group_ = (GGroup)GetChildAt(24);
|
||||
text_title_2 = (GTextField)GetChildAt(25);
|
||||
text_smaill_title = (GTextField)GetChildAt(26);
|
||||
com_info = (com_enter)GetChildAt(27);
|
||||
com_fname = (com_firstname)GetChildAt(28);
|
||||
com_lname = (com_lastname)GetChildAt(29);
|
||||
com_pay = (com_info)GetChildAt(30);
|
||||
text_smaill_title_2 = (GTextField)GetChildAt(31);
|
||||
text_ch = (GTextField)GetChildAt(34);
|
||||
text_account = (GTextField)GetChildAt(35);
|
||||
com_task = (com_task)GetChildAt(38);
|
||||
com_newRecord = (com_newRecord)GetChildAt(39);
|
||||
btn_watch = (btn_pay)GetChildAt(40);
|
||||
card_ = (GImage)GetChildAt(42);
|
||||
lab_mn = (GTextField)GetChildAt(45);
|
||||
list_kicket = (GList)GetChildAt(51);
|
||||
lab_mn2 = (GTextField)GetChildAt(55);
|
||||
lab_ticket = (GTextField)GetChildAt(62);
|
||||
lab_code = (GTextField)GetChildAt(64);
|
||||
btn_copy = (btn_code)GetChildAt(65);
|
||||
btn_contact_us = (btn_code)GetChildAt(66);
|
||||
btn_back = (GButton)GetChildAt(70);
|
||||
btn_task_watch = (GButton)GetChildAt(75);
|
||||
btn_inline_ok = (btn_get)GetChildAt(76);
|
||||
broad = (com_broadcast)GetChildAt(77);
|
||||
btn_close = (GButton)GetChildAt(78);
|
||||
text_smaill_title = (GTextField)GetChildAt(25);
|
||||
com_info = (com_enter)GetChildAt(26);
|
||||
com_fname = (com_firstname)GetChildAt(27);
|
||||
com_lname = (com_lastname)GetChildAt(28);
|
||||
com_pay = (com_info)GetChildAt(29);
|
||||
text_smaill_title_2 = (GTextField)GetChildAt(30);
|
||||
text_ch = (GTextField)GetChildAt(33);
|
||||
text_account = (GTextField)GetChildAt(34);
|
||||
com_task = (com_task)GetChildAt(37);
|
||||
com_newRecord = (com_newRecord)GetChildAt(38);
|
||||
btn_watch = (btn_pay)GetChildAt(39);
|
||||
card_ = (GImage)GetChildAt(41);
|
||||
lab_mn = (GTextField)GetChildAt(44);
|
||||
text_rate1 = (GTextField)GetChildAt(46);
|
||||
list_kicket = (GList)GetChildAt(50);
|
||||
lab_mn2 = (GTextField)GetChildAt(54);
|
||||
text_rate = (GTextField)GetChildAt(56);
|
||||
lab_ticket = (GTextField)GetChildAt(61);
|
||||
lab_code = (GTextField)GetChildAt(63);
|
||||
btn_copy = (btn_code)GetChildAt(64);
|
||||
btn_contact_us = (btn_code)GetChildAt(65);
|
||||
btn_back = (GButton)GetChildAt(69);
|
||||
btn_task_watch = (GButton)GetChildAt(74);
|
||||
btn_inline_ok = (btn_get)GetChildAt(75);
|
||||
broad = (com_broadcast)GetChildAt(76);
|
||||
btn_close = (GButton)GetChildAt(77);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using DG.Tweening;
|
||||
using Spine.Unity;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Random = UnityEngine.Random;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Linq;
|
||||
@@ -377,6 +378,32 @@ namespace ChillConnect
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static ExchangeRate GetExchangeRateVo()
|
||||
{
|
||||
var code = "JP";//GetCurrCountry();
|
||||
var voList = ConfigSystem.GetConfig<ExchangeRateModel>().DataList;
|
||||
foreach (var exchangeRateVo in voList.Where(exchangeRateVo => exchangeRateVo.CountryKey.Contains(code)))
|
||||
{
|
||||
return exchangeRateVo;
|
||||
}
|
||||
return voList[0];
|
||||
}
|
||||
|
||||
public static string GetCurrCountry()
|
||||
{
|
||||
string countryCode = "US";
|
||||
try
|
||||
{
|
||||
countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;
|
||||
Debug.Log("国家代码: " + countryCode); // 例如:US, CN, JP, DE 等
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.LogError("无法获取国家代码: " + e.Message);
|
||||
}
|
||||
return countryCode.ToUpper();
|
||||
}
|
||||
|
||||
public static string GetPlayerInviteCode()
|
||||
{
|
||||
@@ -459,7 +486,7 @@ namespace ChillConnect
|
||||
//is debug test--------
|
||||
|
||||
|
||||
// return true;//zhushi
|
||||
return true;//zhushi
|
||||
// return false;//zhushi
|
||||
// return false;//zhushi
|
||||
return GetLoginModel().IsMagic;
|
||||
@@ -542,7 +569,8 @@ namespace ChillConnect
|
||||
{
|
||||
currency102 = DataMgr.Ticket.Value;
|
||||
}
|
||||
|
||||
var exchangeRateVo = GetExchangeRateVo();
|
||||
currency102 = (decimal)exchangeRateVo.Multi * currency102;
|
||||
if (IsGiftSwitch())
|
||||
{
|
||||
if (isRDExchangeMode())
|
||||
@@ -551,7 +579,7 @@ namespace ChillConnect
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"${currency102:N}";
|
||||
return $"{exchangeRateVo.Payicon}{currency102:N}";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -568,14 +596,16 @@ namespace ChillConnect
|
||||
|
||||
public static string getChString(decimal ch)
|
||||
{
|
||||
var exchangeRateVo = GetExchangeRateVo();
|
||||
ch = (decimal)exchangeRateVo.Multi * ch;
|
||||
if (GameHelper.isRDExchangeMode()&&GameHelper.IsGiftSwitch())
|
||||
{
|
||||
string str = "<img src='ui://o9974uc5qbo98'/>";
|
||||
return str + $"$ {ch:N}";
|
||||
return str + $"{exchangeRateVo.Payicon}{ch:N}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"${ch:N}";
|
||||
return $"{exchangeRateVo.Currency}{ch:N}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,12 +645,14 @@ namespace ChillConnect
|
||||
GameHelper.ShowTips("Trying to call send mail...");
|
||||
}
|
||||
|
||||
public static string GetCurrCountry()
|
||||
{
|
||||
var loginModel = GetLoginModel();
|
||||
var country = loginModel.Country;
|
||||
return country.ToUpper();
|
||||
}
|
||||
// public static string GetCurrCountry()
|
||||
// {
|
||||
// var loginModel = GetLoginModel();
|
||||
// var country = loginModel.Country;
|
||||
// return country.ToUpper();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public static bool CheckAccountValidly(string account)
|
||||
{
|
||||
@@ -1344,7 +1376,7 @@ namespace ChillConnect
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
public static bool IsTemporaryEnd;
|
||||
|
||||
private static GameObject RainPlayUI;
|
||||
|
||||
@@ -1361,13 +1393,17 @@ namespace ChillConnect
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsTemporaryEnd;
|
||||
|
||||
private static int ShowStatementViewCount = 0;
|
||||
public static void ShowStatementView()
|
||||
{
|
||||
if (ShowStatementViewCount > 0) return;
|
||||
if (!IsGiftSwitch()) return;
|
||||
if (ConfigSystem.GetConfig<CommonModel>().StatementSwitch == 0)
|
||||
{
|
||||
HallManager.Instance.openTipsTimes++;
|
||||
ShowStatementViewCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
ShowStatementViewCount++;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.StatementViewUI_Open);
|
||||
@@ -1375,12 +1411,7 @@ namespace ChillConnect
|
||||
public static void IsShowPettyReward()
|
||||
{
|
||||
if (!IsGiftSwitch()) return;
|
||||
|
||||
Debug.Log($"PreferencesMgr.Instance.IsGetPettyReward===={SaveData.GetSaveObject().IsGetPettyReward}");
|
||||
if (SaveData.GetSaveObject().IsGetPettyReward) return;
|
||||
|
||||
SaveData.GetSaveObject().IsGetPettyReward = true;
|
||||
SaveData.saveDataFunc();
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PettyAwardUI_Open);
|
||||
}
|
||||
|
||||
@@ -1389,7 +1420,9 @@ namespace ChillConnect
|
||||
{
|
||||
// if (!GameHelper.IsGiftSwitch())
|
||||
var isGet = SaveData.GetSaveObject().IsGetFirstReward;
|
||||
if (loginModel.NewPlayer || !isGet )
|
||||
Debug.Log($"NewPlayer===={GetLoginModel().NewPlayer}");
|
||||
|
||||
if (GetLoginModel().NewPlayer )
|
||||
{
|
||||
if (IsGiftSwitch())
|
||||
{
|
||||
@@ -1400,6 +1433,9 @@ namespace ChillConnect
|
||||
var awardNum = ConfigSystem.GetConfig<CommonModel>().InitialNum;
|
||||
addMoney(awardNum);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Update102);
|
||||
|
||||
//小额发放
|
||||
IsShowPettyReward();
|
||||
}
|
||||
|
||||
AddGoldNumber(50);
|
||||
@@ -1632,7 +1668,6 @@ namespace ChillConnect
|
||||
}
|
||||
public static string getDesByKey(string key)
|
||||
{
|
||||
Debug.Log(key);
|
||||
Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<ExchangeDesModel>().DataList));
|
||||
if (isRDExchangeMode())
|
||||
{
|
||||
@@ -1694,11 +1729,15 @@ namespace ChillConnect
|
||||
}
|
||||
public static string getPrice(decimal ch)
|
||||
{
|
||||
return $"${ch:N}";
|
||||
var vo = GetExchangeRateVo();
|
||||
ch *= (decimal)vo.Multi;
|
||||
return $"{vo.Payicon}{ch:N}";
|
||||
}
|
||||
public static string GetPriceInt(decimal ch)
|
||||
{
|
||||
return $"${ch:N0}";
|
||||
var vo = GetExchangeRateVo();
|
||||
ch *= (decimal)vo.Multi;
|
||||
return $"{vo.Payicon}{ch:N0}";
|
||||
}
|
||||
public static void CopyText(string text)
|
||||
{
|
||||
|
||||
@@ -68,23 +68,19 @@ namespace ChillConnect
|
||||
MaxPayManager.Instance.PaySuccess();
|
||||
}
|
||||
|
||||
var last_time = PlayerPrefs.GetInt("Dayreftimes", 0);
|
||||
DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
newDate = newDate.AddSeconds(GameHelper.GetNowTime(true));
|
||||
// Debug.Log($"barry newdate==== {newDate}");
|
||||
var newDays = newDate.Day;
|
||||
|
||||
}
|
||||
private void OnGameStart(object obj)
|
||||
{
|
||||
var lang = PlayerPrefsKit.ReadString("LangIdKey");
|
||||
if (lang.IsNullOrWhiteSpace())
|
||||
{
|
||||
lang = "en";
|
||||
}
|
||||
|
||||
// var lang = PlayerPrefsKit.ReadString("LangIdKey");
|
||||
// if (lang.IsNullOrWhiteSpace())
|
||||
// {
|
||||
// lang = "en";
|
||||
// }
|
||||
|
||||
// UIManager.Instance.SetSwitchLanguage(lang);
|
||||
|
||||
|
||||
EnterHall(true);
|
||||
isGameStart = true;
|
||||
|
||||
@@ -103,8 +99,6 @@ namespace ChillConnect
|
||||
|
||||
private void EnterHall(object obj = null)
|
||||
{
|
||||
// int index = obj != null ? (int)obj : 2;
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PlayUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardAniUI_Close);
|
||||
AudioManager.Instance.StopBGM();
|
||||
@@ -112,45 +106,6 @@ namespace ChillConnect
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ArrowGameUI_Open);
|
||||
|
||||
// if (GameHelper.IsGiftSwitch() && (obj != null))
|
||||
// {
|
||||
// int h5rate = GameHelper.GetCommonModel().loginhallrate;
|
||||
// int roomrate = GameHelper.GetCommonModel().roomrate;
|
||||
// // if (UnityEngine.Random.Range(1, 100) < h5rate) {
|
||||
// // UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
// // } else
|
||||
// if (UnityEngine.Random.Range(1, 100) < roomrate)
|
||||
// {//进入玩法
|
||||
//
|
||||
// GameHelper.is_first_login = false;
|
||||
// if (!SaveData.GetSaveObject().have_slot && (DateTime.Now.Day != PlayerPrefs.GetInt("off_new", 0)))
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
// PlayerPrefs.SetInt("off_new", DateTime.Now.Day);
|
||||
// }
|
||||
// if (!SaveData.GetSaveObject().have_slot && UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().BonusInside)
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RainPlayUI_Open, true);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.is_first_login = false;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open, true);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.is_first_login = false;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
// }
|
||||
|
||||
|
||||
if (GameHelper.IsGiftSwitch()) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BroadcastUI_Open);
|
||||
GameHelper.PlayGameTimeEvent(1);
|
||||
}
|
||||
@@ -169,36 +124,43 @@ namespace ChillConnect
|
||||
|
||||
|
||||
private void OpenWb(object obj) {
|
||||
|
||||
return;
|
||||
if (obj is not SDKOpenConfig openConfig) return;
|
||||
|
||||
|
||||
|
||||
Debug.Log($"open wb normal==={openConfig.normal} url==={openConfig.url}");
|
||||
SdkConfigMgr.Instance.Open(openConfig.normal, openConfig.url);
|
||||
SetCameraVisible(false);
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open, openConfig);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
|
||||
if (UIManager.Instance.IsExistUI(UIConst.GameLoginUI))
|
||||
{
|
||||
Debug.Log($"gamelogin ui is exist ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetCameraVisible(bool visible)
|
||||
{
|
||||
// 只在首次调用时查找
|
||||
if (_gameCamera == null)
|
||||
{
|
||||
// 使用 FindWithTag 确保能找到非激活对象
|
||||
|
||||
_gameCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
|
||||
}
|
||||
if (_gameCamera != null)
|
||||
{
|
||||
_gameCamera.enabled = visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("GameCamera reference not found!");
|
||||
}
|
||||
// // 只在首次调用时查找
|
||||
// if (_gameCamera == null)
|
||||
// {
|
||||
// // 使用 FindWithTag 确保能找到非激活对象
|
||||
//
|
||||
// _gameCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
//
|
||||
// }
|
||||
// if (_gameCamera != null)
|
||||
// {
|
||||
// _gameCamera.enabled = visible;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.LogError("GameCamera reference not found!");
|
||||
// }
|
||||
|
||||
GameHelper.ShowSheepPlayUI(visible);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f350ea4eef759664d89ace7135894073
|
||||
guid: fac8fa45cc6559a4ebde3dc38d17090f
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 541f3088a89f3344a917bf89e6418b52
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42b11239795a857438cebb0b42577408
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51f8b691978644845a59d4da09bb72e3
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,240 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using DFFFQTVUv39wKIBSDK;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class DFFFQTVUv39wKIBSDKDemo : MonoBehaviour
|
||||
{
|
||||
public void ShowReward()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.ShowRewardVideo("TAG", b =>
|
||||
{
|
||||
Debug.LogError($"reward result = {b}");
|
||||
},(() =>
|
||||
{
|
||||
Debug.LogError($"reward close!!!");
|
||||
}));
|
||||
}
|
||||
|
||||
public void ShowInter()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.ShowInter("TAG", () =>
|
||||
{
|
||||
Debug.LogError("inter hide");
|
||||
});
|
||||
}
|
||||
|
||||
public void ShowAdmobInter()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.ShowAdmobInter("TAG", () =>
|
||||
{
|
||||
Debug.LogError("inter hide");
|
||||
});
|
||||
}
|
||||
|
||||
public void ShowSplash()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.ShowSplash();
|
||||
}
|
||||
|
||||
public void CheckReward(Image btnImg)
|
||||
{
|
||||
var isReady = DFFFQTVUv39wKIBSDK_Client.Instance.IsVideoReady();
|
||||
btnImg.color = isReady ? Color.green : Color.white;
|
||||
Debug.Log($"Reward : {isReady}");
|
||||
}
|
||||
|
||||
public void CheckInter(Image btnImg)
|
||||
{
|
||||
var isReady = DFFFQTVUv39wKIBSDK_Client.Instance.IsInterReady();
|
||||
btnImg.color = isReady ? Color.green : Color.white;
|
||||
Debug.Log($"Inter : {isReady}");
|
||||
}
|
||||
|
||||
public void CheckSplash(Image btnImg)
|
||||
{
|
||||
var isReady = DFFFQTVUv39wKIBSDK_Client.Instance.IsSplashReady();
|
||||
btnImg.color = isReady ? Color.green : Color.white;
|
||||
Debug.Log($"Splash : {isReady}");
|
||||
}
|
||||
|
||||
public void Track()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.Track("test", new Dictionary<string, string>()
|
||||
{
|
||||
{"evt1", "1"},
|
||||
{"evt2", "2"},
|
||||
{"evt3", "3"},
|
||||
{"evt4", "4"},
|
||||
{"evt5", "5"},
|
||||
{"evt6", "6"},
|
||||
{"evt7", "7"},
|
||||
{"evt8", "8"},
|
||||
{"evt9", "9"},
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void GetCountryCode()
|
||||
{
|
||||
|
||||
var code = DFFFQTVUv39wKIBSDK_Client.Instance.GetCountryCode();
|
||||
Debug.Log($"country : {code}");
|
||||
}
|
||||
|
||||
public void ShowH5()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.H5.ShowH5((() =>
|
||||
{
|
||||
Debug.Log("H5 close");
|
||||
}), () =>
|
||||
{
|
||||
Debug.Log($"H5 show failed!");
|
||||
});
|
||||
}
|
||||
|
||||
public void ShowH5WebView()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.H5.ShowWebView((() =>
|
||||
{
|
||||
Debug.Log("H5 close");
|
||||
}));
|
||||
}
|
||||
|
||||
public void ShowH5(RectTransform rectTransform)
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.H5.ShowH5(rectTransform);
|
||||
}
|
||||
|
||||
public void HideH5()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.H5.HideH5();
|
||||
}
|
||||
|
||||
public void CheckShowH5(Image btnImg)
|
||||
{
|
||||
var show = DFFFQTVUv39wKIBSDK_Client.Instance.H5.IsShowH5();
|
||||
btnImg.color = show ? Color.green : Color.red;
|
||||
Debug.Log($"CheckShowH5 : {show}");
|
||||
}
|
||||
|
||||
private int _level = 1;
|
||||
public void TrackLevel()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.TrackLevelUp(_level);
|
||||
if (Random.Range(0, 100) < 50)
|
||||
{
|
||||
_level++;
|
||||
}
|
||||
}
|
||||
|
||||
private string withDrawSceneId = "";
|
||||
public void GetWithDrawConfigs()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.GetWithDrawConfigs(((b, s) =>
|
||||
{
|
||||
Debug.Log($"GetWithDrawConfigs result : {b}, data : {s}");
|
||||
if (b)
|
||||
{
|
||||
var cfgs = JsonConvert.DeserializeObject<List<WithDrawConfig>>(s);
|
||||
int idx = 0;
|
||||
foreach (WithDrawConfig config in cfgs)
|
||||
{
|
||||
Debug.Log($"index = {idx}, {config.ToString()}");
|
||||
if (idx == 0)
|
||||
withDrawSceneId = config.SecneId;
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
}));
|
||||
}
|
||||
|
||||
private int payIndex = 0;
|
||||
public void CreateWithDrawOrder()
|
||||
{
|
||||
string taxNo = "99999999999";
|
||||
string payAccount = "tom@gmail.com";
|
||||
string accountType = "E";
|
||||
string payeeName = "testName";
|
||||
PaymentTypeCode payCode = PaymentTypeCode.PAYPAL;
|
||||
////GOPAY DANA 收款账号需要为电话号码
|
||||
//if (payIndex == 1 || payIndex == 0)
|
||||
//{
|
||||
// payCode = payIndex == 1 ? PaymentTypeCode.DANA : payCode;
|
||||
// payAccount = "0881234567890";
|
||||
// accountType = "P";
|
||||
//}
|
||||
//if (payIndex == 2)
|
||||
//{
|
||||
// // PIX 需要填写税号
|
||||
// payCode = PaymentTypeCode.PIX;
|
||||
// taxNo = "99999999999";
|
||||
//}
|
||||
//if (payIndex == 3) payCode = PaymentTypeCode.MERCADOPAGO;
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.CreateWithDrawOrder(withDrawSceneId, payCode, payAccount, accountType, payeeName, taxNo, b =>
|
||||
{
|
||||
Debug.Log($"CreateWithDrawOrder result : {b}");
|
||||
});
|
||||
|
||||
payIndex++;
|
||||
payIndex = payIndex > 3 ? 0 : payIndex;
|
||||
}
|
||||
|
||||
public void GetWithDrawOrders()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.GetWithDrawOrders(((b, s) =>
|
||||
{
|
||||
Debug.Log($"GetWithDrawOrders result : {b}, data : {s}");
|
||||
if (b)
|
||||
{
|
||||
var cfgs = JsonConvert.DeserializeObject<List<WithDrawOrder>>(s);
|
||||
int idx = 0;
|
||||
foreach (WithDrawOrder config in cfgs)
|
||||
{
|
||||
Debug.Log($"index = {idx}, {config.ToString()}");
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
Init();
|
||||
|
||||
Invoke("ShowSplash", 5);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.RegistIosParam((i =>
|
||||
{
|
||||
Debug.Log($"ios ab param : {i}");
|
||||
}));
|
||||
|
||||
void GameConfig(bool result, string config)
|
||||
{
|
||||
Debug.Log($"************* game config result : {result}, config : {config}");
|
||||
}
|
||||
|
||||
DFFFQTVUv39wKIBSDK_Client.Instance.Init(null, "app_config", GameConfig);
|
||||
}
|
||||
|
||||
public static string GetSdkVersion()
|
||||
{
|
||||
return DFFFQTVUv39wKIBSDK_Client.SdkVersion;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 959ec24a7131c9d488e5007fa82612be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7999829969770386720
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 520568642914021788}
|
||||
m_Layer: 0
|
||||
m_Name: Demo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &520568642914021788
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7999829969770386720}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5597cf0c8207a4448a9e84a8800d5cad
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 730a988606a036b4b92d1abb57c9d112
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,653 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using DFFFQTVUv39wKIBSDK;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class DFFFQTVUv39wKIBSDKConfigEditor : EditorWindow
|
||||
{
|
||||
private static DFFFQTVUv39wKIBSDKConfigEditor _view;
|
||||
|
||||
private int _emptyKwInterIdCount = 1;
|
||||
private int _emptyKwVideoIdCount = 1;
|
||||
|
||||
private int _emptyBigoInterIdCount = 1;
|
||||
private int _emptyBigoVideoIdCount = 1;
|
||||
|
||||
[MenuItem("Tools/设置 &G")]
|
||||
public static void ShowWin()
|
||||
{
|
||||
if (_view != null)
|
||||
{
|
||||
CloseView();
|
||||
return;
|
||||
}
|
||||
|
||||
var win = GetWindow<DFFFQTVUv39wKIBSDKConfigEditor>();
|
||||
win.minSize = new Vector2(790, 872);
|
||||
_view = win;
|
||||
RemoveExtraEmptyStrings(SDKConfig.KwaiInterUnitId, _view._emptyKwInterIdCount);
|
||||
RemoveExtraEmptyStrings(SDKConfig.KwaiVideoUnitId, _view._emptyKwVideoIdCount);
|
||||
RemoveExtraEmptyStrings(SDKConfig.BigoInterUnitId, _view._emptyBigoInterIdCount);
|
||||
RemoveExtraEmptyStrings(SDKConfig.BigoVideoUnitId, _view._emptyBigoVideoIdCount);
|
||||
win.Show();
|
||||
|
||||
#region topon
|
||||
|
||||
_view.loadPluginData();
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
static void CloseView()
|
||||
{
|
||||
_view.Close();
|
||||
_view = null;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
DrawWindow();
|
||||
EditorUtility.SetDirty(SDKConfig.Instance);
|
||||
}
|
||||
|
||||
#region Topon
|
||||
private AnyThink.Scripts.IntegrationManager.Editor.ATEditorCoroutine loadDataCoroutine;
|
||||
private AnyThink.Scripts.IntegrationManager.Editor.PluginData pluginData;
|
||||
private bool pluginDataLoadFailed;
|
||||
private void loadPluginData()
|
||||
{
|
||||
if (loadDataCoroutine != null)
|
||||
{
|
||||
loadDataCoroutine.Stop();
|
||||
}
|
||||
loadDataCoroutine = AnyThink.Scripts.IntegrationManager.Editor.ATEditorCoroutine.startCoroutine(AnyThink.Scripts.IntegrationManager.Editor.ATIntegrationManager.Instance.loadPluginData(data =>
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
pluginDataLoadFailed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ATLog.log("loadNetworksData() >>> pluginData: " + data);
|
||||
pluginData = data;
|
||||
pluginDataLoadFailed = false;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void DrawWindow()
|
||||
{
|
||||
TextLabel("基础配置");
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
#if UNITY_IOS
|
||||
SDKConfig.Instance.appsFlyerDevKey = DrawTextField("appsFlyerDevKey", SDKConfig.Instance.appsFlyerDevKey);
|
||||
SDKConfig.Instance.appsFlyerIosAppleAppId = DrawTextField("appsFlyerIosAppleAppId", SDKConfig.Instance.appsFlyerIosAppleAppId);
|
||||
#elif UNITY_ANDROID
|
||||
SDKConfig.Instance.appsFlyerDevKey = DrawTextField("appsFlyerDevKey", SDKConfig.Instance.appsFlyerDevKey);
|
||||
#endif
|
||||
SDKConfig.Instance.logReportUrl = DrawTextField("配置域名", SDKConfig.Instance.logReportUrl);
|
||||
SDKConfig.Instance.appKey = DrawTextField("appKey", SDKConfig.Instance.appKey);
|
||||
SDKConfig.Instance.appSecret = DrawTextField("appSecret", SDKConfig.Instance.appSecret);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
TextLabel("广告配置");
|
||||
|
||||
|
||||
#region MAX
|
||||
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
TextLabel("MAX", Color.cyan);
|
||||
SDKConfig.Instance.maxAppKey = DrawTextField("MaxSdkKey", SDKConfig.Instance.maxAppKey);
|
||||
SDKConfig.Instance.videoUnitId = DrawTextField("激励视频 ID", SDKConfig.Instance.videoUnitId);
|
||||
SDKConfig.Instance.interUnitId = DrawTextField("插屏 ID", SDKConfig.Instance.interUnitId);
|
||||
SDKConfig.Instance.bannerUnitId = DrawTextField("Banner ID", SDKConfig.Instance.bannerUnitId);
|
||||
SDKConfig.Instance.splashUnitId = DrawTextField("开屏 ID", SDKConfig.Instance.splashUnitId);
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
AppLovinSettings.Instance.SdkKey = SDKConfig.Instance.maxAppKey;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Topon
|
||||
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
TextLabel("Topon", Color.cyan);
|
||||
SDKConfig.Instance.toponAppId = DrawTextField("AppId", SDKConfig.Instance.toponAppId);
|
||||
SDKConfig.Instance.toponAppkey = DrawTextField("Appkey", SDKConfig.Instance.toponAppkey);
|
||||
SDKConfig.Instance.toponVideoUnitId = DrawTextField("激励视频 ID", SDKConfig.Instance.toponVideoUnitId);
|
||||
SDKConfig.Instance.toponInterUnitId = DrawTextField("插屏 ID", SDKConfig.Instance.toponInterUnitId);
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
var integrationManager = AnyThink.Scripts.IntegrationManager.Editor.ATIntegrationManager.Instance;
|
||||
bool isAdmobInstalledForAndroid = integrationManager.isAdmobInstalled(AnyThink.Scripts.IntegrationManager.Editor.ATConfig.OS_ANDROID);
|
||||
bool isAdmobInstalledForIos = integrationManager.isAdmobInstalled(AnyThink.Scripts.IntegrationManager.Editor.ATConfig.OS_IOS);
|
||||
|
||||
if (isAdmobInstalledForAndroid || isAdmobInstalledForIos)
|
||||
{
|
||||
if (isAdmobInstalledForAndroid)
|
||||
{
|
||||
var androidAdmobAppId = "ca-app-pub-3940256099942544~3347511713";
|
||||
integrationManager.setAdmobAppidByOs(pluginData, AnyThink.Scripts.IntegrationManager.Editor.ATConfig.OS_ANDROID, androidAdmobAppId);
|
||||
}
|
||||
if (isAdmobInstalledForIos)
|
||||
{
|
||||
var iosAdmobAppId = "ca-app-pub-3940256099942544~1458002511";
|
||||
integrationManager.setAdmobAppidByOs(pluginData, AnyThink.Scripts.IntegrationManager.Editor.ATConfig.OS_IOS, iosAdmobAppId);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#if UNITY_ANDROID
|
||||
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
EditorGUILayout.BeginHorizontal("frameBox");
|
||||
TextLabel("KWai", Color.cyan);
|
||||
DrawButton("插屏ID +", AddInterId);
|
||||
//DrawButton("插屏ID -", DelInterId);
|
||||
DrawButton("激励视频ID +", AddRewardId);
|
||||
//DrawButton("激励视频ID -", DelRewardId);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
SDKConfig.Instance.kwaiAppId = DrawTextField("AppId", SDKConfig.Instance.kwaiAppId);
|
||||
|
||||
for (int i = 0; i < SDKConfig.Instance.kwaiInterUnitId.Count; i++)
|
||||
{
|
||||
var index = i;
|
||||
GUILayout.BeginHorizontal();
|
||||
SDKConfig.Instance.kwaiInterUnitId[i] =
|
||||
DrawTextField("插屏ID - " + (i + 1), SDKConfig.Instance.kwaiInterUnitId[i]);
|
||||
DrawButtonX("X", () => DelInterId(index));
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < SDKConfig.Instance.kwaiVideoUnitId.Count; i++)
|
||||
{
|
||||
var index = i;
|
||||
GUILayout.BeginHorizontal();
|
||||
SDKConfig.Instance.kwaiVideoUnitId[i] =
|
||||
DrawTextField("激励视频ID - " + (i + 1), SDKConfig.Instance.kwaiVideoUnitId[i]);
|
||||
DrawButtonX("X", () => DelRewardId(index));
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
EditorGUILayout.BeginHorizontal("frameBox");
|
||||
TextLabel("Bigo", Color.cyan);
|
||||
DrawButton("插屏ID +", AddBigoInterId);
|
||||
DrawButton("激励视频ID +", AddBigoRewardId);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
SDKConfig.Instance.bigoAppId = DrawTextField("AppId", SDKConfig.Instance.bigoAppId);
|
||||
SDKConfig.Instance.bigoSplashUnitId = DrawTextField("开屏 ID", SDKConfig.Instance.bigoSplashUnitId);
|
||||
|
||||
for (int i = 0; i < SDKConfig.Instance.bigoInterUnitId.Count; i++)
|
||||
{
|
||||
//SDKConfig.Instance.bigoInterUnitId = DrawTextField("插屏 ID", SDKConfig.Instance.bigoInterUnitId);
|
||||
var index = i;
|
||||
GUILayout.BeginHorizontal();
|
||||
SDKConfig.Instance.bigoInterUnitId[i] =
|
||||
DrawTextField("插屏ID - " + (i + 1), SDKConfig.Instance.bigoInterUnitId[i]);
|
||||
DrawButtonX("X", () => DelBigoInterId(index));
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
for (int i = 0; i < SDKConfig.Instance.bigoVideoUnitId.Count; i++)
|
||||
{
|
||||
//SDKConfig.Instance.bigoVideoUnitId = DrawTextField("激励视频 ID", SDKConfig.Instance.bigoVideoUnitId);
|
||||
var index = i;
|
||||
GUILayout.BeginHorizontal();
|
||||
SDKConfig.Instance.bigoVideoUnitId[i] =
|
||||
DrawTextField("激励视频ID - " + (i + 1), SDKConfig.Instance.bigoVideoUnitId[i]);
|
||||
DrawButtonX("X", () => DelBigoRewardId(index));
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
#endif
|
||||
|
||||
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
SDKConfig.Instance.isUseAdmobSplash = DrawBoolField("启用开屏优化", SDKConfig.Instance.isUseAdmobSplash, "");
|
||||
if (SDKConfig.Instance.isUseAdmobSplash)
|
||||
{
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
TextLabel("Admob", Color.cyan);
|
||||
SDKConfig.Instance.admobAppId = DrawTextField("AppId", SDKConfig.Instance.admobAppId);
|
||||
SDKConfig.Instance.admobSplashUnitId = DrawTextField("开屏 ID", SDKConfig.Instance.admobSplashUnitId);
|
||||
//SDKConfig.Instance.admobInterUnitId = DrawTextField("插屏 ID", SDKConfig.Instance.admobInterUnitId);
|
||||
//SDKConfig.Instance.admobVideoUnitId = DrawTextField("激励视频 ID", SDKConfig.Instance.admobVideoUnitId);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
else
|
||||
{
|
||||
SDKConfig.Instance.admobSplashUnitId = string.Empty;
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
TextLabel("Debug");
|
||||
EditorGUILayout.BeginVertical("frameBox");
|
||||
SDKConfig.Instance.isDebug = DrawBoolField("测试模式", SDKConfig.Instance.isDebug, "正式发布时请勿勾选");
|
||||
SDKConfig.Instance.isPrintLog = DrawBoolField("日志打印", SDKConfig.Instance.isPrintLog, "正式发布时请勿勾选");
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
// 水平布局实现按钮靠右
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace(); // 左侧填充弹性空间
|
||||
if (GUILayout.Button(new GUIContent("从剪贴板获取参数", _tooltipText),
|
||||
GUILayout.Width(120),
|
||||
GUILayout.Height(30)
|
||||
))
|
||||
{
|
||||
ParseClipboard();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
|
||||
var sdkVersion = DFFFQTVUv39wKIBSDK_Client.SdkVersion;
|
||||
GUI.Label(new Rect(10, position.height - 40, 400, 40), "@version: " + sdkVersion);
|
||||
|
||||
EditorPrefs.SetString("sdk_version", sdkVersion);
|
||||
}
|
||||
|
||||
private string DrawTextField(string title, string content)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.Label(title, GUILayout.MinWidth(90), GUILayout.ExpandWidth(false));
|
||||
content = GUILayout.TextField(content);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
return content;
|
||||
}
|
||||
|
||||
private bool DrawBoolField(string title, bool content, string warn = "")
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.Label(title, GUILayout.MinWidth(80), GUILayout.ExpandWidth(false));
|
||||
content = EditorGUILayout.Toggle(content);
|
||||
if (content)
|
||||
{
|
||||
TextLabelWarn(warn);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
return content;
|
||||
}
|
||||
|
||||
private void TextLabel(string content, Color color = new Color())
|
||||
{
|
||||
if (color.Equals(Color.clear))
|
||||
{
|
||||
color = Color.gray;
|
||||
}
|
||||
GUIStyle style = new GUIStyle();
|
||||
style.contentOffset = new Vector2(8, 0);
|
||||
style.normal.textColor = color;
|
||||
style.fontSize = 14;
|
||||
style.padding = new RectOffset(0, 0, 3, 0);
|
||||
GUILayout.Label(content, style);
|
||||
}
|
||||
|
||||
private void TextLabelWarn(string content)
|
||||
{
|
||||
GUIStyle style = new GUIStyle();
|
||||
style.contentOffset = new Vector2(8, 0);
|
||||
style.normal.textColor = Color.red;
|
||||
style.fontSize = 14;
|
||||
style.padding = new RectOffset(0, 0, 3, 0);
|
||||
GUILayout.Label(content, style);
|
||||
}
|
||||
|
||||
private void DrawButton(string btnName, Action clickAction)
|
||||
{
|
||||
if (GUILayout.Button(btnName, GUILayout.Width(100), GUILayout.Height(30)))
|
||||
{
|
||||
clickAction?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawButtonX(string btnName, Action clickAction)
|
||||
{
|
||||
var originalBackgroundColor = GUI.backgroundColor;
|
||||
|
||||
// 设置按钮的背景颜色
|
||||
GUI.backgroundColor = Color.red;
|
||||
if (GUILayout.Button(btnName, GUILayout.Width(40), GUILayout.Height(18)))
|
||||
{
|
||||
clickAction?.Invoke();
|
||||
}
|
||||
|
||||
GUI.backgroundColor = originalBackgroundColor;
|
||||
}
|
||||
|
||||
private void AddInterId()
|
||||
{
|
||||
_emptyKwInterIdCount++;
|
||||
SDKConfig.KwaiInterUnitId.Add("");
|
||||
}
|
||||
|
||||
private void DelInterId(int index)
|
||||
{
|
||||
_emptyKwInterIdCount--;
|
||||
SDKConfig.KwaiInterUnitId.RemoveAt(index);
|
||||
}
|
||||
|
||||
private void AddRewardId()
|
||||
{
|
||||
_emptyKwVideoIdCount++;
|
||||
SDKConfig.KwaiVideoUnitId.Add("");
|
||||
}
|
||||
|
||||
private void DelRewardId(int index)
|
||||
{
|
||||
_emptyKwVideoIdCount--;
|
||||
SDKConfig.KwaiVideoUnitId.RemoveAt(index);
|
||||
}
|
||||
|
||||
private void AddBigoInterId()
|
||||
{
|
||||
_emptyBigoInterIdCount++;
|
||||
SDKConfig.BigoInterUnitId.Add("");
|
||||
}
|
||||
|
||||
private void DelBigoInterId(int index)
|
||||
{
|
||||
_emptyBigoInterIdCount--;
|
||||
SDKConfig.BigoInterUnitId.RemoveAt(index);
|
||||
}
|
||||
|
||||
private void AddBigoRewardId()
|
||||
{
|
||||
_emptyBigoVideoIdCount++;
|
||||
SDKConfig.BigoVideoUnitId.Add("");
|
||||
}
|
||||
|
||||
private void DelBigoRewardId(int index)
|
||||
{
|
||||
_emptyBigoVideoIdCount--;
|
||||
SDKConfig.BigoVideoUnitId.RemoveAt(index);
|
||||
}
|
||||
|
||||
static void RemoveExtraEmptyStrings(List<string> list, int count)
|
||||
{
|
||||
int emptyCount = count;
|
||||
if (list == null) return;
|
||||
// 先统计空字符串的数量
|
||||
for (int i = list.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (string.IsNullOrEmpty(list[i]))
|
||||
{
|
||||
emptyCount++;
|
||||
if (emptyCount > 1)
|
||||
{
|
||||
// 若空字符串数量超过 1,移除该元素
|
||||
list.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------- 参数解析 ------------------------------
|
||||
private string clipboardText = "";
|
||||
private Dictionary<string, string> parsedParameters = new Dictionary<string, string>();
|
||||
private readonly string _tooltipText = "需提前在参数列表界面 Ctrl + A 全选,然后再 Ctrl + C 复制";
|
||||
|
||||
|
||||
// 正则表达式模式字典,用于匹配不同类型的广告参数
|
||||
private static readonly Dictionary<string, string> parameterPatterns = new Dictionary<string, string>
|
||||
{
|
||||
// App基本信息
|
||||
{ "App名称", @"App name\s*([^\n]+)" },
|
||||
{ "AF Dev key", @"AF Dev key(?:[\s-]*iOS)?\s*([^\n]+)"},
|
||||
{ "APP KEY", @"a\s*p\s*p\s*k\s*e\s*y\s*([^\n]+)"},
|
||||
{ "APP Secret", @"a\s*p\s*p\s*s\s*e\s*c\s*r\s*e\s*t\s*([^\n]+)" },
|
||||
{ "包名", @"(?:正式包名|测试包名|包名)\*?\s+([^\n]+)"},
|
||||
{ "广告源", @"广告源\s*([^\n]+)" },
|
||||
{ "开发者邮箱", @"开发者邮箱\s*([^\n]+)" },
|
||||
{ "谷歌商店链接", @"谷歌商店链接\s*([^\n]+)" },
|
||||
{ "官网链接", @"官网链接\s*([^\n]+)" },
|
||||
{ "隐私协议", @"隐私协议\s*([^\n]+)" },
|
||||
{ "业务上报域名", @"(?:业务上报域名|业务域名)\s*([^\n]+)" },
|
||||
{ "appkey", @"appkey\s*([^\n]+)" },
|
||||
{ "appsecret", @"appsecret\s*([^\n]+)" },
|
||||
{"AF Apple Appid", @"(?i)app\s*id(?:\s+id)*\s*[=:]*\s*([^\n]*)"},
|
||||
|
||||
// MAX (兼容多种格式)
|
||||
{ "MAX 激励视频", @"MAX参数(?:-[^\s]+)?[\s\S]*?(?:激励视频|激励1|激励2|客户端激励|bidding激励广告位ID|激励)\s*[""\r\n]*([^""\s\r\n]+)"},
|
||||
{ "MAX 插屏", @"MAX参数(?:-[^\s]+)?[\s\S]*?(?:插屏|插屏1|插屏2|客户端插屏|bidding插屏广告位ID)\s*[""\r\n]*([^""\s\r\n]+)" },
|
||||
{ "MAX SDK Key", @"MAX参数[\s\S]*?SDK key\*?\s*([^\n]+)" },
|
||||
{ "MAX ad review key", @"MAX参数[\s\S]*?ad review key\*?\s*([^\n]+)" },
|
||||
|
||||
// BIGO (兼容多种格式)
|
||||
{ "BIGO 应用ID", @"BIGO参数[\s\S]*?(?:应用ID|appid)\s*([^\n]+)" },
|
||||
{ "BIGO 激励", @"BIGO参数[\s\S]*?(?:激励|激励1|激励2|客户端激励|bidding激励广告位ID)\s*([^\n]+)" },
|
||||
{ "BIGO 插屏", @"BIGO参数[\s\S]*?(?:插屏|插屏1|插屏2|客户端插屏|bidding插屏广告位ID)\s*([^\n]+)" },
|
||||
|
||||
// Kwai (兼容多种格式)
|
||||
{ "Kwai 应用ID", @"kwai参数[\s\S]*?(?:应用ID|appid)\s*([^\n]+)" },
|
||||
{ "Kwai 激励", @"kwai参数[\s\S]*?(?:激励|激励1|激励2|客户端激励|bidding激励广告位ID)\s*([^\n]+)" },
|
||||
{ "Kwai 插屏", @"kwai参数[\s\S]*?(?:插屏|插屏1|插屏2|客户端插屏|bidding插屏广告位ID)\s*([^\n]+)" },
|
||||
|
||||
// Admob (兼容多种格式)
|
||||
{ "Admob 应用ID", @"admob参数[\s\S]*?(?:应用ID|App ID)\s*([^\n]+)" },
|
||||
{ "Admob 激励", @"admob参数[\s\S]*?(?:激励1|激励)\s*([^\n]+)" },
|
||||
{ "Admob 插屏", @"admob参数[\s\S]*?(?:插屏1|插屏)\s*([^\n]+)" },
|
||||
{ "Admob txt", @"admob参数[\s\S]*?txt\s*([^\n]+)" },
|
||||
|
||||
// Facebook (兼容多种格式)
|
||||
{ "FB appid", @"fb参数[\s\S]*?appid\s*([^\n]+)" },
|
||||
{ "FB property_id", @"fb参数[\s\S]*?property_id\s*([^\n]+)" },
|
||||
{ "FB 激励", @"fb参数[\s\S]*?激励\s*([^\n]+)" },
|
||||
{ "FB 插屏", @"fb参数[\s\S]*?插屏\s*([^\n]+)" },
|
||||
{ "FB txt", @"fb参数[\s\S]*?txt\s*([^\n]+)" },
|
||||
|
||||
// Topon (兼容多种格式)
|
||||
// Topon (兼容多种格式)
|
||||
{ "Topon ID", @"(?i)topon[\s\S]*?ID[\t\s]+([^\r\n]+)" },
|
||||
{ "Topon KEY", @"(?i)topon[\s\S]*?(?:App Key|KEY)[\t\s]+([^\r\n]+)" },
|
||||
{ "Topon 激励", @"(?i)topon[\s\S]*?激励[\t\s]+([^\r\n]+)" },
|
||||
{ "Topon 插屏", @"(?i)topon[\s\S]*?插屏[\t\s]+([^\r\n]+)" }
|
||||
};
|
||||
|
||||
private void ParseClipboard()
|
||||
{
|
||||
if (string.IsNullOrEmpty(clipboardText.Trim()))
|
||||
{
|
||||
clipboardText = EditorGUIUtility.systemCopyBuffer;
|
||||
}
|
||||
|
||||
parsedParameters.Clear();
|
||||
|
||||
foreach (var pattern in parameterPatterns)
|
||||
{
|
||||
Match match = Regex.Match(clipboardText, pattern.Value, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
// 处理可能有多个捕获组的情况(如BIGO和Kwai的两种格式)
|
||||
for (int i = 1; i < match.Groups.Count; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(match.Groups[i].Value))
|
||||
{
|
||||
parsedParameters[pattern.Key] = match.Groups[i].Value.Trim();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateConfig();
|
||||
EditorUtility.DisplayDialog("解析完成",
|
||||
$"成功解析 {parsedParameters.Count} 个参数", "确定");
|
||||
}
|
||||
|
||||
private void UpdateConfig()
|
||||
{
|
||||
SDKConfig.Instance.bigoVideoUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.bigoVideoUnitId.Clear();
|
||||
SDKConfig.Instance.bigoInterUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.bigoInterUnitId.Clear();
|
||||
|
||||
SDKConfig.Instance.kwaiVideoUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.kwaiVideoUnitId.Clear();
|
||||
SDKConfig.Instance.kwaiInterUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.kwaiInterUnitId.Clear();
|
||||
|
||||
foreach (KeyValuePair<string, string> pair in parsedParameters)
|
||||
{
|
||||
//Debug.Log($"KEY : {pair.Key}, VALUE : {pair.Value}");
|
||||
if (pair.Key.Contains("包名"))
|
||||
{
|
||||
#if UNITY_IOS
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, pair.Value);
|
||||
#elif UNITY_ANDROID
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, pair.Value);
|
||||
#endif
|
||||
|
||||
Debug.Log($"包名设置 : {pair.Value}");
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("AF Dev key"))
|
||||
{
|
||||
Debug.Log($"AF Dev key: {pair.Value}");
|
||||
SDKConfig.Instance.appsFlyerDevKey = pair.Value;
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
|
||||
if (pair.Key.Contains("AF Apple Appid"))
|
||||
{
|
||||
Debug.Log($"AF Apple Appid: {pair.Value}");
|
||||
SDKConfig.Instance.appsFlyerIosAppleAppId = pair.Value;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pair.Key.Contains("APP KEY"))
|
||||
{
|
||||
Debug.Log($"BI APP KEY: {pair.Value}");
|
||||
SDKConfig.Instance.appKey = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("APP Secret"))
|
||||
{
|
||||
Debug.Log($"BI APP Secret: {pair.Value}");
|
||||
SDKConfig.Instance.appSecret = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("域名"))
|
||||
{
|
||||
Debug.Log($"业务域名: {pair.Value}");
|
||||
SDKConfig.Instance.logReportUrl = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Topon ID"))
|
||||
{
|
||||
Debug.Log($"Topon APP ID: {pair.Value}");
|
||||
SDKConfig.Instance.toponAppId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Topon KEY"))
|
||||
{
|
||||
Debug.Log($"Topon APP KEY: {pair.Value}");
|
||||
SDKConfig.Instance.toponAppkey = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Topon 激励"))
|
||||
{
|
||||
Debug.Log($"Topon 激励: {pair.Value}");
|
||||
SDKConfig.Instance.toponVideoUnitId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Topon 插屏"))
|
||||
{
|
||||
Debug.Log($"Topon 插屏: {pair.Value}");
|
||||
SDKConfig.Instance.toponInterUnitId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("MAX SDK Key"))
|
||||
{
|
||||
Debug.Log($"MAX SDK Key: {pair.Value}");
|
||||
SDKConfig.Instance.maxAppKey = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("MAX 激励视频"))
|
||||
{
|
||||
Debug.Log($"MAX 激励视频: {pair.Value}");
|
||||
SDKConfig.Instance.videoUnitId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("MAX 插屏"))
|
||||
{
|
||||
Debug.Log($"MAX 插屏: {pair.Value}");
|
||||
SDKConfig.Instance.interUnitId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("BIGO 应用ID"))
|
||||
{
|
||||
Debug.Log($"BIGO 应用ID: {pair.Value}");
|
||||
SDKConfig.Instance.bigoAppId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("BIGO 激励"))
|
||||
{
|
||||
Debug.Log($"BIGO 激励: {pair.Value}");
|
||||
//SDKConfig.Instance.bigoVideoUnitId = pair.Value;
|
||||
SDKConfig.Instance.bigoVideoUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.bigoVideoUnitId.Add(pair.Value);
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("BIGO 插屏"))
|
||||
{
|
||||
Debug.Log($"BIGO 插屏: {pair.Value}");
|
||||
//SDKConfig.Instance.bigoInterUnitId = pair.Value;
|
||||
SDKConfig.Instance.bigoInterUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.bigoInterUnitId.Add(pair.Value);
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Admob 应用ID"))
|
||||
{
|
||||
Debug.Log($"Admob 应用ID: {pair.Value}");
|
||||
//SDKConfig.Instance.admobAppId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Admob 激励"))
|
||||
{
|
||||
Debug.Log($"Admob 激励: {pair.Value}");
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Admob 插屏"))
|
||||
{
|
||||
Debug.Log($"Admob 插屏: {pair.Value}");
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Kwai 应用ID"))
|
||||
{
|
||||
Debug.Log($"Kwai 应用ID: {pair.Value}");
|
||||
SDKConfig.Instance.kwaiAppId = pair.Value;
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Kwai 激励"))
|
||||
{
|
||||
Debug.Log($"Kwai 激励: {pair.Value}");
|
||||
SDKConfig.Instance.kwaiVideoUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.kwaiVideoUnitId.Add(pair.Value);
|
||||
}
|
||||
|
||||
if (pair.Key.Contains("Kwai 插屏"))
|
||||
{
|
||||
Debug.Log($"Kwai 插屏: {pair.Value}");
|
||||
SDKConfig.Instance.kwaiInterUnitId ??= new List<string>();
|
||||
SDKConfig.Instance.kwaiInterUnitId.Add(pair.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa58b19a163a26640b410736e5b0d468
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4df08fba7905adf48876bcfff4f5704f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tool.countrycode;
|
||||
import android.app.Activity;
|
||||
import java.util.Locale;
|
||||
public class AcquireCountryCode {
|
||||
// 获取国家码
|
||||
public static String getCountryCode()
|
||||
{
|
||||
Locale locale = Locale.getDefault();
|
||||
return locale.getCountry();
|
||||
}
|
||||
|
||||
public static String getCountryCode3() {
|
||||
Locale currentLocale = Locale.getDefault();
|
||||
return currentLocale.getISO3Country();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 439c7d376883ccb4da22414c75510b24
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e3da5c7fe21c1347a563e64e8f305d4
|
||||
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
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5790a5b4da0b1da4a94a8c5060cdb151
|
||||
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
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d95a0f1f59b85b14d95ac7fa16356627
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bc122d7ecc60a94581cd8d1fa8a00d1
|
||||
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
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62cd95d3cdb46984ab747afbce81d5a0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
extern "C" {
|
||||
__attribute__((visibility("default")))
|
||||
const char* _GetDeviceCountryCode() {
|
||||
@autoreleasepool {
|
||||
NSLocale *currentLocale = [NSLocale currentLocale];
|
||||
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
|
||||
return strdup([countryCode UTF8String]); // 使用strdup确保内存安全
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63f1a672ae2b65f478662e01b0b67d7b
|
||||
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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96d3bb1be45827f47a83034c9908c005
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ea7ef46cf2ade545b68fd32b9c4b8b6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "SDKConfig",
|
||||
"rootNamespace": "",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b6da46957b38914aa097a61bd86a16d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,234 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DFFFQTVUv39wKIBSDK
|
||||
{
|
||||
[System.Serializable]
|
||||
public class SDKConfig : ScriptableObject
|
||||
{
|
||||
|
||||
public string appsFlyerDevKey;
|
||||
|
||||
public string appsFlyerIosAppleAppId;
|
||||
|
||||
public string appKey;
|
||||
|
||||
public string appSecret;
|
||||
|
||||
public string logReportUrl;
|
||||
|
||||
public string maxAppKey;
|
||||
|
||||
public string splashUnitId;
|
||||
|
||||
public string bannerUnitId;
|
||||
|
||||
public string interUnitId;
|
||||
|
||||
public string videoUnitId;
|
||||
|
||||
public string kwaiAppId;
|
||||
|
||||
public List<string> kwaiVideoUnitId = new();
|
||||
|
||||
public List<string> kwaiInterUnitId = new();
|
||||
|
||||
public string bigoAppId;
|
||||
|
||||
public List<string> bigoVideoUnitId = new();
|
||||
|
||||
public List<string> bigoInterUnitId = new();
|
||||
|
||||
public string bigoSplashUnitId;
|
||||
|
||||
public string toponAppId;
|
||||
|
||||
public string toponAppkey;
|
||||
|
||||
public string toponVideoUnitId;
|
||||
|
||||
public string toponInterUnitId;
|
||||
|
||||
public string admobAppId;
|
||||
|
||||
public string admobVideoUnitId;
|
||||
|
||||
public string admobInterUnitId;
|
||||
|
||||
public string admobSplashUnitId;
|
||||
|
||||
public bool isDebug = false;
|
||||
|
||||
public bool isPrintLog = false;
|
||||
|
||||
public bool isUseAdmobSplash = false;
|
||||
|
||||
private static SDKConfig _instance;
|
||||
|
||||
public static SDKConfig Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance != null) return _instance;
|
||||
_instance = AssetUtils.GetScriptableObject<SDKConfig>(typeof(SDKConfig).Name, "Assets/Resources", false, false);
|
||||
return _instance;
|
||||
}
|
||||
set
|
||||
{
|
||||
_instance = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AppsFlyerDevKey
|
||||
{
|
||||
get { return Instance.appsFlyerDevKey; }
|
||||
}
|
||||
|
||||
public static string AppsFlyerIosAppleAppId
|
||||
{
|
||||
get { return Instance.appsFlyerIosAppleAppId; }
|
||||
}
|
||||
|
||||
public static string AppKey
|
||||
{
|
||||
get { return Instance.appKey; }
|
||||
}
|
||||
|
||||
public static string AppSecret
|
||||
{
|
||||
get { return Instance.appSecret; }
|
||||
}
|
||||
|
||||
public static string LogReportUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Instance.logReportUrl.StartsWith("http"))
|
||||
{
|
||||
return "https://" + Instance.logReportUrl.Replace(" ", ""); ;
|
||||
}
|
||||
return Instance.logReportUrl.Replace(" ", ""); ;
|
||||
}
|
||||
}
|
||||
|
||||
public static string MaxAppKey
|
||||
{
|
||||
get { return Instance.maxAppKey; }
|
||||
}
|
||||
|
||||
public static string SplashUnitID
|
||||
{
|
||||
get { return Instance.splashUnitId; }
|
||||
}
|
||||
|
||||
public static string BannerUnitId
|
||||
{
|
||||
get { return Instance.bannerUnitId; }
|
||||
}
|
||||
|
||||
public static string InterUnitId
|
||||
{
|
||||
get { return Instance.interUnitId; }
|
||||
}
|
||||
|
||||
public static string VideoUnitId
|
||||
{
|
||||
get { return Instance.videoUnitId; }
|
||||
}
|
||||
|
||||
public static string KwaiAppId
|
||||
{
|
||||
get => Instance.kwaiAppId;
|
||||
set => Instance.kwaiAppId = value;
|
||||
}
|
||||
|
||||
public static List<string> KwaiVideoUnitId
|
||||
{
|
||||
get => Instance.kwaiVideoUnitId;
|
||||
set => Instance.kwaiVideoUnitId = value;
|
||||
}
|
||||
|
||||
public static List<string> KwaiInterUnitId
|
||||
{
|
||||
get => Instance.kwaiInterUnitId;
|
||||
set => Instance.kwaiInterUnitId = value;
|
||||
}
|
||||
|
||||
public static string BigoAppId
|
||||
{
|
||||
get => Instance.bigoAppId;
|
||||
set => Instance.bigoAppId = value;
|
||||
}
|
||||
|
||||
public static List<string> BigoVideoUnitId
|
||||
{
|
||||
get => Instance.bigoVideoUnitId;
|
||||
set => Instance.bigoVideoUnitId = value;
|
||||
}
|
||||
|
||||
public static List<string> BigoInterUnitId
|
||||
{
|
||||
get => Instance.bigoInterUnitId;
|
||||
set => Instance.bigoInterUnitId = value;
|
||||
}
|
||||
|
||||
public static string BigoSplashUnitId
|
||||
{
|
||||
get => Instance.bigoSplashUnitId;
|
||||
set => Instance.bigoSplashUnitId = value;
|
||||
}
|
||||
|
||||
public static string ToponAppId
|
||||
{
|
||||
get { return Instance.toponAppId; }
|
||||
}
|
||||
|
||||
public static string ToponAppkey
|
||||
{
|
||||
get { return Instance.toponAppkey; }
|
||||
}
|
||||
|
||||
public static string ToponVideoUnitId
|
||||
{
|
||||
get { return Instance.toponVideoUnitId; }
|
||||
}
|
||||
|
||||
public static string ToponInterUnitId
|
||||
{
|
||||
get { return Instance.toponInterUnitId; }
|
||||
}
|
||||
|
||||
public static string AdmobAppId
|
||||
{
|
||||
get => Instance.admobAppId;
|
||||
set => Instance.admobAppId = value;
|
||||
}
|
||||
|
||||
public static string AdmobVideoUnitId
|
||||
{
|
||||
get => Instance.admobVideoUnitId;
|
||||
set => Instance.admobVideoUnitId = value;
|
||||
}
|
||||
|
||||
public static string AdmobSplashUnitId
|
||||
{
|
||||
get => Instance.admobSplashUnitId;
|
||||
set => Instance.admobSplashUnitId = value;
|
||||
}
|
||||
|
||||
public static string AdmobInterUnitId
|
||||
{
|
||||
get => Instance.admobInterUnitId;
|
||||
set => Instance.admobInterUnitId = value;
|
||||
}
|
||||
|
||||
public static bool IsDebug => Instance.isDebug;
|
||||
|
||||
public static bool IsPrintLog => Instance.isPrintLog;
|
||||
|
||||
public static bool IsUseAdmobSplash => Instance.isUseAdmobSplash;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e4857e9d117e764490d38ceb6820095
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0d9293c0ca40cd41ba02042aeb78b89
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,152 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace DFFFQTVUv39wKIBSDK
|
||||
{
|
||||
public static class AssetUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a reference to a scriptable object of type T with the given fileName at the relative resourcesPath.
|
||||
/// <para/> If the asset is not found, one will get created automatically (in the Editor only)
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <param name="resourcesPath"></param>
|
||||
/// <param name="saveAssetDatabase"></param>
|
||||
/// <param name="refreshAssetDatabase"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public static T GetScriptableObject<T>(string fileName,
|
||||
string resourcesPath,
|
||||
bool saveAssetDatabase,
|
||||
bool refreshAssetDatabase)
|
||||
where T : ScriptableObject
|
||||
{
|
||||
if (string.IsNullOrEmpty(resourcesPath)) return null;
|
||||
if (string.IsNullOrEmpty(fileName)) return null;
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
// if (!resourcesPath[resourcesPath.Length - 1].Equals(@"\")) resourcesPath += @"\";
|
||||
// resourcesPath = resourcesPath.Replace(@"\", "/");
|
||||
resourcesPath = CleanPath(resourcesPath);
|
||||
|
||||
var obj = (T)Resources.Load(fileName, typeof(T));
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
string simpleResourcesPath = resourcesPath.Replace(resourcesPath.Substring(0, resourcesPath.LastIndexOf("Resources", StringComparison.Ordinal)), "");
|
||||
simpleResourcesPath = simpleResourcesPath.Replace("Resources", "").Remove(0, 1);
|
||||
obj = (T)Resources.Load(Path.Combine(simpleResourcesPath, fileName), typeof(T));
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (obj != null) return obj;
|
||||
if (!Directory.Exists("Assets/Resources"))
|
||||
{
|
||||
Directory.CreateDirectory("Assets/Resources");
|
||||
}
|
||||
obj = CreateAsset<T>(resourcesPath, fileName, ".asset", saveAssetDatabase, refreshAssetDatabase);
|
||||
#endif
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static T GetResource<T>(string resourcesPath, string fileName) where T : ScriptableObject
|
||||
{
|
||||
if (string.IsNullOrEmpty(resourcesPath)) return null;
|
||||
if (string.IsNullOrEmpty(fileName)) return null;
|
||||
resourcesPath = CleanPath(resourcesPath);
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
// if (!resourcesPath[resourcesPath.Length - 1].Equals(@"\")) resourcesPath += @"\";
|
||||
// resourcesPath = resourcesPath.Replace(@"\", "/");
|
||||
|
||||
return (T)Resources.Load(resourcesPath + fileName, typeof(T));
|
||||
}
|
||||
|
||||
public static string CleanPath(string path)
|
||||
{
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
if (!path[path.Length - 1].Equals(@"\")) path += @"\";
|
||||
path = path.Replace(@"\\", @"\");
|
||||
path = path.Replace(@"\", "/");
|
||||
return path;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static T CreateAsset<T>(string relativePath,
|
||||
string fileName,
|
||||
string extension = ".asset",
|
||||
bool saveAssetDatabase = true,
|
||||
bool refreshAssetDatabase = true)
|
||||
where T : ScriptableObject
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePath)) return null;
|
||||
if (string.IsNullOrEmpty(fileName)) return null;
|
||||
relativePath = CleanPath(relativePath);
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
// if (!relativePath[relativePath.Length - 1].Equals(@"\")) relativePath += @"\";
|
||||
// relativePath = relativePath.Replace(@"\\", @"\");
|
||||
var asset = ScriptableObject.CreateInstance<T>();
|
||||
AssetDatabase.CreateAsset(asset, relativePath + fileName + extension);
|
||||
EditorUtility.SetDirty(asset);
|
||||
if (saveAssetDatabase) AssetDatabase.SaveAssets();
|
||||
if (refreshAssetDatabase) AssetDatabase.Refresh();
|
||||
return asset;
|
||||
}
|
||||
|
||||
public static List<T> GetAssets<T>() where T : ScriptableObject
|
||||
{
|
||||
var list = new List<T>();
|
||||
string[] guids = AssetDatabase.FindAssets("t:" + typeof(T).Name);
|
||||
foreach (string guid in guids)
|
||||
{
|
||||
var asset = AssetDatabase.LoadAssetAtPath<T>(AssetDatabase.GUIDToAssetPath(guid));
|
||||
if (asset == null) continue;
|
||||
list.Add(asset);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void MoveAssetToTrash(string relativePath, string fileName, bool saveAssetDatabase = true,
|
||||
bool refreshAssetDatabase = true, bool printDebugMessage = true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePath)) return;
|
||||
if (string.IsNullOrEmpty(fileName)) return;
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
// if (!relativePath[relativePath.Length - 1].Equals(@"\")) relativePath += @"\";
|
||||
relativePath = CleanPath(relativePath);
|
||||
if (!AssetDatabase.MoveAssetToTrash(relativePath + fileName + ".asset")) return;
|
||||
if (printDebugMessage) Debug.Log("The " + fileName + ".asset file has been moved to trash.");
|
||||
if (saveAssetDatabase) AssetDatabase.SaveAssets();
|
||||
if (refreshAssetDatabase) AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
public static Texture GetTexture(string filePath, string fileName, string fileExtension = ".png")
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath)) return null;
|
||||
if (string.IsNullOrEmpty(fileName)) return null;
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
// if (!filePath[filePath.Length - 1].Equals(@"\")) filePath += @"\";
|
||||
filePath = CleanPath(filePath);
|
||||
return AssetDatabase.LoadAssetAtPath<Texture>(filePath + fileName + fileExtension);
|
||||
}
|
||||
|
||||
public static Texture2D GetTexture2D(string filePath, string fileName, string fileExtension = ".png")
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath)) return null;
|
||||
if (string.IsNullOrEmpty(fileName)) return null;
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
// if (!filePath[filePath.Length - 1].Equals(@"\")) filePath += @"\";
|
||||
filePath = CleanPath(filePath);
|
||||
return AssetDatabase.LoadAssetAtPath<Texture2D>(filePath + fileName + fileExtension);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6cff4f16b2f10d499cfd019dc05cf9f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0a2dd547ed87a64a8c6e3d3a12a3d91
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7863556d88b814e09ba9cfc75a91d655
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public enum MediationNetwork : ulong
|
||||
{
|
||||
GoogleAdMob = 1,
|
||||
IronSource = 2,
|
||||
ApplovinMax = 3,
|
||||
Fyber = 4,
|
||||
Appodeal = 5,
|
||||
Admost = 6,
|
||||
Topon = 7,
|
||||
Tradplus = 8,
|
||||
Yandex = 9,
|
||||
ChartBoost = 10,
|
||||
Unity = 11,
|
||||
ToponPte = 12,
|
||||
Custom = 13,
|
||||
DirectMonetization = 14
|
||||
}
|
||||
|
||||
public static class AdRevenueScheme
|
||||
{
|
||||
/**
|
||||
* 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";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
// Data class representing ad revenue information.
|
||||
//
|
||||
// @property monetizationNetwork The name of the network that monetized the ad.
|
||||
// @property mediationNetwork An instance of MediationNetwork representing the mediation service used.
|
||||
// @property currencyIso4217Code The ISO 4217 currency code describing the currency of the revenue.
|
||||
// @property eventRevenue The amount of revenue generated by the ad.
|
||||
/// </summary>
|
||||
public class AFAdRevenueData
|
||||
{
|
||||
public string monetizationNetwork { get; private set; }
|
||||
public MediationNetwork mediationNetwork { get; private set; }
|
||||
public string currencyIso4217Code { get; private set; }
|
||||
public double eventRevenue { get; private set; }
|
||||
|
||||
public AFAdRevenueData(string monetization, MediationNetwork mediation, string currency, double revenue)
|
||||
{
|
||||
monetizationNetwork = monetization;
|
||||
mediationNetwork = mediation;
|
||||
currencyIso4217Code = currency;
|
||||
eventRevenue = revenue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49e1906ae949e4bfea400bd1da9f7e39
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class AFInAppEvents {
|
||||
/**
|
||||
* Event Type
|
||||
* */
|
||||
public const string LEVEL_ACHIEVED = "af_level_achieved";
|
||||
public const string ADD_PAYMENT_INFO = "af_add_payment_info";
|
||||
public const string ADD_TO_CART = "af_add_to_cart";
|
||||
public const string ADD_TO_WISH_LIST = "af_add_to_wishlist";
|
||||
public const string COMPLETE_REGISTRATION = "af_complete_registration";
|
||||
public const string TUTORIAL_COMPLETION = "af_tutorial_completion";
|
||||
public const string INITIATED_CHECKOUT = "af_initiated_checkout";
|
||||
public const string PURCHASE = "af_purchase";
|
||||
public const string RATE = "af_rate";
|
||||
public const string SEARCH = "af_search";
|
||||
public const string SPENT_CREDIT = "af_spent_credits";
|
||||
public const string ACHIEVEMENT_UNLOCKED = "af_achievement_unlocked";
|
||||
public const string CONTENT_VIEW = "af_content_view";
|
||||
public const string TRAVEL_BOOKING = "af_travel_booking";
|
||||
public const string SHARE = "af_share";
|
||||
public const string INVITE = "af_invite";
|
||||
public const string LOGIN = "af_login";
|
||||
public const string RE_ENGAGE = "af_re_engage";
|
||||
public const string UPDATE = "af_update";
|
||||
public const string OPENED_FROM_PUSH_NOTIFICATION = "af_opened_from_push_notification";
|
||||
public const string LOCATION_CHANGED = "af_location_changed";
|
||||
public const string LOCATION_COORDINATES = "af_location_coordinates";
|
||||
public const string ORDER_ID = "af_order_id";
|
||||
/**
|
||||
* Event Parameter Name
|
||||
* **/
|
||||
public const string LEVEL = "af_level";
|
||||
public const string SCORE = "af_score";
|
||||
public const string SUCCESS = "af_success";
|
||||
public const string PRICE = "af_price";
|
||||
public const string CONTENT_TYPE = "af_content_type";
|
||||
public const string CONTENT_ID = "af_content_id";
|
||||
public const string CONTENT_LIST = "af_content_list";
|
||||
public const string CURRENCY = "af_currency";
|
||||
public const string QUANTITY = "af_quantity";
|
||||
public const string REGSITRATION_METHOD = "af_registration_method";
|
||||
public const string PAYMENT_INFO_AVAILIBLE = "af_payment_info_available";
|
||||
public const string MAX_RATING_VALUE = "af_max_rating_value";
|
||||
public const string RATING_VALUE = "af_rating_value";
|
||||
public const string SEARCH_STRING = "af_search_string";
|
||||
public const string DATE_A = "af_date_a";
|
||||
public const string DATE_B = "af_date_b";
|
||||
public const string DESTINATION_A = "af_destination_a";
|
||||
public const string DESTINATION_B = "af_destination_b";
|
||||
public const string DESCRIPTION = "af_description";
|
||||
public const string CLASS = "af_class";
|
||||
public const string EVENT_START = "af_event_start";
|
||||
public const string EVENT_END = "af_event_end";
|
||||
public const string LATITUDE = "af_lat";
|
||||
public const string LONGTITUDE = "af_long";
|
||||
public const string CUSTOMER_USER_ID = "af_customer_user_id";
|
||||
public const string VALIDATED = "af_validated";
|
||||
public const string REVENUE = "af_revenue";
|
||||
public const string RECEIPT_ID = "af_receipt_id";
|
||||
public const string PARAM_1 = "af_param_1";
|
||||
public const string PARAM_2 = "af_param_2";
|
||||
public const string PARAM_3 = "af_param_3";
|
||||
public const string PARAM_4 = "af_param_4";
|
||||
public const string PARAM_5 = "af_param_5";
|
||||
public const string PARAM_6 = "af_param_6";
|
||||
public const string PARAM_7 = "af_param_7";
|
||||
public const string PARAM_8 = "af_param_8";
|
||||
public const string PARAM_9 = "af_param_9";
|
||||
public const string PARAM_10 = "af_param_10";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4075c6cf6f3d94b9a9f37f826e6a0e6f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,547 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Calvin Rien
|
||||
*
|
||||
* Based on the JSON parser by Patrick van Bergen
|
||||
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
|
||||
*
|
||||
* Simplified it so that it doesn't throw exceptions
|
||||
* and can be used in Unity iPhone with maximum code stripping.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace AFMiniJSON {
|
||||
// Example usage:
|
||||
//
|
||||
// using UnityEngine;
|
||||
// using System.Collections;
|
||||
// using System.Collections.Generic;
|
||||
// using MiniJSON;
|
||||
//
|
||||
// public class MiniJSONTest : MonoBehaviour {
|
||||
// void Start () {
|
||||
// var jsonString = "{ \"array\": [1.44,2,3], " +
|
||||
// "\"object\": {\"key1\":\"value1\", \"key2\":256}, " +
|
||||
// "\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " +
|
||||
// "\"unicode\": \"\\u3041 Men\u00fa sesi\u00f3n\", " +
|
||||
// "\"int\": 65536, " +
|
||||
// "\"float\": 3.1415926, " +
|
||||
// "\"bool\": true, " +
|
||||
// "\"null\": null }";
|
||||
//
|
||||
// var dict = Json.Deserialize(jsonString) as Dictionary<string,object>;
|
||||
//
|
||||
// Debug.Log("deserialized: " + dict.GetType());
|
||||
// Debug.Log("dict['array'][0]: " + ((List<object>) dict["array"])[0]);
|
||||
// Debug.Log("dict['string']: " + (string) dict["string"]);
|
||||
// Debug.Log("dict['float']: " + (double) dict["float"]); // floats come out as doubles
|
||||
// Debug.Log("dict['int']: " + (long) dict["int"]); // ints come out as longs
|
||||
// Debug.Log("dict['unicode']: " + (string) dict["unicode"]);
|
||||
//
|
||||
// var str = Json.Serialize(dict);
|
||||
//
|
||||
// Debug.Log("serialized: " + str);
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// This class encodes and decodes JSON strings.
|
||||
/// Spec. details, see http://www.json.org/
|
||||
///
|
||||
/// JSON uses Arrays and Objects. These correspond here to the datatypes IList and IDictionary.
|
||||
/// All numbers are parsed to doubles.
|
||||
/// </summary>
|
||||
public static class Json {
|
||||
/// <summary>
|
||||
/// Parses the string json into a value
|
||||
/// </summary>
|
||||
/// <param name="json">A JSON string.</param>
|
||||
/// <returns>An List<object>, a Dictionary<string, object>, a double, an integer,a string, null, true, or false</returns>
|
||||
public static object Deserialize(string json) {
|
||||
// save the string for debug information
|
||||
if (json == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Parser.Parse(json);
|
||||
}
|
||||
|
||||
sealed class Parser : IDisposable {
|
||||
const string WORD_BREAK = "{}[],:\"";
|
||||
|
||||
public static bool IsWordBreak(char c) {
|
||||
return Char.IsWhiteSpace(c) || WORD_BREAK.IndexOf(c) != -1;
|
||||
}
|
||||
|
||||
enum TOKEN {
|
||||
NONE,
|
||||
CURLY_OPEN,
|
||||
CURLY_CLOSE,
|
||||
SQUARED_OPEN,
|
||||
SQUARED_CLOSE,
|
||||
COLON,
|
||||
COMMA,
|
||||
STRING,
|
||||
NUMBER,
|
||||
TRUE,
|
||||
FALSE,
|
||||
NULL
|
||||
};
|
||||
|
||||
StringReader json;
|
||||
|
||||
Parser(string jsonString) {
|
||||
json = new StringReader(jsonString);
|
||||
}
|
||||
|
||||
public static object Parse(string jsonString) {
|
||||
using (var instance = new Parser(jsonString)) {
|
||||
return instance.ParseValue();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
json.Dispose();
|
||||
json = null;
|
||||
}
|
||||
|
||||
Dictionary<string, object> ParseObject() {
|
||||
Dictionary<string, object> table = new Dictionary<string, object>();
|
||||
|
||||
// ditch opening brace
|
||||
json.Read();
|
||||
|
||||
// {
|
||||
while (true) {
|
||||
switch (NextToken) {
|
||||
case TOKEN.NONE:
|
||||
return null;
|
||||
case TOKEN.COMMA:
|
||||
continue;
|
||||
case TOKEN.CURLY_CLOSE:
|
||||
return table;
|
||||
default:
|
||||
// name
|
||||
string name = ParseString();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// :
|
||||
if (NextToken != TOKEN.COLON) {
|
||||
return null;
|
||||
}
|
||||
// ditch the colon
|
||||
json.Read();
|
||||
|
||||
// value
|
||||
table[name] = ParseValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<object> ParseArray() {
|
||||
List<object> array = new List<object>();
|
||||
|
||||
// ditch opening bracket
|
||||
json.Read();
|
||||
|
||||
// [
|
||||
var parsing = true;
|
||||
while (parsing) {
|
||||
TOKEN nextToken = NextToken;
|
||||
|
||||
switch (nextToken) {
|
||||
case TOKEN.NONE:
|
||||
return null;
|
||||
case TOKEN.COMMA:
|
||||
continue;
|
||||
case TOKEN.SQUARED_CLOSE:
|
||||
parsing = false;
|
||||
break;
|
||||
default:
|
||||
object value = ParseByToken(nextToken);
|
||||
|
||||
array.Add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
object ParseValue() {
|
||||
TOKEN nextToken = NextToken;
|
||||
return ParseByToken(nextToken);
|
||||
}
|
||||
|
||||
object ParseByToken(TOKEN token) {
|
||||
switch (token) {
|
||||
case TOKEN.STRING:
|
||||
return ParseString();
|
||||
case TOKEN.NUMBER:
|
||||
return ParseNumber();
|
||||
case TOKEN.CURLY_OPEN:
|
||||
return ParseObject();
|
||||
case TOKEN.SQUARED_OPEN:
|
||||
return ParseArray();
|
||||
case TOKEN.TRUE:
|
||||
return true;
|
||||
case TOKEN.FALSE:
|
||||
return false;
|
||||
case TOKEN.NULL:
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
string ParseString() {
|
||||
StringBuilder s = new StringBuilder();
|
||||
char c;
|
||||
|
||||
// ditch opening quote
|
||||
json.Read();
|
||||
|
||||
bool parsing = true;
|
||||
while (parsing) {
|
||||
|
||||
if (json.Peek() == -1) {
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
|
||||
c = NextChar;
|
||||
switch (c) {
|
||||
case '"':
|
||||
parsing = false;
|
||||
break;
|
||||
case '\\':
|
||||
if (json.Peek() == -1) {
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
|
||||
c = NextChar;
|
||||
switch (c) {
|
||||
case '"':
|
||||
case '\\':
|
||||
case '/':
|
||||
s.Append(c);
|
||||
break;
|
||||
case 'b':
|
||||
s.Append('\b');
|
||||
break;
|
||||
case 'f':
|
||||
s.Append('\f');
|
||||
break;
|
||||
case 'n':
|
||||
s.Append('\n');
|
||||
break;
|
||||
case 'r':
|
||||
s.Append('\r');
|
||||
break;
|
||||
case 't':
|
||||
s.Append('\t');
|
||||
break;
|
||||
case 'u':
|
||||
var hex = new char[4];
|
||||
|
||||
for (int i=0; i< 4; i++) {
|
||||
hex[i] = NextChar;
|
||||
}
|
||||
|
||||
s.Append((char) Convert.ToInt32(new string(hex), 16));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
s.Append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return s.ToString();
|
||||
}
|
||||
|
||||
object ParseNumber() {
|
||||
string number = NextWord;
|
||||
|
||||
if (number.IndexOf('.') == -1) {
|
||||
long parsedInt;
|
||||
Int64.TryParse(number, out parsedInt);
|
||||
return parsedInt;
|
||||
}
|
||||
|
||||
double parsedDouble;
|
||||
Double.TryParse(number, out parsedDouble);
|
||||
return parsedDouble;
|
||||
}
|
||||
|
||||
void EatWhitespace() {
|
||||
while (Char.IsWhiteSpace(PeekChar)) {
|
||||
json.Read();
|
||||
|
||||
if (json.Peek() == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char PeekChar {
|
||||
get {
|
||||
return Convert.ToChar(json.Peek());
|
||||
}
|
||||
}
|
||||
|
||||
char NextChar {
|
||||
get {
|
||||
return Convert.ToChar(json.Read());
|
||||
}
|
||||
}
|
||||
|
||||
string NextWord {
|
||||
get {
|
||||
StringBuilder word = new StringBuilder();
|
||||
|
||||
while (!IsWordBreak(PeekChar)) {
|
||||
word.Append(NextChar);
|
||||
|
||||
if (json.Peek() == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return word.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
TOKEN NextToken {
|
||||
get {
|
||||
EatWhitespace();
|
||||
|
||||
if (json.Peek() == -1) {
|
||||
return TOKEN.NONE;
|
||||
}
|
||||
|
||||
switch (PeekChar) {
|
||||
case '{':
|
||||
return TOKEN.CURLY_OPEN;
|
||||
case '}':
|
||||
json.Read();
|
||||
return TOKEN.CURLY_CLOSE;
|
||||
case '[':
|
||||
return TOKEN.SQUARED_OPEN;
|
||||
case ']':
|
||||
json.Read();
|
||||
return TOKEN.SQUARED_CLOSE;
|
||||
case ',':
|
||||
json.Read();
|
||||
return TOKEN.COMMA;
|
||||
case '"':
|
||||
return TOKEN.STRING;
|
||||
case ':':
|
||||
return TOKEN.COLON;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
case '-':
|
||||
return TOKEN.NUMBER;
|
||||
}
|
||||
|
||||
switch (NextWord) {
|
||||
case "false":
|
||||
return TOKEN.FALSE;
|
||||
case "true":
|
||||
return TOKEN.TRUE;
|
||||
case "null":
|
||||
return TOKEN.NULL;
|
||||
}
|
||||
|
||||
return TOKEN.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
|
||||
/// </summary>
|
||||
/// <param name="json">A Dictionary<string, object> / List<object></param>
|
||||
/// <returns>A JSON encoded string, or null if object 'json' is not serializable</returns>
|
||||
public static string Serialize(object obj) {
|
||||
return Serializer.Serialize(obj);
|
||||
}
|
||||
|
||||
sealed class Serializer {
|
||||
StringBuilder builder;
|
||||
|
||||
Serializer() {
|
||||
builder = new StringBuilder();
|
||||
}
|
||||
|
||||
public static string Serialize(object obj) {
|
||||
var instance = new Serializer();
|
||||
|
||||
instance.SerializeValue(obj);
|
||||
|
||||
return instance.builder.ToString();
|
||||
}
|
||||
|
||||
void SerializeValue(object value) {
|
||||
IList asList;
|
||||
IDictionary asDict;
|
||||
string asStr;
|
||||
|
||||
if (value == null) {
|
||||
builder.Append("null");
|
||||
} else if ((asStr = value as string) != null) {
|
||||
SerializeString(asStr);
|
||||
} else if (value is bool) {
|
||||
builder.Append((bool) value ? "true" : "false");
|
||||
} else if ((asList = value as IList) != null) {
|
||||
SerializeArray(asList);
|
||||
} else if ((asDict = value as IDictionary) != null) {
|
||||
SerializeObject(asDict);
|
||||
} else if (value is char) {
|
||||
SerializeString(new string((char) value, 1));
|
||||
} else {
|
||||
SerializeOther(value);
|
||||
}
|
||||
}
|
||||
|
||||
void SerializeObject(IDictionary obj) {
|
||||
bool first = true;
|
||||
|
||||
builder.Append('{');
|
||||
|
||||
foreach (object e in obj.Keys) {
|
||||
if (!first) {
|
||||
builder.Append(',');
|
||||
}
|
||||
|
||||
SerializeString(e.ToString());
|
||||
builder.Append(':');
|
||||
|
||||
SerializeValue(obj[e]);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.Append('}');
|
||||
}
|
||||
|
||||
void SerializeArray(IList anArray) {
|
||||
builder.Append('[');
|
||||
|
||||
bool first = true;
|
||||
|
||||
foreach (object obj in anArray) {
|
||||
if (!first) {
|
||||
builder.Append(',');
|
||||
}
|
||||
|
||||
SerializeValue(obj);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.Append(']');
|
||||
}
|
||||
|
||||
void SerializeString(string str) {
|
||||
builder.Append('\"');
|
||||
|
||||
char[] charArray = str.ToCharArray();
|
||||
foreach (var c in charArray) {
|
||||
switch (c) {
|
||||
case '"':
|
||||
builder.Append("\\\"");
|
||||
break;
|
||||
case '\\':
|
||||
builder.Append("\\\\");
|
||||
break;
|
||||
case '\b':
|
||||
builder.Append("\\b");
|
||||
break;
|
||||
case '\f':
|
||||
builder.Append("\\f");
|
||||
break;
|
||||
case '\n':
|
||||
builder.Append("\\n");
|
||||
break;
|
||||
case '\r':
|
||||
builder.Append("\\r");
|
||||
break;
|
||||
case '\t':
|
||||
builder.Append("\\t");
|
||||
break;
|
||||
default:
|
||||
int codepoint = Convert.ToInt32(c);
|
||||
if ((codepoint >= 32) && (codepoint <= 126)) {
|
||||
builder.Append(c);
|
||||
} else {
|
||||
builder.Append("\\u");
|
||||
builder.Append(codepoint.ToString("x4"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
builder.Append('\"');
|
||||
}
|
||||
|
||||
void SerializeOther(object value) {
|
||||
// NOTE: decimals lose precision during serialization.
|
||||
// They always have, I'm just letting you know.
|
||||
// Previously floats and doubles lost precision too.
|
||||
if (value is float) {
|
||||
builder.Append(((float) value).ToString("R"));
|
||||
} else if (value is int
|
||||
|| value is uint
|
||||
|| value is long
|
||||
|| value is sbyte
|
||||
|| value is byte
|
||||
|| value is short
|
||||
|| value is ushort
|
||||
|| value is ulong) {
|
||||
builder.Append(value);
|
||||
} else if (value is double
|
||||
|| value is decimal) {
|
||||
builder.Append(Convert.ToDouble(value).ToString("R"));
|
||||
} else {
|
||||
SerializeString(value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc3d1c806d507463e9b560eb09d8eb0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public enum AFPurchaseType
|
||||
{
|
||||
Subscription = 0,
|
||||
OneTimePurchase = 1
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Purchase details class matching Android SDK AFPurchaseDetails
|
||||
/// </summary>
|
||||
public class AFPurchaseDetailsAndroid
|
||||
{
|
||||
public AFPurchaseType purchaseType { get; private set; }
|
||||
public string purchaseToken { get; private set; }
|
||||
public string productId { get; private set; }
|
||||
|
||||
public AFPurchaseDetailsAndroid(AFPurchaseType type, String purchaseToken, String productId)
|
||||
{
|
||||
this.purchaseType = type;
|
||||
this.purchaseToken = purchaseToken;
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d71b3864006f94ac08938b2ebdc940bc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
/// <summary>
|
||||
/// Purchase type enum matching iOS SDK AFSDKPurchaseType
|
||||
/// </summary>
|
||||
public enum AFSDKPurchaseType
|
||||
{
|
||||
Subscription,
|
||||
OneTimePurchase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Purchase details class matching iOS SDK AFSDKPurchaseDetails
|
||||
/// </summary>
|
||||
public class AFSDKPurchaseDetailsIOS
|
||||
{
|
||||
public string productId { get; private set; }
|
||||
public string transactionId { get; private set; }
|
||||
public AFSDKPurchaseType purchaseType { get; private set; }
|
||||
|
||||
private AFSDKPurchaseDetailsIOS(string productId, string transactionId, AFSDKPurchaseType purchaseType)
|
||||
{
|
||||
this.productId = productId;
|
||||
this.transactionId = transactionId;
|
||||
this.purchaseType = purchaseType;
|
||||
}
|
||||
|
||||
public static AFSDKPurchaseDetailsIOS Init(string productId, string transactionId, AFSDKPurchaseType purchaseType)
|
||||
{
|
||||
return new AFSDKPurchaseDetailsIOS(productId, transactionId, purchaseType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44bb6c4472701416080eb050732075ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public enum AFSDKValidateAndLogStatus
|
||||
{
|
||||
AFSDKValidateAndLogStatusSuccess,
|
||||
AFSDKValidateAndLogStatusFailure,
|
||||
AFSDKValidateAndLogStatusError
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
//
|
||||
/// </summary>
|
||||
public class AFSDKValidateAndLogResult
|
||||
{
|
||||
public AFSDKValidateAndLogStatus status { get; private set; }
|
||||
public Dictionary<string, object> result { get; private set; }
|
||||
public Dictionary<string, object> errorData { get; private set; }
|
||||
public string error { get; private set; }
|
||||
|
||||
private AFSDKValidateAndLogResult(AFSDKValidateAndLogStatus status, Dictionary<string, object> result, Dictionary<string, object> errorData, string error)
|
||||
{
|
||||
this.status = status;
|
||||
this.result = result;
|
||||
this.errorData = errorData;
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public static AFSDKValidateAndLogResult Init(AFSDKValidateAndLogStatus status, Dictionary<string, object> result, Dictionary<string, object> errorData, string error)
|
||||
{
|
||||
return new AFSDKValidateAndLogResult(status, result, errorData, error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2df1c6f1eab2e4849bf2762a8d78933f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "AppsFlyer",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a37df438292d4903b4e5159c5de3bf9
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45161025a517d427381d3d06153a5ad3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,852 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
#if UNITY_ANDROID
|
||||
public class AppsFlyerAndroid : IAppsFlyerAndroidBridge
|
||||
{
|
||||
public bool isInit { get; set; }
|
||||
|
||||
private static AndroidJavaClass appsFlyerAndroid = new AndroidJavaClass("com.appsflyer.unity.AppsFlyerAndroidWrapper");
|
||||
|
||||
public AppsFlyerAndroid() { }
|
||||
|
||||
/// <summary>
|
||||
/// Use this method to init the sdk for the application.
|
||||
/// Call this method before startSDK.
|
||||
/// </summary>
|
||||
/// <param name="devkey"> AppsFlyer's Dev-Key, which is accessible from your AppsFlyer account under 'App Settings' in the dashboard.</param>
|
||||
/// <param name="gameObject">The current game object. This is used to get the conversion data callbacks. Pass null if you do not need the callbacks.</param>
|
||||
public void initSDK(string devkey, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("initSDK", devkey, gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method to start the sdk for the application.
|
||||
/// The AppsFlyer's Dev-Key must be provided.
|
||||
/// </summary>
|
||||
/// <param name="devkey"> AppsFlyer's Dev-Key, which is accessible from your AppsFlyer account under 'App Settings' in the dashboard.</param>
|
||||
public void startSDK(bool onRequestResponse, string CallBackObjectName)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("startTracking", onRequestResponse, CallBackObjectName);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Once this API is invoked, our SDK no longer communicates with our servers and stops functioning.
|
||||
/// In some extreme cases you might want to shut down all SDK activity due to legal and privacy compliance.
|
||||
/// This can be achieved with the stopSDK API.
|
||||
/// </summary>
|
||||
/// <param name="isSDKStopped">boolean should SDK be stopped.</param>
|
||||
public void stopSDK(bool isSDKStopped)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("stopTracking", isSDKStopped);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the AppsFlyer SDK version used in app.
|
||||
/// </summary>
|
||||
/// <returns>AppsFlyer SDK version.</returns>
|
||||
public string getSdkVersion()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<string>("getSdkVersion");
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manually pass the Firebase / GCM Device Token for Uninstall measurement.
|
||||
/// </summary>
|
||||
/// <param name="token">Firebase Device Token.</param>
|
||||
public void updateServerUninstallToken(string token)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("updateServerUninstallToken", token);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables Debug logs for the AppsFlyer SDK.
|
||||
/// Should only be set to true in development / debug.
|
||||
/// </summary>
|
||||
/// <param name="shouldEnable">shouldEnable boolean.</param>
|
||||
public void setIsDebug(bool shouldEnable)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setIsDebug", shouldEnable);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat (4.4)
|
||||
/// and the device contains Google Play Services(on SDK versions 4.8.8 and below the specific app needed GPS).
|
||||
/// Use this API to explicitly send IMEI to AppsFlyer.
|
||||
/// </summary>
|
||||
/// <param name="aImei">device's IMEI.</param>
|
||||
public void setImeiData(string aImei)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setImeiData", aImei);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// By default, IMEI and Android ID are not collected by the SDK if the OS version is higher than KitKat(4.4)
|
||||
/// and the device contains Google Play Services(on SDK versions 4.8.8 and below the specific app needed GPS).
|
||||
/// Use this API to explicitly send Android ID to AppsFlyer.
|
||||
/// </summary>
|
||||
/// <param name="aAndroidId">device's Android ID.</param>
|
||||
public void setAndroidIdData(string aAndroidId)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setAndroidIdData", aAndroidId);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer’s unique ID and the other devices’ IDs.
|
||||
/// This ID is available in AppsFlyer CSV reports along with Postback APIs for cross-referencing with your internal IDs.
|
||||
/// </summary>
|
||||
/// <param name="id">Customer ID for client.</param>
|
||||
public void setCustomerUserId(string id)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setCustomerUserId", id);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// It is possible to delay the SDK Initialization until the customerUserID is set.
|
||||
/// This feature makes sure that the SDK doesn't begin functioning until the customerUserID is provided.
|
||||
/// If this API is used, all in-app events and any other SDK API calls are discarded, until the customerUserID is provided.
|
||||
/// </summary>
|
||||
/// <param name="wait">wait boolean.</param>
|
||||
public void waitForCustomerUserId(bool wait)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("waitForCustomerUserId", wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this API to provide the SDK with the relevant customer user id and trigger the SDK to begin its normal activity.
|
||||
/// </summary>
|
||||
/// <param name="id">Customer ID for client.</param>
|
||||
public void setCustomerIdAndStartSDK(string id)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setCustomerIdAndTrack", id);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current AF_STORE value.
|
||||
/// </summary>
|
||||
/// <returns>AF_Store value.</returns>
|
||||
public string getOutOfStore()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<string>("getOutOfStore");
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manually set the AF_STORE value.
|
||||
/// </summary>
|
||||
/// <param name="sourceName">value to be set.</param>
|
||||
public void setOutOfStore(string sourceName)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setOutOfStore", sourceName);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the OneLink ID that should be used for User-Invites.
|
||||
/// The link that is generated for the user invite will use this OneLink as the base link.
|
||||
/// </summary>
|
||||
/// <param name="oneLinkId">OneLink ID obtained from the AppsFlyer Dashboard.</param>
|
||||
public void setAppInviteOneLinkID(string oneLinkId)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setAppInviteOneLinkID", oneLinkId);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set additional data to be sent to AppsFlyer.
|
||||
/// </summary>
|
||||
/// <param name="customData">additional data Dictionary.</param>
|
||||
public void setAdditionalData(Dictionary<string, string> customData)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setAdditionalData", convertDictionaryToJavaMap(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>
|
||||
/// <param name="emails">User emails.</param>
|
||||
public void setUserEmails(params string[] userEmails)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setUserEmails", (object)userEmails);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set the user phone number.
|
||||
/// </summary>
|
||||
/// <param name="phoneNumber">User phoneNumber.</param>
|
||||
public void setPhoneNumber(string phoneNumber){
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setPhoneNumber", phoneNumber);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the user emails and encrypt them.
|
||||
/// cryptMethod Encryption method:
|
||||
/// EmailCryptType.EmailCryptTypeMD5
|
||||
/// EmailCryptType.EmailCryptTypeSHA1
|
||||
/// EmailCryptType.EmailCryptTypeSHA256
|
||||
/// EmailCryptType.EmailCryptTypeNone
|
||||
/// </summary>
|
||||
/// <param name="cryptMethod">Encryption method.</param>
|
||||
/// <param name="emails">User emails.</param>
|
||||
public void setUserEmails(EmailCryptType cryptMethod, params string[] emails)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setUserEmails", getEmailType(cryptMethod), (object)emails);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opt-out of collection of Android ID.
|
||||
/// If the app does NOT contain Google Play Services, Android ID is collected by the SDK.
|
||||
/// However, apps with Google play services should avoid Android ID collection as this is in violation of the Google Play policy.
|
||||
/// </summary>
|
||||
/// <param name="isCollect">boolean, false to opt-out.</param>
|
||||
public void setCollectAndroidID(bool isCollect)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setCollectAndroidID", isCollect);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opt-out of collection of IMEI.
|
||||
/// If the app does NOT contain Google Play Services, device IMEI is collected by the SDK.
|
||||
/// However, apps with Google play services should avoid IMEI collection as this is in violation of the Google Play policy.
|
||||
/// </summary>
|
||||
/// <param name="isCollect">boolean, false to opt-out.</param>
|
||||
public void setCollectIMEI(bool isCollect)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setCollectIMEI", isCollect);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Advertisers can wrap AppsFlyer OneLink within another Universal Link.
|
||||
/// This Universal Link will invoke the app but any deep linking data will not propagate to AppsFlyer.
|
||||
/// </summary>
|
||||
/// <param name="urls">Array of urls.</param>
|
||||
public void setResolveDeepLinkURLs(params string[] urls)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setResolveDeepLinkURLs", (object)urls);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Advertisers can use this method to set vanity onelink domains.
|
||||
/// </summary>
|
||||
/// <param name="domains">Array of domains.</param>
|
||||
public void setOneLinkCustomDomain(params string[] domains)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setOneLinkCustomDomain", (object)domains);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manually set that the application was updated.
|
||||
/// </summary>
|
||||
/// <param name="isUpdate">isUpdate boolean value.</param>
|
||||
public void setIsUpdate(bool isUpdate)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setIsUpdate", isUpdate);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setting user local currency code for in-app purchases.
|
||||
/// The currency code should be a 3 character ISO 4217 code. (default is USD).
|
||||
/// You can set the currency code for all events by calling the following method.
|
||||
/// </summary>
|
||||
/// <param name="currencyCode">3 character ISO 4217 code.</param>
|
||||
public void setCurrencyCode(string currencyCode)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setCurrencyCode", currencyCode);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manually record the location of the user.
|
||||
/// </summary>
|
||||
/// <param name="latitude">latitude as double.</param>
|
||||
/// <param name="longitude">longitude as double.</param>
|
||||
public void recordLocation(double latitude, double longitude)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("trackLocation", latitude, longitude);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send an In-App Event.
|
||||
/// In-App Events provide insight on what is happening in your app.
|
||||
/// </summary>
|
||||
/// <param name="eventName">Event Name as String.</param>
|
||||
/// <param name="eventValues">Event Values as Dictionary.</param>
|
||||
public void sendEvent(string eventName, Dictionary<string, string> eventValues)
|
||||
{
|
||||
sendEvent(eventName, eventValues, false, AppsFlyer.CallBackObjectName);
|
||||
}
|
||||
|
||||
public void sendEvent(string eventName, Dictionary<string, string> eventValues, bool shouldCallback, string callBackObjectName)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("trackEvent", eventName, convertDictionaryToJavaMap(eventValues), shouldCallback, callBackObjectName);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Anonymize user Data.
|
||||
/// Use this API during the SDK Initialization to explicitly anonymize a user's installs, events and sessions.
|
||||
/// Default is false.
|
||||
/// </summary>
|
||||
/// <param name="isDisabled">isDisabled boolean.</param>
|
||||
public void anonymizeUser(bool isDisabled)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setDeviceTrackingDisabled", 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.
|
||||
/// This API must be invoked prior to initializing the AppsFlyer SDK in order to function properly.
|
||||
/// </summary>
|
||||
/// <param name="isEnabled">should Facebook's deferred app links be processed by the AppsFlyer SDK.</param>
|
||||
public void enableFacebookDeferredApplinks(bool isEnabled)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("enableFacebookDeferredApplinks", 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
|
||||
string isUserSubjectToGDPR = appsFlyerConsent.isUserSubjectToGDPR?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForDataUsage = appsFlyerConsent.hasConsentForDataUsage?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdsPersonalization = appsFlyerConsent.hasConsentForAdsPersonalization?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdStorage = appsFlyerConsent.hasConsentForAdStorage?.ToString().ToLower() ?? "null";
|
||||
|
||||
appsFlyerAndroid.CallStatic("setConsentData", isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization, hasConsentForAdStorage);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs ad revenue data along with additional parameters if provided.
|
||||
/// <param name = "adRevenueData" >instance of AFAdRevenueData containing ad revenue information.</param>
|
||||
/// <param name = "additionalParameters" >An optional map of additional parameters to be logged with ad revenue data. This can be null if there are no additional parameters.</param>
|
||||
public void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("logAdRevenue", adRevenueData.monetizationNetwork, getMediationNetwork(adRevenueData.mediationNetwork), adRevenueData.currencyIso4217Code, adRevenueData.eventRevenue, convertDictionaryToJavaMap(additionalParameters));
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restrict reengagement via deep-link to once per each unique deep-link.
|
||||
/// Otherwise deep re-occurring deep-links will be permitted for non-singleTask Activities and deep-linking via AppsFlyer deep-links.
|
||||
/// The default value is false.
|
||||
/// </summary>
|
||||
/// <param name="doConsume">doConsume boolean.</param>
|
||||
public void setConsumeAFDeepLinks(bool doConsume)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setConsumeAFDeepLinks", doConsume);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specify the manufacturer or media source name to which the preinstall is attributed.
|
||||
/// </summary>
|
||||
/// <param name="mediaSource">Manufacturer or media source name for preinstall attribution.</param>
|
||||
/// <param name="campaign">Campaign name for preinstall attribution.</param>
|
||||
/// <param name="siteId">Site ID for preinstall attribution.</param>
|
||||
public void setPreinstallAttribution(string mediaSource, string campaign, string siteId)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setPreinstallAttribution", mediaSource, campaign, siteId);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Boolean indicator for preinstall by Manufacturer.
|
||||
/// </summary>
|
||||
/// <returns>boolean isPreInstalledApp.</returns>
|
||||
public bool isPreInstalledApp()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<bool>("isPreInstalledApp");
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the Facebook attribution ID, if one exists.
|
||||
/// </summary>
|
||||
/// <returns>string Facebook attribution ID.</returns>
|
||||
public string getAttributionId()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<string>("getAttributionId");
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get AppsFlyer's unique device ID is created for every new install of an app.
|
||||
/// </summary>
|
||||
/// <returns>AppsFlyer's unique device ID.</returns>
|
||||
public string getAppsFlyerId()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<string>("getAppsFlyerId");
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [Deprecated] API for server verification of in-app purchases - please use V2 with AFPurchaseDetailsAndroid instead.
|
||||
/// An af_purchase event with the relevant values will be automatically sent if the validation is successful.
|
||||
/// </summary>
|
||||
/// <param name="publicKey">License Key obtained from the Google Play Console.</param>
|
||||
/// <param name="signature"><code>data.INAPP_DATA_SIGNATURE</code> from <code>onActivityResult(int requestCode, int resultCode, Intent data)</code></param>
|
||||
/// <param name="purchaseData"><code>data.INAPP_PURCHASE_DATA</code> from <code>onActivityResult(int requestCode, int resultCode, Intent data)</code></param>
|
||||
/// <param name="price">Purchase price, should be derived from <code>skuDetails.getStringArrayList("DETAILS_LIST")</code></param>
|
||||
/// <param name="currency">Purchase currency, should be derived from <code>skuDetails.getStringArrayList("DETAILS_LIST")</code></param>
|
||||
/// <param name="additionalParameters">additionalParameters Freehand parameters to be sent with the purchase (if validated).</param>
|
||||
[System.Obsolete("This method is deprecated. Use validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject) instead.")]
|
||||
public void validateAndSendInAppPurchase(string publicKey, string signature, string purchaseData, string price, string currency, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("validateAndTrackInAppPurchase", publicKey, signature, purchaseData, price, currency, convertDictionaryToJavaMap(additionalParameters), gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// V2 - API for server verification of in-app purchases.
|
||||
/// An af_purchase event with the relevant values will be automatically sent if the validation is successful.
|
||||
/// </summary>
|
||||
/// <param name="details">AFPurchaseDetailsAndroid instance.</param>
|
||||
/// <param name="purchaseAdditionalDetails">purchaseAdditionalDetails Freehand parameters to be sent with the purchase (if validated).</param>
|
||||
public void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("validateAndTrackInAppPurchaseV2", (int)details.purchaseType, details.purchaseToken, details.productId, convertDictionaryToJavaMap(purchaseAdditionalDetails), gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Was the stopSDK(boolean) API set to true.
|
||||
/// </summary>
|
||||
/// <returns>boolean isSDKStopped.</returns>
|
||||
public bool isSDKStopped()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<bool>("isTrackingStopped");
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a custom value for the minimum required time between sessions.
|
||||
/// By default, at least 5 seconds must lapse between 2 app launches to count as separate 2 sessions.
|
||||
/// </summary>
|
||||
/// <param name="seconds">minimum time between 2 separate sessions in seconds.</param>
|
||||
public void setMinTimeBetweenSessions(int seconds)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setMinTimeBetweenSessions", seconds);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a custom host.
|
||||
/// </summary>
|
||||
/// <param name="hostPrefixName">Host prefix.</param>
|
||||
/// <param name="hostName">Host name.</param>
|
||||
public void setHost(string hostPrefixName, string hostName)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setHost", hostPrefixName, hostName);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the host name.
|
||||
/// Default value is "appsflyer.com".
|
||||
/// </summary>
|
||||
/// <returns>Host name.</returns>
|
||||
public string getHostName()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<string>("getHostName");
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the custom host prefix.
|
||||
/// </summary>
|
||||
/// <returns>Host prefix.</returns>
|
||||
public string getHostPrefix()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
return appsFlyerAndroid.CallStatic<string>("getHostPrefix");
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used by advertisers to exclude all networks/integrated partners from getting data.
|
||||
/// </summary>
|
||||
public void setSharingFilterForAllPartners()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setSharingFilterForAllPartners");
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data.
|
||||
/// </summary>
|
||||
/// <param name="partners">partners to exclude from getting data</param>
|
||||
public void setSharingFilter(params string[] partners)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setSharingFilter", (object)partners);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lets you configure how which partners should the SDK exclude from data-sharing.
|
||||
/// </summary>
|
||||
/// <param name="partners">partners to exclude from getting data</param>
|
||||
public static void setSharingFilterForPartners(params string[] partners)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setSharingFilterForPartners", (object)partners);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a Conversion Data Listener.
|
||||
/// Allows the developer to access the user attribution data in real-time for every new install, directly from the SDK level.
|
||||
/// By doing this you can serve users with personalized content or send them to specific activities within the app,
|
||||
/// which can greatly enhance their engagement with your app.
|
||||
/// </summary>
|
||||
public void getConversionData(string objectName)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("getConversionData", objectName);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a validation listener for the validateAndSendInAppPurchase API.
|
||||
/// </summary>
|
||||
public void initInAppPurchaseValidatorListener(MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("initInAppPurchaseValidatorListener", gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// setCollectOaid
|
||||
/// You must include the appsflyer oaid library for this api to work.
|
||||
/// </summary>
|
||||
/// <param name="isCollect">isCollect oaid - set fasle to opt out</param>
|
||||
public void setCollectOaid(bool isCollect)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setCollectOaid", isCollect);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use the following API to attribute the click and launch the app store's app page.
|
||||
/// </summary>
|
||||
/// <param name="promoted_app_id">promoted App ID</param>
|
||||
/// <param name="campaign">cross promotion campaign</param>
|
||||
/// <param name="userParams">additional user params</param>
|
||||
public void attributeAndOpenStore(string promoted_app_id, string campaign, Dictionary<string, string> userParams, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("attributeAndOpenStore", promoted_app_id, campaign, convertDictionaryToJavaMap(userParams));
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To attribute an impression use the following API call.
|
||||
/// Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
|
||||
/// </summary>
|
||||
/// <param name="appID">promoted App ID.</param>
|
||||
/// <param name="campaign">cross promotion campaign.</param>
|
||||
/// <param name="parameters">parameters Dictionary.</param>
|
||||
public void recordCrossPromoteImpression(string appID, string campaign, Dictionary<string, string> parameters)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("recordCrossPromoteImpression", appID, campaign, convertDictionaryToJavaMap(parameters));
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The LinkGenerator class builds the invite URL according to various setter methods which allow passing on additional information on the click.
|
||||
/// See - https://support.appsflyer.com/hc/en-us/articles/115004480866-User-invite-attribution-
|
||||
/// </summary>
|
||||
/// <param name="parameters">parameters Dictionary.</param>
|
||||
public void generateUserInviteLink(Dictionary<string, string> parameters, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("createOneLinkInviteListener", convertDictionaryToJavaMap(parameters), gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To measure push notifications as part of a retargeting campaign.
|
||||
/// </summary>
|
||||
public void handlePushNotifications(){
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("handlePushNotifications");
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you’re integrating your app with push providers
|
||||
/// that don’t use the default push notification JSON schema the SDK expects.
|
||||
/// See docs for more info.
|
||||
/// </summary>
|
||||
/// <param name="paths">array of nested json path</param>
|
||||
public void addPushNotificationDeepLinkPath(params string[] paths)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("addPushNotificationDeepLinkPath", (object)paths);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// subscribe to unified deep link callbacks
|
||||
/// </summary>
|
||||
public void subscribeForDeepLink(string objectName){
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("subscribeForDeepLink", objectName);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disables collection of various Advertising IDs by the SDK. This includes Google Advertising ID (GAID), OAID and Amazon Advertising ID (AAID)
|
||||
/// </summary>
|
||||
/// <param name="disable">disable boolean.</param>
|
||||
public void setDisableAdvertisingIdentifiers(bool disable)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setDisableAdvertisingIdentifiers", disable);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows sending custom data for partner integration purposes.
|
||||
/// </summary>
|
||||
public void setPartnerData(string partnerId, Dictionary<string, string> partnerInfo)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setPartnerData", partnerId, convertDictionaryToJavaMap(partnerInfo));
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device.
|
||||
/// </summary>
|
||||
public void setDisableNetworkData(bool disable) {
|
||||
#if !UNITY_EDITOR
|
||||
appsFlyerAndroid.CallStatic("setDisableNetworkData", disable);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal Helper Method.
|
||||
/// </summary>
|
||||
private static AndroidJavaObject getEmailType(EmailCryptType cryptType)
|
||||
{
|
||||
AndroidJavaClass emailsCryptTypeEnum = new AndroidJavaClass("com.appsflyer.AppsFlyerProperties$EmailsCryptType");
|
||||
AndroidJavaObject emailsCryptType;
|
||||
|
||||
switch (cryptType)
|
||||
{
|
||||
case EmailCryptType.EmailCryptTypeSHA256:
|
||||
emailsCryptType = emailsCryptTypeEnum.GetStatic<AndroidJavaObject>("SHA256");
|
||||
break;
|
||||
default:
|
||||
emailsCryptType = emailsCryptTypeEnum.GetStatic<AndroidJavaObject>("NONE");
|
||||
break;
|
||||
}
|
||||
|
||||
return emailsCryptType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal Helper Method.
|
||||
/// </summary>
|
||||
private static AndroidJavaObject getMediationNetwork(MediationNetwork mediationNetwork)
|
||||
{
|
||||
AndroidJavaClass mediationNetworkEnumClass = new AndroidJavaClass("com.appsflyer.MediationNetwork");
|
||||
AndroidJavaObject mediationNetworkObject;
|
||||
|
||||
switch (mediationNetwork)
|
||||
{
|
||||
case MediationNetwork.IronSource:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("IRONSOURCE");
|
||||
break;
|
||||
case MediationNetwork.ApplovinMax:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("APPLOVIN_MAX");
|
||||
break;
|
||||
case MediationNetwork.GoogleAdMob:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("GOOGLE_ADMOB");
|
||||
break;
|
||||
case MediationNetwork.Fyber:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("FYBER");
|
||||
break;
|
||||
case MediationNetwork.Appodeal:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("APPODEAL");
|
||||
break;
|
||||
case MediationNetwork.Admost:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("ADMOST");
|
||||
break;
|
||||
case MediationNetwork.Topon:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("TOPON");
|
||||
break;
|
||||
case MediationNetwork.Tradplus:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("TRADPLUS");
|
||||
break;
|
||||
case MediationNetwork.Yandex:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("YANDEX");
|
||||
break;
|
||||
case MediationNetwork.ChartBoost:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("CHARTBOOST");
|
||||
break;
|
||||
case MediationNetwork.Unity:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("UNITY");
|
||||
break;
|
||||
case MediationNetwork.ToponPte:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("TOPON_PTE");
|
||||
break;
|
||||
case MediationNetwork.Custom:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("CUSTOM_MEDIATION");
|
||||
break;
|
||||
case MediationNetwork.DirectMonetization:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("DIRECT_MONETIZATION_NETWORK");
|
||||
break;
|
||||
default:
|
||||
mediationNetworkObject = mediationNetworkEnumClass.GetStatic<AndroidJavaObject>("NONE");
|
||||
break;
|
||||
}
|
||||
return mediationNetworkObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal Helper Method.
|
||||
/// </summary>
|
||||
private static AndroidJavaObject convertDictionaryToJavaMap(Dictionary<string, string> 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;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 172d18dd98e7e4ed3b30110568b0fae4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
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.
|
||||
|
||||
/// ## Properties:
|
||||
/// - `isUserSubjectToGDPR` (optional) - Indicates whether GDPR regulations apply to the user.
|
||||
/// This may also serve as a general compliance flag for other regional regulations.
|
||||
/// - `hasConsentForDataUsage` (optional) - Indicates whether the user consents to the processing
|
||||
/// of their data for advertising purposes.
|
||||
/// - `hasConsentForAdsPersonalization` (optional) - Indicates whether the user consents to the
|
||||
/// use of their data for personalized advertising.
|
||||
/// - `hasConsentForAdStorage` (optional) - Indicates whether the user consents to ad-related storage access.
|
||||
///
|
||||
/// **Usage Example:**
|
||||
/// ```csharp
|
||||
/// var consent = new AppsFlyerConsent(
|
||||
/// isUserSubjectToGDPR: true,
|
||||
/// hasConsentForDataUsage: true,
|
||||
/// hasConsentForAdsPersonalization: false,
|
||||
/// hasConsentForAdStorage: true
|
||||
/// );
|
||||
/// **Deprecated APIs:**
|
||||
/// - `ForGDPRUser(...)` and `ForNonGDPRUser(...)` should no longer be used.
|
||||
/// - Use `new AppsFlyerConsent(...)` instead with relevant consent fields.
|
||||
///
|
||||
/// </summary>
|
||||
public class AppsFlyerConsent
|
||||
{
|
||||
public bool? isUserSubjectToGDPR { get; private set; }
|
||||
public bool? hasConsentForDataUsage { get; private set; }
|
||||
public bool? hasConsentForAdsPersonalization { get; private set; }
|
||||
public bool? hasConsentForAdStorage { get; private set; }
|
||||
|
||||
public AppsFlyerConsent( bool? isUserSubjectToGDPR = null, bool? hasConsentForDataUsage = null, bool? hasConsentForAdsPersonalization = null, bool? hasConsentForAdStorage = null)
|
||||
{
|
||||
this.isUserSubjectToGDPR = isUserSubjectToGDPR;
|
||||
this.hasConsentForDataUsage = hasConsentForDataUsage;
|
||||
this.hasConsentForAdsPersonalization = hasConsentForAdsPersonalization;
|
||||
this.hasConsentForAdStorage = hasConsentForAdStorage;
|
||||
}
|
||||
|
||||
[Obsolete("Use the new constructor with optional booleans instead.")]
|
||||
private AppsFlyerConsent(bool isGDPR, bool hasForDataUsage, bool hasForAdsPersonalization)
|
||||
{
|
||||
isUserSubjectToGDPR = isGDPR;
|
||||
hasConsentForDataUsage = hasForDataUsage;
|
||||
hasConsentForAdsPersonalization = hasForAdsPersonalization;
|
||||
}
|
||||
|
||||
[Obsolete("Use new AppsFlyerConsent(...) instead.")]
|
||||
public static AppsFlyerConsent ForGDPRUser(bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization)
|
||||
{
|
||||
return new AppsFlyerConsent(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);
|
||||
}
|
||||
|
||||
[Obsolete("Use new AppsFlyerConsent(...) instead.")]
|
||||
public static AppsFlyerConsent ForNonGDPRUser()
|
||||
{
|
||||
return new AppsFlyerConsent(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a97c986fe4ee0461badf7042e08db3f3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,218 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Event args for AppsFlyer requests.
|
||||
/// Used for sessions and in-app events.
|
||||
/// Used to handle post request logic.
|
||||
///
|
||||
/// Examples:
|
||||
/// statusCode / errorDescription
|
||||
///
|
||||
/// 200 - null
|
||||
///
|
||||
/// 10 - "Event timeout. Check 'minTimeBetweenSessions' param"
|
||||
/// 11 - "Skipping event because 'isStopTracking' enabled"
|
||||
/// 40 - Network error: Error description comes from Android
|
||||
/// 41 - "No dev key"
|
||||
/// 50 - "Status code failure" + actual response code from the server
|
||||
///
|
||||
/// </summary>
|
||||
public class AppsFlyerRequestEventArgs : EventArgs
|
||||
{
|
||||
public AppsFlyerRequestEventArgs(int code, string description)
|
||||
{
|
||||
statusCode = code;
|
||||
errorDescription = description;
|
||||
}
|
||||
|
||||
public int statusCode { get; }
|
||||
public string errorDescription { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event args for OnDeepLinkReceived.
|
||||
/// Used to handle deep linking results.
|
||||
/// </summary>
|
||||
public class DeepLinkEventsArgs : EventArgs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// DeepLink dictionary to get additional parameters
|
||||
/// </summary>
|
||||
public Dictionary<string, object> deepLink;
|
||||
|
||||
/// <summary>
|
||||
/// DeepLink status: FOUND, NOT_FOUND, ERROR
|
||||
/// </summary>
|
||||
public DeepLinkStatus status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// DeepLink error: TIMEOUT, NETWORK, HTTP_STATUS_CODE, UNEXPECTED
|
||||
/// </summary>
|
||||
public DeepLinkError error { get; }
|
||||
|
||||
public string getMatchType()
|
||||
{
|
||||
return getDeepLinkParameter("match_type");
|
||||
}
|
||||
|
||||
public string getDeepLinkValue()
|
||||
{
|
||||
return getDeepLinkParameter("deep_link_value");
|
||||
}
|
||||
|
||||
public string getClickHttpReferrer()
|
||||
{
|
||||
return getDeepLinkParameter("click_http_referrer");
|
||||
}
|
||||
|
||||
public string getMediaSource()
|
||||
{
|
||||
return getDeepLinkParameter("media_source");
|
||||
}
|
||||
|
||||
public string getCampaign()
|
||||
{
|
||||
return getDeepLinkParameter("campaign");
|
||||
}
|
||||
|
||||
public string getCampaignId()
|
||||
{
|
||||
return getDeepLinkParameter("campaign_id");
|
||||
}
|
||||
|
||||
public string getAfSub1()
|
||||
{
|
||||
return getDeepLinkParameter("af_sub1");
|
||||
}
|
||||
|
||||
public string getAfSub2()
|
||||
{
|
||||
return getDeepLinkParameter("af_sub2");
|
||||
}
|
||||
|
||||
public string getAfSub3()
|
||||
{
|
||||
return getDeepLinkParameter("af_sub3");
|
||||
}
|
||||
|
||||
public string getAfSub4()
|
||||
{
|
||||
return getDeepLinkParameter("af_sub4");
|
||||
}
|
||||
|
||||
public string getAfSub5()
|
||||
{
|
||||
return getDeepLinkParameter("af_sub5");
|
||||
}
|
||||
|
||||
public bool isDeferred()
|
||||
{
|
||||
if (deepLink != null && deepLink.ContainsKey("is_deferred"))
|
||||
{
|
||||
try
|
||||
{
|
||||
return (bool)deepLink["is_deferred"];
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
AppsFlyer.AFLog("DeepLinkEventsArgs.isDeferred", String.Format("{0} Exception caught.", e));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Dictionary<string, object> getDeepLinkDictionary()
|
||||
{
|
||||
return deepLink;
|
||||
}
|
||||
|
||||
public DeepLinkEventsArgs(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> dictionary = AppsFlyer.CallbackStringToDictionary(str);
|
||||
|
||||
string status = "";
|
||||
string error = "";
|
||||
|
||||
|
||||
if (dictionary.ContainsKey("status") && dictionary["status"] != null)
|
||||
{
|
||||
status = dictionary["status"].ToString();
|
||||
}
|
||||
|
||||
if (dictionary.ContainsKey("error") && dictionary["error"] != null)
|
||||
{
|
||||
error = dictionary["error"].ToString();
|
||||
}
|
||||
|
||||
if (dictionary.ContainsKey("deepLink") && dictionary["deepLink"] != null)
|
||||
{
|
||||
this.deepLink = AppsFlyer.CallbackStringToDictionary(dictionary["deepLink"].ToString());
|
||||
}
|
||||
if (dictionary.ContainsKey("is_deferred"))
|
||||
{
|
||||
this.deepLink["is_deferred"] = dictionary["is_deferred"];
|
||||
}
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case "FOUND":
|
||||
this.status = DeepLinkStatus.FOUND;
|
||||
break;
|
||||
case "NOT_FOUND":
|
||||
this.status = DeepLinkStatus.NOT_FOUND;
|
||||
break;
|
||||
default:
|
||||
this.status = DeepLinkStatus.ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (error)
|
||||
{
|
||||
case "TIMEOUT":
|
||||
this.error = DeepLinkError.TIMEOUT;
|
||||
break;
|
||||
case "NETWORK":
|
||||
this.error = DeepLinkError.NETWORK;
|
||||
break;
|
||||
case "HTTP_STATUS_CODE":
|
||||
this.error = DeepLinkError.HTTP_STATUS_CODE;
|
||||
break;
|
||||
default:
|
||||
this.error = DeepLinkError.UNEXPECTED;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
AppsFlyer.AFLog("DeepLinkEventsArgs.parseDeepLink", String.Format("{0} Exception caught.", e));
|
||||
}
|
||||
}
|
||||
|
||||
private string getDeepLinkParameter(string name)
|
||||
{
|
||||
if (deepLink != null && deepLink.ContainsKey(name) && deepLink[name] != null)
|
||||
{
|
||||
return deepLink[name].ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum DeepLinkStatus {
|
||||
FOUND, NOT_FOUND, ERROR
|
||||
}
|
||||
|
||||
public enum DeepLinkError {
|
||||
TIMEOUT, NETWORK, HTTP_STATUS_CODE, UNEXPECTED
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0fc241ad5a9b43a7b461a6147dbc74c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7315102894599890749
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6207133488976360133}
|
||||
- component: {fileID: 4405976200006927252}
|
||||
m_Layer: 0
|
||||
m_Name: AppsFlyerObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6207133488976360133
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7315102894599890749}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &4405976200006927252
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7315102894599890749}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a2ec6ba1ee8b48749524f015ed572a6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
devKey:
|
||||
appID:
|
||||
isDebug: 0
|
||||
getConversionData: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bfe3b149145747cc92dc53bb4df4e9b
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using AppsFlyerSDK;
|
||||
|
||||
// This class is intended to be used the the AppsFlyerObject.prefab
|
||||
|
||||
public class AppsFlyerObjectScript : MonoBehaviour , IAppsFlyerConversionData
|
||||
{
|
||||
|
||||
// These fields are set from the editor so do not modify!
|
||||
//******************************//
|
||||
public string devKey;
|
||||
public string appID;
|
||||
public string UWPAppID;
|
||||
public string macOSAppID;
|
||||
public bool isDebug;
|
||||
public bool getConversionData;
|
||||
//******************************//
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
// These fields are set from the editor so do not modify!
|
||||
//******************************//
|
||||
AppsFlyer.setIsDebug(isDebug);
|
||||
#if UNITY_WSA_10_0 && !UNITY_EDITOR
|
||||
AppsFlyer.initSDK(devKey, UWPAppID, getConversionData ? this : null);
|
||||
#elif UNITY_STANDALONE_OSX && !UNITY_EDITOR
|
||||
AppsFlyer.initSDK(devKey, macOSAppID, getConversionData ? this : null);
|
||||
#else
|
||||
AppsFlyer.initSDK(devKey, appID, getConversionData ? this : null);
|
||||
#endif
|
||||
//******************************/
|
||||
|
||||
AppsFlyer.startSDK();
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Mark AppsFlyer CallBacks
|
||||
public void onConversionDataSuccess(string conversionData)
|
||||
{
|
||||
AppsFlyer.AFLog("didReceiveConversionData", conversionData);
|
||||
Dictionary<string, object> conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
|
||||
// add deferred deeplink logic here
|
||||
}
|
||||
|
||||
public void onConversionDataFail(string error)
|
||||
{
|
||||
AppsFlyer.AFLog("didReceiveConversionDataWithError", error);
|
||||
}
|
||||
|
||||
public void onAppOpenAttribution(string attributionData)
|
||||
{
|
||||
AppsFlyer.AFLog("onAppOpenAttribution", attributionData);
|
||||
Dictionary<string, object> attributionDataDictionary = AppsFlyer.CallbackStringToDictionary(attributionData);
|
||||
// add direct deeplink logic here
|
||||
}
|
||||
|
||||
public void onAppOpenAttributionFailure(string error)
|
||||
{
|
||||
AppsFlyer.AFLog("onAppOpenAttributionFailure", error);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a2ec6ba1ee8b48749524f015ed572a6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+426
@@ -0,0 +1,426 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
public interface IAppsFlyerPurchaseRevenueDataSource
|
||||
{
|
||||
Dictionary<string, object> PurchaseRevenueAdditionalParametersForProducts(HashSet<object> products, HashSet<object> transactions);
|
||||
}
|
||||
|
||||
public interface IAppsFlyerPurchaseRevenueDataSourceStoreKit2
|
||||
{
|
||||
Dictionary<string, object> PurchaseRevenueAdditionalParametersStoreKit2ForProducts(HashSet<object> products, HashSet<object> transactions);
|
||||
}
|
||||
|
||||
public class AppsFlyerPurchaseRevenueBridge : MonoBehaviour
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
[DllImport("__Internal")]
|
||||
private static extern void RegisterUnityPurchaseRevenueParamsCallback(Func<string, string, string> callback);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void RegisterUnityPurchaseRevenueParamsCallbackSK2(Func<string, string, string> callback);
|
||||
#endif
|
||||
|
||||
private static IAppsFlyerPurchaseRevenueDataSource _dataSource;
|
||||
private static IAppsFlyerPurchaseRevenueDataSourceStoreKit2 _dataSourceSK2;
|
||||
|
||||
public static void RegisterDataSource(IAppsFlyerPurchaseRevenueDataSource dataSource)
|
||||
{
|
||||
_dataSource = dataSource;
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
RegisterUnityPurchaseRevenueParamsCallback(GetAdditionalParameters);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
using (AndroidJavaClass jc = new AndroidJavaClass("com.appsflyer.unity.PurchaseRevenueBridge"))
|
||||
{
|
||||
jc.CallStatic("setUnityBridge", new UnityPurchaseRevenueBridgeProxy());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void RegisterDataSourceStoreKit2(IAppsFlyerPurchaseRevenueDataSourceStoreKit2 dataSource)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_dataSourceSK2 = dataSource;
|
||||
RegisterUnityPurchaseRevenueParamsCallbackSK2(GetAdditionalParametersSK2);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Dictionary<string, object> GetAdditionalParametersForAndroid(HashSet<object> products, HashSet<object> transactions)
|
||||
{
|
||||
return _dataSource?.PurchaseRevenueAdditionalParametersForProducts(products, transactions)
|
||||
?? new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
[AOT.MonoPInvokeCallback(typeof(Func<string, string, string>))]
|
||||
public static string GetAdditionalParameters(string productsJson, string transactionsJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
HashSet<object> products = new HashSet<object>();
|
||||
HashSet<object> transactions = new HashSet<object>();
|
||||
|
||||
if (!string.IsNullOrEmpty(productsJson))
|
||||
{
|
||||
var dict = AFMiniJSON.Json.Deserialize(productsJson) as Dictionary<string, object>;
|
||||
if (dict != null)
|
||||
{
|
||||
if (dict.TryGetValue("products", out var productsObj) && productsObj is List<object> productList)
|
||||
products = new HashSet<object>(productList);
|
||||
|
||||
if (dict.TryGetValue("transactions", out var transactionsObj) && transactionsObj is List<object> transactionList)
|
||||
transactions = new HashSet<object>(transactionList);
|
||||
}
|
||||
}
|
||||
|
||||
var parameters = _dataSource?.PurchaseRevenueAdditionalParametersForProducts(products, transactions)
|
||||
?? new Dictionary<string, object>();
|
||||
return AFMiniJSON.Json.Serialize(parameters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"[AppsFlyer] Exception in GetAdditionalParameters: {e}");
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
[AOT.MonoPInvokeCallback(typeof(Func<string, string, string>))]
|
||||
public static string GetAdditionalParametersSK2(string productsJson, string transactionsJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
HashSet<object> products = new HashSet<object>();
|
||||
HashSet<object> transactions = new HashSet<object>();
|
||||
|
||||
if (!string.IsNullOrEmpty(productsJson))
|
||||
{
|
||||
var dict = AFMiniJSON.Json.Deserialize(productsJson) as Dictionary<string, object>;
|
||||
if (dict != null && dict.TryGetValue("products", out var productsObj) && productsObj is List<object> productList)
|
||||
products = new HashSet<object>(productList);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(transactionsJson))
|
||||
{
|
||||
var dict = AFMiniJSON.Json.Deserialize(transactionsJson) as Dictionary<string, object>;
|
||||
if (dict != null && dict.TryGetValue("transactions", out var transactionsObj) && transactionsObj is List<object> transactionList)
|
||||
transactions = new HashSet<object>(transactionList);
|
||||
}
|
||||
|
||||
var parameters = _dataSourceSK2?.PurchaseRevenueAdditionalParametersStoreKit2ForProducts(products, transactions)
|
||||
?? new Dictionary<string, object>();
|
||||
return AFMiniJSON.Json.Serialize(parameters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"[AppsFlyer] Exception in GetAdditionalParametersSK2: {e}");
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public class UnityPurchaseRevenueBridgeProxy : AndroidJavaProxy
|
||||
{
|
||||
public UnityPurchaseRevenueBridgeProxy() : base("com.appsflyer.unity.PurchaseRevenueBridge$UnityPurchaseRevenueBridge") { }
|
||||
|
||||
public string getAdditionalParameters(string productsJson, string transactionsJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create empty sets if JSON is null or empty
|
||||
HashSet<object> products = new HashSet<object>();
|
||||
HashSet<object> transactions = new HashSet<object>();
|
||||
|
||||
// Only try to parse if we have valid JSON
|
||||
if (!string.IsNullOrEmpty(productsJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
// First try to parse as a simple array
|
||||
var parsedProducts = AFMiniJSON.Json.Deserialize(productsJson);
|
||||
if (parsedProducts is List<object> productList)
|
||||
{
|
||||
products = new HashSet<object>(productList);
|
||||
}
|
||||
else if (parsedProducts is Dictionary<string, object> dict)
|
||||
{
|
||||
if (dict.ContainsKey("events") && dict["events"] is List<object> eventsList)
|
||||
{
|
||||
products = new HashSet<object>(eventsList);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If it's a dictionary but doesn't have events, add the whole dict
|
||||
products.Add(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error parsing products JSON: {e.Message}\nJSON: {productsJson}");
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(transactionsJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
// First try to parse as a simple array
|
||||
var parsedTransactions = AFMiniJSON.Json.Deserialize(transactionsJson);
|
||||
if (parsedTransactions is List<object> transactionList)
|
||||
{
|
||||
transactions = new HashSet<object>(transactionList);
|
||||
}
|
||||
else if (parsedTransactions is Dictionary<string, object> dict)
|
||||
{
|
||||
if (dict.ContainsKey("events") && dict["events"] is List<object> eventsList)
|
||||
{
|
||||
transactions = new HashSet<object>(eventsList);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If it's a dictionary but doesn't have events, add the whole dict
|
||||
transactions.Add(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error parsing transactions JSON: {e.Message}\nJSON: {transactionsJson}");
|
||||
}
|
||||
}
|
||||
|
||||
var parameters = AppsFlyerPurchaseRevenueBridge.GetAdditionalParametersForAndroid(products, transactions);
|
||||
return AFMiniJSON.Json.Serialize(parameters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error in getAdditionalParameters: {e.Message}\nProducts JSON: {productsJson}\nTransactions JSON: {transactionsJson}");
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class AppsFlyerPurchaseConnector : MonoBehaviour {
|
||||
|
||||
private static AppsFlyerPurchaseConnector instance;
|
||||
private Dictionary<string, object> pendingParameters;
|
||||
private Action<Dictionary<string, object>> pendingCallback;
|
||||
|
||||
public static AppsFlyerPurchaseConnector Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
GameObject go = new GameObject("AppsFlyerPurchaseConnector");
|
||||
instance = go.AddComponent<AppsFlyerPurchaseConnector>();
|
||||
DontDestroyOnLoad(go);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
private static AndroidJavaClass appsFlyerAndroidConnector = new AndroidJavaClass("com.appsflyer.unity.AppsFlyerAndroidWrapper");
|
||||
#endif
|
||||
|
||||
public static void init(MonoBehaviour unityObject, Store s) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_initPurchaseConnector(unityObject.name);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
int store = mapStoreToInt(s);
|
||||
appsFlyerAndroidConnector.CallStatic("initPurchaseConnector", unityObject ? unityObject.name : null, store);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void build() {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
//not for iOS
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("build");
|
||||
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void startObservingTransactions() {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_startObservingTransactions();
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("startObservingTransactions");
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void stopObservingTransactions() {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_stopObservingTransactions();
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("stopObservingTransactions");
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setIsSandbox(bool isSandbox) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setIsSandbox(isSandbox);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("setIsSandbox", isSandbox);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setPurchaseRevenueValidationListeners(bool enableCallbacks) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setPurchaseRevenueDelegate();
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
appsFlyerAndroidConnector.CallStatic("setPurchaseRevenueValidationListeners", enableCallbacks);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setAutoLogPurchaseRevenue(params AppsFlyerAutoLogPurchaseRevenueOptions[] autoLogPurchaseRevenueOptions) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
int option = 0;
|
||||
foreach (AppsFlyerAutoLogPurchaseRevenueOptions op in autoLogPurchaseRevenueOptions) {
|
||||
option = option | (int)op;
|
||||
}
|
||||
_setAutoLogPurchaseRevenue(option);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
if (autoLogPurchaseRevenueOptions.Length == 0) {
|
||||
return;
|
||||
}
|
||||
foreach (AppsFlyerAutoLogPurchaseRevenueOptions op in autoLogPurchaseRevenueOptions) {
|
||||
switch(op) {
|
||||
case AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsDisabled:
|
||||
break;
|
||||
case AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsAutoRenewableSubscriptions:
|
||||
appsFlyerAndroidConnector.CallStatic("setAutoLogSubscriptions", true);
|
||||
break;
|
||||
case AppsFlyerAutoLogPurchaseRevenueOptions.AppsFlyerAutoLogPurchaseRevenueOptionsInAppPurchases:
|
||||
appsFlyerAndroidConnector.CallStatic("setAutoLogInApps", true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setPurchaseRevenueDataSource(IAppsFlyerPurchaseRevenueDataSource dataSource)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
if (dataSource != null)
|
||||
{
|
||||
_setPurchaseRevenueDataSource(dataSource.GetType().Name);
|
||||
AppsFlyerPurchaseRevenueBridge.RegisterDataSource(dataSource);
|
||||
}
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
if (dataSource != null)
|
||||
{
|
||||
AppsFlyerPurchaseRevenueBridge.RegisterDataSource(dataSource);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static void setPurchaseRevenueDataSourceStoreKit2(IAppsFlyerPurchaseRevenueDataSourceStoreKit2 dataSourceSK2)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
if (dataSourceSK2 != null)
|
||||
{
|
||||
AppsFlyerPurchaseRevenueBridge.RegisterDataSourceStoreKit2(dataSourceSK2);
|
||||
_setPurchaseRevenueDataSource("AppsFlyerObjectScript_StoreKit2");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private static int mapStoreToInt(Store s) {
|
||||
switch(s) {
|
||||
case(Store.GOOGLE):
|
||||
return 0;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setStoreKitVersion(StoreKitVersion storeKitVersion) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_setStoreKitVersion((int)storeKitVersion);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
// Android doesn't use StoreKit
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void logConsumableTransaction(string transactionJson) {
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
_logConsumableTransaction(transactionJson);
|
||||
#elif UNITY_ANDROID && !UNITY_EDITOR
|
||||
// Android doesn't use StoreKit
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _startObservingTransactions();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _stopObservingTransactions();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setIsSandbox(bool isSandbox);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setPurchaseRevenueDelegate();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setPurchaseRevenueDataSource(string dataSourceName);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setAutoLogPurchaseRevenue(int option);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _initPurchaseConnector(string objectName);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _setStoreKitVersion(int storeKitVersion);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _logConsumableTransaction(string transactionJson);
|
||||
|
||||
#endif
|
||||
}
|
||||
public enum Store {
|
||||
GOOGLE = 0
|
||||
}
|
||||
public enum AppsFlyerAutoLogPurchaseRevenueOptions
|
||||
{
|
||||
AppsFlyerAutoLogPurchaseRevenueOptionsDisabled = 0,
|
||||
AppsFlyerAutoLogPurchaseRevenueOptionsAutoRenewableSubscriptions = 1 << 0,
|
||||
AppsFlyerAutoLogPurchaseRevenueOptionsInAppPurchases = 1 << 1
|
||||
}
|
||||
|
||||
public enum StoreKitVersion {
|
||||
SK1 = 0,
|
||||
SK2 = 1
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0636ea07d370d437183f3762280c08ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b34371b3cc09641ebb007ffc4e9500f0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f84c02aa78da4ac9b444d98d97f7cc4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "AppsFlyer.Editor",
|
||||
"references": [
|
||||
"AppsFlyer"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d008146f00dea44d38752b4289e5f65b
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dependencies>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.appsflyer:af-android-sdk:6.17.6"></androidPackage>
|
||||
<androidPackage spec="com.appsflyer:unity-wrapper:6.17.91"></androidPackage>
|
||||
<androidPackage spec="com.android.installreferrer:installreferrer:2.1"></androidPackage>
|
||||
<androidPackage spec="com.appsflyer:purchase-connector:2.2.0"></androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<iosPods>
|
||||
<iosPod name="AppsFlyerFramework" version="6.17.9" minTargetSdk="12.0"></iosPod>
|
||||
<iosPod name="PurchaseConnector" version="6.17.9" minTargetSdk="12.0"></iosPod>
|
||||
</iosPods>
|
||||
|
||||
</dependencies>
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bca76e8f7c8c74eadb5d85e4f24aa144
|
||||
guid: a03558dbbfeac45db9afe9e9c2df5a85
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
[CustomEditor(typeof(AppsFlyerObjectScript))]
|
||||
[CanEditMultipleObjects]
|
||||
public class AppsFlyerObjectEditor : Editor
|
||||
{
|
||||
|
||||
SerializedProperty devKey;
|
||||
SerializedProperty appID;
|
||||
SerializedProperty UWPAppID;
|
||||
SerializedProperty macOSAppID;
|
||||
SerializedProperty isDebug;
|
||||
SerializedProperty getConversionData;
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
devKey = serializedObject.FindProperty("devKey");
|
||||
appID = serializedObject.FindProperty("appID");
|
||||
UWPAppID = serializedObject.FindProperty("UWPAppID");
|
||||
macOSAppID = serializedObject.FindProperty("macOSAppID");
|
||||
isDebug = serializedObject.FindProperty("isDebug");
|
||||
getConversionData = serializedObject.FindProperty("getConversionData");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
DrawLogo();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.HelpBox("Set your devKey and appID to init the AppsFlyer SDK and start tracking. You must modify these fields and provide:\ndevKey - Your application devKey provided by AppsFlyer.\nappId - For iOS only. Your iTunes Application ID.\nUWP app id - For UWP only. Your application app id \nMac OS app id - For MacOS app only.", MessageType.Info);
|
||||
|
||||
EditorGUILayout.PropertyField(devKey);
|
||||
EditorGUILayout.PropertyField(appID);
|
||||
EditorGUILayout.PropertyField(UWPAppID);
|
||||
EditorGUILayout.PropertyField(macOSAppID);
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.HelpBox("Enable get conversion data to allow your app to recive deeplinking callbacks", MessageType.None);
|
||||
EditorGUILayout.PropertyField(getConversionData);
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.HelpBox("Debugging should be restricted to development phase only.\n Do not distribute the app to app stores with debugging enabled", MessageType.Warning);
|
||||
EditorGUILayout.PropertyField(isDebug);
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.HelpBox("For more information on setting up AppsFlyer check out our relevant docs.", MessageType.None);
|
||||
|
||||
|
||||
if (GUILayout.Button("AppsFlyer Unity Docs", new GUILayoutOption[] { GUILayout.Width(200) }))
|
||||
{
|
||||
Application.OpenURL("https://support.appsflyer.com/hc/en-us/articles/213766183-Unity-SDK-integration-for-developers");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("AppsFlyer Android Docs", new GUILayoutOption[] { GUILayout.Width(200) }))
|
||||
{
|
||||
Application.OpenURL("https://support.appsflyer.com/hc/en-us/articles/207032126-Android-SDK-integration-for-developers");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("AppsFlyer iOS Docs", new GUILayoutOption[] { GUILayout.Width(200) }))
|
||||
{
|
||||
Application.OpenURL("https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("AppsFlyer Deeplinking Docs", new GUILayoutOption[] { GUILayout.Width(200) }))
|
||||
{
|
||||
Application.OpenURL("https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-deep-linking-guide#Setups");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("AppsFlyer Windows Docs", new GUILayoutOption[] { GUILayout.Width(200) }))
|
||||
{
|
||||
Application.OpenURL("https://support.appsflyer.com/hc/en-us/articles/207032026-Windows-and-Xbox-SDK-integration-for-developers");
|
||||
}
|
||||
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
private void DrawLogo()
|
||||
{
|
||||
var guids = AssetDatabase.FindAssets("appsflyer_logo");
|
||||
if (guids.Length == 0) return;
|
||||
|
||||
Texture logo = (Texture)AssetDatabase.LoadAssetAtPath(
|
||||
AssetDatabase.GUIDToAssetPath(guids[0]),
|
||||
typeof(Texture));
|
||||
|
||||
if (logo == null) return;
|
||||
|
||||
float maxWidth = Mathf.Min(200, EditorGUIUtility.currentViewWidth - 40);
|
||||
float aspect = (float)logo.height / logo.width;
|
||||
float height = maxWidth * aspect;
|
||||
|
||||
Rect rect = GUILayoutUtility.GetRect(maxWidth, height, GUILayout.ExpandWidth(false));
|
||||
rect.x = (EditorGUIUtility.currentViewWidth - maxWidth) * 0.5f;
|
||||
rect.width = maxWidth;
|
||||
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d248a134cf494486fb1d6a2e95a05d87
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
+92
@@ -0,0 +1,92 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc7fa5a6b64b944a4b2900fd877acb8b
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
public interface IAppsFlyerAndroidBridge : IAppsFlyerNativeBridge
|
||||
{
|
||||
void updateServerUninstallToken(string token);
|
||||
void setImeiData(string imei);
|
||||
void setAndroidIdData(string androidId);
|
||||
void waitForCustomerUserId(bool wait);
|
||||
void setCustomerIdAndStartSDK(string id);
|
||||
string getOutOfStore();
|
||||
void setOutOfStore(string sourceName);
|
||||
void setCollectAndroidID(bool isCollect);
|
||||
void setCollectIMEI(bool isCollect);
|
||||
void setIsUpdate(bool isUpdate);
|
||||
void setPreinstallAttribution(string mediaSource, string campaign, string siteId);
|
||||
bool isPreInstalledApp();
|
||||
string getAttributionId();
|
||||
void handlePushNotifications();
|
||||
void validateAndSendInAppPurchase(string publicKey, string signature, string purchaseData, string price, string currency, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject);
|
||||
void validateAndSendInAppPurchase(AFPurchaseDetailsAndroid details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject);
|
||||
void setCollectOaid(bool isCollect);
|
||||
void setDisableAdvertisingIdentifiers(bool disable);
|
||||
void setDisableNetworkData(bool disable);
|
||||
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdf9d1bc41a8244b3bc2d249fb6cd7aa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public interface IAppsFlyerConversionData
|
||||
{
|
||||
/// <summary>
|
||||
/// `conversionData` contains information about install. Organic/non-organic, etc.
|
||||
/// <see>https://support.appsflyer.com/hc/en-us/articles/360000726098-Conversion-Data-Scenarios#Introduction</see>
|
||||
/// </summary>
|
||||
/// <param name="conversionData">JSON string of the returned conversion data.</param>
|
||||
void onConversionDataSuccess(string conversionData);
|
||||
|
||||
/// <summary>
|
||||
/// Any errors that occurred during the conversion request.
|
||||
/// </summary>
|
||||
/// <param name="error">A string describing the error.</param>
|
||||
void onConversionDataFail(string error);
|
||||
|
||||
/// <summary>
|
||||
/// `attributionData` contains information about OneLink, deeplink.
|
||||
/// <see>https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#Intro</see>
|
||||
/// </summary>
|
||||
/// <param name="attributionData">JSON string of the returned deeplink data.</param>
|
||||
void onAppOpenAttribution(string attributionData);
|
||||
|
||||
/// <summary>
|
||||
/// Any errors that occurred during the attribution request.
|
||||
/// </summary>
|
||||
/// <param name="error">A string describing the error.</param>
|
||||
void onAppOpenAttributionFailure(string error);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2f1d4dadb7cb44628f25f1ffd8fc104
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
public interface IAppsFlyerIOSBridge : IAppsFlyerNativeBridge
|
||||
{
|
||||
void setDisableCollectAppleAdSupport(bool disable);
|
||||
void setShouldCollectDeviceName(bool shouldCollectDeviceName);
|
||||
void setDisableCollectIAd(bool disableCollectIAd);
|
||||
void setUseReceiptValidationSandbox(bool useReceiptValidationSandbox);
|
||||
void setUseUninstallSandbox(bool useUninstallSandbox);
|
||||
void validateAndSendInAppPurchase(string productIdentifier, string price, string currency, string transactionId, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject);
|
||||
void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject);
|
||||
void registerUninstall(byte[] deviceToken);
|
||||
void handleOpenUrl(string url, string sourceApplication, string annotation);
|
||||
void waitForATTUserAuthorizationWithTimeoutInterval(int timeoutInterval);
|
||||
void setCurrentDeviceLanguage(string language);
|
||||
void disableSKAdNetwork(bool isDisabled);
|
||||
void disableIDFVCollection(bool isDisabled);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6847fb337898040288c165e3667101a3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
|
||||
public interface IAppsFlyerNativeBridge
|
||||
{
|
||||
bool isInit { get; set; }
|
||||
|
||||
void startSDK(bool onRequestResponse, string CallBackObjectName);
|
||||
|
||||
void sendEvent(string eventName, Dictionary<string, string> eventValues, bool onInAppResponse, string CallBackObjectName);
|
||||
|
||||
void stopSDK(bool isSDKStopped);
|
||||
|
||||
bool isSDKStopped();
|
||||
|
||||
string getSdkVersion();
|
||||
|
||||
void setCustomerUserId(string id);
|
||||
|
||||
void setAppInviteOneLinkID(string oneLinkId);
|
||||
|
||||
void setAdditionalData(Dictionary<string, string> customData);
|
||||
|
||||
void setDeepLinkTimeout(long deepLinkTimeout);
|
||||
|
||||
void setResolveDeepLinkURLs(params string[] urls);
|
||||
|
||||
void setOneLinkCustomDomain(params string[] domains);
|
||||
|
||||
void setCurrencyCode(string currencyCode);
|
||||
|
||||
void recordLocation(double latitude, double longitude);
|
||||
|
||||
void anonymizeUser(bool shouldAnonymizeUser);
|
||||
|
||||
string getAppsFlyerId();
|
||||
|
||||
void enableTCFDataCollection(bool shouldCollectTcfData);
|
||||
|
||||
void setConsentData(AppsFlyerConsent appsFlyerConsent);
|
||||
|
||||
void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters);
|
||||
|
||||
void setMinTimeBetweenSessions(int seconds);
|
||||
|
||||
void setHost(string hostPrefixName, string hostName);
|
||||
|
||||
void setPhoneNumber(string phoneNumber);
|
||||
|
||||
void setSharingFilterForAllPartners();
|
||||
|
||||
void setSharingFilter(params string[] partners);
|
||||
|
||||
void getConversionData(string objectName);
|
||||
|
||||
void attributeAndOpenStore(string appID, string campaign, Dictionary<string, string> userParams, MonoBehaviour gameObject);
|
||||
|
||||
void recordCrossPromoteImpression(string appID, string campaign, Dictionary<string, string> parameters);
|
||||
|
||||
void generateUserInviteLink(Dictionary<string, string> parameters, MonoBehaviour gameObject);
|
||||
|
||||
void addPushNotificationDeepLinkPath(params string[] paths);
|
||||
|
||||
void setUserEmails(EmailCryptType cryptType, params string[] userEmails);
|
||||
|
||||
void subscribeForDeepLink(string objectName);
|
||||
|
||||
void setIsDebug(bool shouldEnable);
|
||||
|
||||
void setPartnerData(string partnerId, Dictionary<string, string> partnerInfo);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 409b8302434664a3785ce55d075e7f58
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public interface IAppsFlyerPurchaseValidation
|
||||
{
|
||||
void didReceivePurchaseRevenueValidationInfo(string validationInfo);
|
||||
void didReceivePurchaseRevenueError(string error);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c60f499ae0d048b1be8ffd6878a184c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public interface IAppsFlyerUserInvite
|
||||
{
|
||||
/// <summary>
|
||||
/// The success callback for generating OneLink URLs.
|
||||
/// </summary>
|
||||
/// <param name="link">A string of the newly created url.</param>
|
||||
void onInviteLinkGenerated(string link);
|
||||
|
||||
/// <summary>
|
||||
/// The error callback for generating OneLink URLs
|
||||
/// </summary>
|
||||
/// <param name="error">A string describing the error.</param>
|
||||
void onInviteLinkGeneratedFailure(string error);
|
||||
|
||||
/// <summary>
|
||||
/// (ios only) iOS allows you to utilize the StoreKit component to open
|
||||
/// the App Store while remaining in the context of your app.
|
||||
/// More details at <see>https://support.appsflyer.com/hc/en-us/articles/115004481946-Cross-Promotion-Tracking#tracking-cross-promotion-impressions</see>
|
||||
/// </summary>
|
||||
/// <param name="link">openStore callback Contains promoted `clickURL`</param>
|
||||
void onOpenStoreLinkGenerated(string link);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a4cdfa023cb8497b94bb39720052fef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace AppsFlyerSDK
|
||||
{
|
||||
public interface IAppsFlyerValidateAndLog
|
||||
{
|
||||
/// <summary>
|
||||
/// The success callback for validateAndSendInAppPurchase API.
|
||||
/// For Android : the callback will return JSON string.
|
||||
/// For iOS : the callback will return a JSON string from apples verifyReceipt API.
|
||||
/// </summary>
|
||||
/// <param name="result"></param>
|
||||
void onValidateAndLogComplete(string result);
|
||||
|
||||
/// <summary>
|
||||
/// The error callback for validateAndSendInAppPurchase API.
|
||||
/// </summary>
|
||||
/// <param name="error">A string describing the error.</param>
|
||||
void onValidateAndLogFailure(string error);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user