31 Commits

Author SHA1 Message Date
3761057b3e update core 2024-04-01 11:34:03 +08:00
30da59caa8 update 203 2024-03-13 18:17:53 +08:00
bc0f1d72c1 update 1.1.25 2024-03-13 16:25:29 +08:00
c56a4667ae update 1.1.25 2024-03-13 02:26:45 +08:00
da2d233cee update 1.1.25 2024-03-13 01:54:23 +08:00
c7873052f2 update 1.0.22 2024-01-23 03:07:14 +08:00
77cdb14ea5 update sdk version 2024-01-23 03:06:45 +08:00
3eaf8bc789 update 21 2023-12-11 21:14:05 +08:00
950569ee05 1.0.20 2023-11-24 16:16:55 +08:00
1da26e1d74 update sdk version 2023-11-24 16:10:52 +08:00
caf057bb97 1.0.19 2023-11-19 16:21:55 +08:00
41f75ad3d0 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	Assets/package.json
2023-11-19 16:20:53 +08:00
c07a7e5f4a 1.0.18 2023-11-19 16:20:19 +08:00
120d3315fc 1.0.17 2023-11-07 18:54:01 +08:00
5a24a3292c 1.0.16 2023-10-19 18:00:10 +08:00
9a8096f347 版本号更新 1.0.15 2023-10-19 15:49:37 +08:00
0f760ca1a5 update core 2023-10-19 15:45:11 +08:00
4ec2560f30 升级sdk
gromore => 5.6.1.0
Android => 5.2.72
2023-10-19 15:31:19 +08:00
Foldcc_Book
1d22a3dae0 1.0.12 2023-10-12 05:42:18 +08:00
Foldcc_Book
75730fb783 1.0.11 2023-10-12 05:20:31 +08:00
Foldcc_Book
38c9cabad2 1.0.10 2023-10-12 04:08:33 +08:00
f8a4ac18c1 版本号更新 1.0.10 2023-09-25 14:14:20 +08:00
c6bf3ec373 更新sdk Gromore 4.3.0.3 => 5.6.0.8 2023-09-25 14:13:13 +08:00
39014e1de3 1.0.9 2023-09-14 14:20:26 +08:00
97674a4b16 update package.json 2023-09-04 17:02:02 +08:00
a248437870 update core 2023-09-04 16:57:46 +08:00
c2c8dea87d update core 2023-04-04 18:37:45 +08:00
1e04999628 update core 2023-04-04 18:36:47 +08:00
2cabb0e4e8 update core 2023-04-04 18:35:39 +08:00
874b5edf93 update core 2023-04-04 18:34:20 +08:00
49a35b1b6c update core 2023-04-04 18:33:51 +08:00
365 changed files with 6858 additions and 2307 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 687c8129e7770fe47aa2bdceaab14b6b
guid: 0b1601c425ae3b24e9764462dbbe5359
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,3 +0,0 @@
{
"name": "AnyThinkAds"
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 91a7a1e184c2641f79c95f363b8872d2
guid: ae70ff20f73a04e91b4e6bb12d7adc69
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -10,18 +10,23 @@ namespace AnyThinkAds.Api
{
public String placementId { get; }
public ATCallbackInfo callbackInfo { get; }
public bool isTimeout { get; }
public ATAdEventArgs(String id)
{
placementId = id;
callbackInfo = new ATCallbackInfo("");
}
public bool isDeeplinkSucceed { get; }
public ATAdEventArgs(String id, String callbackJson)
public ATAdEventArgs(string id, string callbackJson = "", bool timeout = false, bool isDeeplinkSucceess = false)
{
placementId = id;
callbackInfo = new ATCallbackInfo(callbackJson);
isTimeout = timeout;
isDeeplinkSucceed = isDeeplinkSucceess;
}
// public ATAdEventArgs(String id, String callbackJson)
// {
// placementId = id;
// callbackInfo = new ATCallbackInfo(callbackJson);
// }
}
public class ATAdErrorEventArgs : ATAdEventArgs
@@ -29,14 +34,14 @@ namespace AnyThinkAds.Api
public String errorMessage { get; }
public String errorCode { get; }
public ATAdErrorEventArgs(String placementId, String message, String code)
public ATAdErrorEventArgs(String placementId, String code, String message)
: base(placementId)
{
errorMessage = message;
errorCode = code;
}
public ATAdErrorEventArgs(String placementId, String callbackJson, String message, String code)
public ATAdErrorEventArgs(String placementId, String callbackJson, String code, String message)
: base(placementId, callbackJson)
{
errorMessage = message;
@@ -191,4 +196,23 @@ namespace AnyThinkAds.Api
event EventHandler<ATAdEventArgs> onPlayAgainReward;
}
public interface IATSplashEvents : IHCommonEvents
{
// called when the ad is shown
event EventHandler<ATAdEventArgs> onAdShowEvent;
// called if the ad has failed to be shown
event EventHandler<ATAdErrorEventArgs> onAdShowFailureEvent;
// called when the ad is closed
event EventHandler<ATAdEventArgs> onAdCloseEvent;
// called when an user has clicked an ad
event EventHandler<ATAdEventArgs> onAdClickEvent;
event EventHandler<ATAdEventArgs> onAdLoadTimeoutEvent;
event EventHandler<ATAdEventArgs> onDeeplinkEvent;
event EventHandler<ATAdEventArgs> onDownloadConfirmEvent;
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 219a4269ecae84c4e9d5b84de8b992de
guid: c75a10c31aaa348b4a030c4caabc60bd
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c8137f9ecda484f4f82280927f6cc6d3
guid: 002e19684018e4c0287914f3970da311
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 82a2859cc834c4a2f92c6497ca4ffa5f
guid: b9db3427a8881406f9b7da625247c0e4
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AnyThinkAds.ThirdParty.LitJson;
@@ -34,6 +34,10 @@ namespace AnyThinkAds.Api
public readonly string sub_channel;
public readonly string channel;
public readonly Dictionary<string, object> custom_rule;
public readonly Dictionary<string, object> ext_info;
public readonly Dictionary<string, object> user_load_extra_data;
public readonly int abtest_id;
public readonly string reward_custom_data;
@@ -72,15 +76,21 @@ namespace AnyThinkAds.Api
network_placement_id = jsonData.ContainsKey("network_placement_id") ? (string)jsonData["network_placement_id"] : "";
ecpm_level = int.Parse(jsonData.ContainsKey("ecpm_level") ? jsonData["ecpm_level"].ToString() : "0");
abtest_id = int.Parse(jsonData.ContainsKey("abtest_id") ? jsonData["abtest_id"].ToString() : "0");
segment_id = int.Parse(jsonData.ContainsKey("segment_id") ? jsonData["segment_id"].ToString() : "0");
scenario_id = jsonData.ContainsKey("scenario_id") ? (string)jsonData["scenario_id"] : "";// RewardVideo & Interstitial
if (jsonData.ContainsKey("user_load_extra_data")) {
user_load_extra_data = JsonMapper.ToObject<Dictionary<string, object>>(jsonData["user_load_extra_data"].ToJson());
}
scenario_reward_name = jsonData.ContainsKey("scenario_reward_name") ? (string)jsonData["scenario_reward_name"] : "";
scenario_reward_number = int.Parse(jsonData.ContainsKey("scenario_reward_number") ? jsonData["scenario_reward_number"].ToString() : "0");
channel = jsonData.ContainsKey("channel") ? (string)jsonData["channel"] : "";
sub_channel = jsonData.ContainsKey("sub_channel") ? (string)jsonData["sub_channel"] : "";
custom_rule = jsonData.ContainsKey("custom_rule") ? JsonMapper.ToObject<Dictionary<string, object>>(jsonData["custom_rule"].ToJson()) : null;
ext_info = jsonData.ContainsKey("ext_info") ? JsonMapper.ToObject<Dictionary<string, object>>(jsonData["ext_info"].ToJson()) : null;
reward_custom_data = jsonData.ContainsKey("reward_custom_data") ? (string)jsonData["reward_custom_data"] : "";
@@ -130,12 +140,15 @@ namespace AnyThinkAds.Api
dataDictionary.Add("ecpm_level", ecpm_level);
dataDictionary.Add("segment_id", segment_id);
dataDictionary.Add("scenario_id", scenario_id);
dataDictionary.Add("user_load_extra_data", user_load_extra_data);
dataDictionary.Add("scenario_reward_name", scenario_reward_name);
dataDictionary.Add("scenario_reward_number", scenario_reward_number);
dataDictionary.Add("abtest_id", abtest_id);
dataDictionary.Add("sub_channel", sub_channel);
dataDictionary.Add("channel", channel);
dataDictionary.Add("custom_rule", custom_rule);
dataDictionary.Add("ext_info", ext_info);
dataDictionary.Add("reward_custom_data", reward_custom_data);
return dataDictionary;

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d71af2c579e014d268a0dfa493b7b42a
guid: 70dd039af17f84740841c936f5021082
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 96cb1512452b44892ab41a110737bc6f
guid: 357112570f17745ec8287700969b5857
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c23fcd22e05664d73ba39e69a58fdfdb
guid: f397e1571653b4f909de35ecd27e25a6
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 88edb880a748a4df7be4481415e44907
guid: baba4e8729e3d4e99bb742620b957127
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9b93dd6d343c0473193c776c1ba89ec8
guid: 401f3f72eaa384ecebf7fb06d380c9f3
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d2b539b7c0e104683ad9789e63c426c1
guid: 987cbef3a8a42464e9fe32624f08ec82
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5ec858a9445e344c6ae02b731012d297
guid: f5a6614e3827f44edb1c7a5412cf6863
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 220e014333c6840fc89f951639f5deba
guid: 9dddccc0f4402419eba44458d9075782
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a2c5ed4e8516545f0838dddae9200f2f
guid: 52d5dd611a7ba4e8ca6c688ad4987bb5
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -22,6 +22,7 @@ namespace AnyThinkAds.Api
private string adLogoKey = "adLogo";
private string ctaButtonKey = "cta";
private string dislikeButtonKey = "dislike";
private string elementsKey = "elements";
public string toJSON()
{
@@ -85,6 +86,14 @@ namespace AnyThinkAds.Api
builder.Append("\"").Append(dislikeButtonKey).Append("\"");
builder.Append(":");
builder.Append(JsonUtility.ToJson(config.dislikeButtonProperty));
builder.Append(",");
}
if (config.elementsProperty != null)
{
builder.Append("\"").Append(elementsKey).Append("\"");
builder.Append(":");
builder.Append(JsonUtility.ToJson(config.elementsProperty));
}
string temp = builder.ToString();

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 863e49baa0bfb4c899f6d1591f126aeb
guid: 6f645156118af4f77934a7b79743cb00
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c4cf0c99e1e574b3aa6d4a1a46daf9da
guid: eaad21e4abd854be3a34341ea0118fa7
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3f89a8b127b7346a7a27be7bf6cdc2a1
guid: 884e06e3cad554df0af477f0211fd97e
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -14,5 +14,6 @@ namespace AnyThinkAds.Api
public ATNativeItemProperty adLogoProperty;
public ATNativeItemProperty ctaButtonProperty;
public ATNativeItemProperty dislikeButtonProperty;
public ATNativeItemProperty elementsProperty;
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7472931a01bd34107842d9baa5edf262
guid: 3f2571c1daafd47a4a9b39d148e67184
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e4ce4b4690b764fcd9a5bdba6c7a48b8
guid: dae05acc2ea674329944023bb798f046
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8ce958c2c0a294f85981fc0d7efd277e
guid: 911d845f67e694a038cc2d85c86329d6
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5feccd0a003ab4defba25cd4e3f9e870
guid: 07584f2ac39714cafbf91dc3f7199f37
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a1e0f021a24cc491eb4f054d576982f7
guid: 88a35eb670a0e4da2978eda939b8d14d
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3c71cf6d83ff4406db7ed141066a54d3
guid: 167fb755fd59444ef864ebabd898ff7b
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -17,6 +17,12 @@ namespace AnyThinkAds.Api
void didGetUserLocation(int location);
}
public interface ATConsentDismissListener
{
void onConsentDismiss();
}
public interface ATGetAreaListener
{
void onArea(string area);
@@ -82,6 +88,11 @@ namespace AnyThinkAds.Api
client.initSDK(appId, appKey, listener);
}
public static void showDebuggerUI()
{
client.showDebuggerUI();
}
public static void setGDPRLevel(int level)
{
client.setGDPRLevel(level);
@@ -125,9 +136,15 @@ namespace AnyThinkAds.Api
client.showGDPRAuth();
}
public static void showGDPRConsentDialog(ATConsentDismissListener listener)
{
client.showGDPRConsentDialog(listener);
}
public static void setLogDebug(bool isDebug)
{
client.setLogDebug(isDebug);
ATLogger.IsDebug = isDebug;
}
public static void addNetworkGDPRInfo(int networkType, Dictionary<string,object> dictionary)

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 17ae30f8263a149fc8eba30dad68d0f0
guid: 01222258a75e14c76a2b7803c24cd0ee
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 57b3ce41b10cf46cbb2e5a082691be6d
guid: 8c85ccef2c75348d2a824173f5c6641c
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,73 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Reflection;
using System;
using AnyThinkAds.Common;
using AnyThinkAds.ThirdParty.LitJson;
namespace AnyThinkAds.Api
{
public class ATSplashAdLocalExtra
{
//Only for GDT (true: open download dialog, false: download directly)
public static readonly string kATSplashAdClickConfirmStatus = "ad_click_confirm_status";
}
public class ATSplashAd
{
private static readonly ATSplashAd instance = new ATSplashAd();
public IATSplashAdClient client;
private ATSplashAd()
{
client = AnyThinkAds.ATAdsClientFactory.BuildSplashAdClient();
}
public static ATSplashAd Instance
{
get
{
return instance;
}
}
public void loadSplashAd(string placementId, Dictionary<string, object> pairs, int fetchAdTimeout = 5000, string defaultAdSourceConfig = "")
{
#if UNITY_ANDROID
client.loadSplashAd(placementId, fetchAdTimeout, defaultAdSourceConfig, JsonMapper.ToJson(pairs));
#elif (UNITY_5 && UNITY_IOS) || UNITY_IPHONE
//TODO iOS的开屏加载
pairs.Add("tolerate_timeout", fetchAdTimeout);
pairs.Add("default_adSource_config", defaultAdSourceConfig);
client.loadSplashAd(placementId, fetchAdTimeout, defaultAdSourceConfig, JsonMapper.ToJson(pairs));
#endif
}
public void showSplashAd(string placementId, Dictionary<string, object> pairs)
{
client.showSplashAd(placementId, JsonMapper.ToJson(pairs));
}
public bool hasSplashAdReady(string placementId)
{
return client.hasSplashAdReady(placementId);
}
public string checkAdStatus(string placementId)
{
return client.checkAdStatus(placementId);
}
public string getValidAdCaches(string placementId)
{
return client.getValidAdCaches(placementId);
}
public void entryScenarioWithPlacementID(string placementId, string scenarioID)
{
client.entryScenarioWithPlacementID(placementId, scenarioID);
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fa8c0cec5bff04aeca5dc28fe21ffc89
guid: c5196f0fee3834f3f9a1728ed2f57b13
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///summary
///注意对于Android来说所有回调方法均不在Unity的主线程
///sumary
namespace AnyThinkAds.Api
{
public interface ATSplashAdListener
{
void onSplashAdLoad(string unitId, bool isTimeout);
void onSplashAdLoadTimeOut(string unitId);
void onSplashAdLoadFailed(string unitId, string code, string msg);
void onSplashAdShow(string unitId, ATCallbackInfo callbackInfo);
void onSplashAdClick(string unitId, ATCallbackInfo callbackInfo);
void onSplashAdDismiss(string unitId, ATCallbackInfo callbackInfo);
void onSplashAdDeeplinkCallback(string unitId, ATCallbackInfo callbackInfo, bool isSuccess);
void onSplashAdDownloadConfirm(string unitId, ATCallbackInfo callbackInfo);
void startLoadingADSource(string placementId, ATCallbackInfo callbackInfo);
void finishLoadingADSource(string placementId, ATCallbackInfo callbackInfo);
void failToLoadADSource(string placementId,ATCallbackInfo callbackInfo,string code, string message);
void startBiddingADSource(string placementId, ATCallbackInfo callbackInfo);
void finishBiddingADSource(string placementId, ATCallbackInfo callbackInfo);
void failBiddingADSource(string placementId,ATCallbackInfo callbackInfo,string code, string message);
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1123279c1b9244e11aaf04a78f2550b4
guid: d16e9791f346240b58344d4d6372b4fc
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1e8456848ebbf4b988a66e831999e0b7
guid: 9ded34532e9f04a199738e82a8f7ca89
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,95 @@
using System;
using UnityEngine;
namespace AnyThinkAds.Common
{
public class ATLogger
{
private static bool isDebug = false;
public static bool IsDebug
{
get {
return isDebug;
}
set {
isDebug = value;
}
}
// public static void Log(string msg)
// {
// Log(msg, null);
// }
// public static void Log(string format, object obj)
// {
// Log(format, obj, null);
// }
public static void Log(string format, object obj1 = null, object obj2 = null)
{
if (!isDebug) {
return;
}
try {
if (obj1 == null && obj2 == null)
{
Debug.Log(format);
}
else if (obj1 != null && obj2 == null)
{
Debug.Log(String.Format(format, obj1));
}
else if (obj1 == null && obj2 != null)
{
Debug.Log(String.Format(format, obj2));
}
else {
Debug.Log(String.Format(format, obj1, obj2));
}
} catch(Exception e)
{
Debug.LogError("Log error: " + e.Message);
}
}
// public static void LogError(string msg)
// {
// LogError(msg, null);
// }
// public static void LogError(string format, object obj)
// {
// LogError(format, obj, null);
// }
public static void LogError(string format, object obj1 = null, object obj2 = null)
{
if (!isDebug) {
return;
}
try {
if (obj1 == null && obj2 == null)
{
Debug.LogError(format);
}
else if (obj1 != null && obj2 == null)
{
Debug.LogError(String.Format(format, obj1));
}
else if (obj1 == null && obj2 != null)
{
Debug.LogError(String.Format(format, obj2));
}
else {
Debug.LogError(String.Format(format, obj1, obj2));
}
} catch(Exception e)
{
Debug.LogError("Log error: " + e.Message);
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4655aa99cf2c1475eb148561285c1d0e
guid: cb4b69d48493d4554a5c5fa5c5339f39
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 33f1ceabaff3f4892a39bf63a74352b7
guid: b50fc48df837a46fe8cbe86f4eae7ffd
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9fd119e79e8154f6e885622336dd50f7
guid: cee7c1bbb0ef941d188379c77d780457
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e2d102c3a980f472fa20811ed609d085
guid: c27b85cb143584d0ba8801179cbaea43
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f2275de4a621e46b2b6a157d2c35ed7e
guid: a30e2e904b2b74a0eb28f19bd328f5b7
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 87ae11b5cac0f4dbbb559cfed9dc531b
guid: 9be0d831a3fc3460b8f295348f4d5a1c
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1c8f90439b6de4b25b7fc5e8d62ec895
guid: 9eb74e818b581419b867c18f564accfa
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -9,9 +9,11 @@ namespace AnyThinkAds.Common
{
void initSDK(string appId, string appKey);
void initSDK(string appId, string appKey, ATSDKInitListener listener);
void showDebuggerUI();
void getUserLocation(ATGetUserLocationListener listener);
void setGDPRLevel(int level);
void showGDPRAuth();
void showGDPRConsentDialog(ATConsentDismissListener listener);
void addNetworkGDPRInfo(int networkType, string mapJson);
void setChannel(string channel);
void setSubChannel(string subchannel);

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 833dc348e2c4648f08a4791990328b24
guid: 43b209adee5c64bce84d3188ebc0f0b1
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AnyThinkAds.Api;
namespace AnyThinkAds.Common
{
public interface IATSplashAdClient : IATSplashEvents
{
// void loadSplashAd(string placementId, string mapJson);
void loadSplashAd(string placementId, int fetchAdTimeout, string defaultAdSourceConfig, string mapJson);
void setListener(ATSplashAdListener listener);
bool hasSplashAdReady(string placementId);
string checkAdStatus(string placementId);
void showSplashAd(string placementId, string mapJson);
string getValidAdCaches(string placementId);
void entryScenarioWithPlacementID(string placementId, string scenarioID);
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 653ebf512c3af46698bdf323cfb74f53
guid: 4f7a8598d743e4ba882400e6f205c5dc
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8cf0d327cc346430caa11f4acd1f815e
guid: bbfb513f68b154b0ebfa36897c6e4401
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -122,6 +122,21 @@ namespace AnyThinkAds
return new UnityDownloadClient();
}
public static IATSplashAdClient BuildSplashAdClient()
{
#if UNITY_EDITOR
// Testing UNITY_EDITOR first because the editor also responds to the currently
// selected platform.
#elif UNITY_ANDROID
return new AnyThinkAds.Android.ATSplashAdClient();
#elif (UNITY_5 && UNITY_IOS) || UNITY_IPHONE
//TODO iOS返回开屏client
return new AnyThinkAds.iOS.ATSplashAdClient();
#else
#endif
return new UnitySplashClient();
}
}
class UnitySDKAPIClient:IATSDKAPIClient
@@ -131,6 +146,7 @@ namespace AnyThinkAds
public void getUserLocation(ATGetUserLocationListener listener){ }
public void setGDPRLevel(int level){ }
public void showGDPRAuth(){ }
public void showGDPRConsentDialog(ATConsentDismissListener listener){ }
public void addNetworkGDPRInfo(int networkType, string mapJson){ }
public void setChannel(string channel){ }
public void setSubChannel(string subchannel){ }
@@ -146,7 +162,7 @@ namespace AnyThinkAds
public void getArea(ATGetAreaListener listener) { }
public void setWXStatus(bool install) { }
public void setLocation(double longitude, double latitude) { }
public void showDebuggerUI() {}
}
class UnityBannerClient:IATBannerAdClient
@@ -425,4 +441,52 @@ namespace AnyThinkAds
Debug.Log("Must run on Android platform");
}
}
class UnitySplashClient : IATSplashAdClient
{
public event EventHandler<ATAdEventArgs> onAdLoadTimeoutEvent;
public event EventHandler<ATAdEventArgs> onDeeplinkEvent;
public event EventHandler<ATAdEventArgs> onDownloadConfirmEvent;
public event EventHandler<ATAdEventArgs> onAdShowEvent;
public event EventHandler<ATAdEventArgs> onAdCloseEvent;
// called if the ad has failed to be shown
public event EventHandler<ATAdErrorEventArgs> onAdShowFailureEvent;
public event EventHandler<ATAdEventArgs> onAdLoadEvent;
public event EventHandler<ATAdErrorEventArgs> onAdLoadFailureEvent;
public event EventHandler<ATAdEventArgs> onAdClickEvent;
public event EventHandler<ATAdEventArgs> onRewardEvent;
public event EventHandler<ATAdEventArgs> onAdSourceAttemptEvent;
public event EventHandler<ATAdEventArgs> onAdSourceFilledEvent;
public event EventHandler<ATAdErrorEventArgs> onAdSourceLoadFailureEvent;
public event EventHandler<ATAdEventArgs> onAdSourceBiddingAttemptEvent;
public event EventHandler<ATAdEventArgs> onAdSourceBiddingFilledEvent;
public event EventHandler<ATAdErrorEventArgs> onAdSourceBiddingFailureEvent;
public event EventHandler<ATAdEventArgs> onPlayAgainStart;
public event EventHandler<ATAdEventArgs> onPlayAgainEnd;
public event EventHandler<ATAdErrorEventArgs> onPlayAgainFailure;
public event EventHandler<ATAdEventArgs> onPlayAgainClick;
public event EventHandler<ATAdEventArgs> onPlayAgainReward;
// public void loadSplashAd(string placementId, string mapJson) {}
public void loadSplashAd(string placementId, int fetchAdTimeout, string defaultAdSourceConfig, string mapJson) {}
public void setListener(ATSplashAdListener listener) {}
public bool hasSplashAdReady(string placementId) {
return false;
}
public string checkAdStatus(string placementId) {
return "";
}
public void showSplashAd(string placementId, string mapJson) {}
/***
* 获取所有可用缓存广告
*/
public string getValidAdCaches(string placementId) {
return "";
}
public void entryScenarioWithPlacementID(string placementId, string scenarioID) {}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7cfc618d1f344493aa2c430c0ff5e8c3
guid: cbcf690f571ee45478aae3f6ef73b46d
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3e06b6a7bea414435806d944b50c9238
guid: b0a6ebc6626634f558dc5c05feb59058
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: eadc3c4bb3f0f4260b1a97ff1d4c1cf7
guid: 80e0331161ce748b684c7b3465890805
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -232,7 +232,7 @@ namespace AnyThinkAds.Android
public void onBannerFailed(string placementId,string code, string error)
{
Debug.Log("onBannerFailed...unity3d.");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
//广告点击
@@ -265,7 +265,7 @@ namespace AnyThinkAds.Android
public void onBannerAutoRefreshFail(string placementId, string code, string msg)
{
Debug.Log("onBannerAutoRefreshFail...unity3d.");
onAdAutoRefreshFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, msg, code));
onAdAutoRefreshFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, msg));
}
// Adsource Listener

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 92e8455090a784b949bd67df1b3fc530
guid: 8e468840b1c864035bf7429b6f79c60f
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 10ff201c4f54b4fce8f22229037070c4
guid: 09704d4a9a249454ca28515f8dfd3a07
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AnyThinkAds.Api;
namespace AnyThinkAds.Android
{
public class ATGDPRConsentDismissListener : AndroidJavaProxy
{
ATConsentDismissListener mListener;
public ATGDPRConsentDismissListener(ATConsentDismissListener listener): base("com.anythink.unitybridge.sdkinit.SDKConsentDismissListener")
{
mListener = listener;
}
public void onConsentDismiss()
{
if (mListener != null)
{
mListener.onConsentDismiss();
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6e5096ebc4e1742698452ec60f74b58b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -213,7 +213,7 @@ namespace AnyThinkAds.Android
public void onInterstitialAdLoadFail(string placementId,string code, string error)
{
Debug.Log("onInterstitialAdFailed...unity3d.");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
//开始播放
@@ -234,13 +234,13 @@ namespace AnyThinkAds.Android
public void onInterstitialAdVideoError(string placementId,string code, string error)
{
Debug.Log("onInterstitialAdPlayFailed...unity3d.");
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
//展示失败
public void OnInterstitialAdFailedToShow(string placementID) {
Debug.Log("Unity: ATInterstitialAdClient::OnInterstitialAdFailedToShow()");
onAdShowFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, "Failed to show video ad", "-1"));
onAdShowFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, "-1", "Failed to show video ad"));
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3a5faa4e142aa43dbba381b1cef1eb7b
guid: c6f71db9f63744a59be5df53303a706b
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3f9a8f81e02c94851a16c544a4f2bca9
guid: ddf8d9d3b1ebb4f21b2c2c3e02b5845e
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7739e5e9b404f44fc8d2079f8f8a5423
guid: f0ac44483a8564e5d9428ed8267d913b
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3e7ad1dcac86142608df799cdeefe124
guid: dd1ce5cf512924c57846d8f3f379fcf8
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: bc7832ca770c84f96ac1401368abb7dc
guid: cd0149348eca7449f8cbc48ab9e2498c
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -176,7 +176,7 @@ namespace AnyThinkAds.Android
public void onRewardedVideoAdFailed(string placementId,string code, string error)
{
Debug.Log("onRewardedVideoAdFailed...unity3d.");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
@@ -197,7 +197,7 @@ namespace AnyThinkAds.Android
public void onRewardedVideoAdPlayFailed(string placementId,string code, string error)
{
Debug.Log("onRewardedVideoAdPlayFailed...unity3d.");
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
public void onRewardedVideoAdClosed(string placementId,bool isRewarded, string callbackJson)
@@ -237,7 +237,7 @@ namespace AnyThinkAds.Android
public void onRewardedVideoAdAgainPlayFailed(string placementId, string code, string error)
{
Debug.Log("onRewardedVideoAdAgainPlayFailed...unity3d.");
onPlayAgainFailure?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onPlayAgainFailure?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
@@ -271,7 +271,7 @@ namespace AnyThinkAds.Android
public void onAdSourceBiddingFail(string placementId, string callbackJson, string code, string error)
{
Debug.Log("onAdSourceBiddingFail...unity3d." + placementId + "," + code + "," + error + "," + callbackJson);
onAdSourceBiddingFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdSourceBiddingFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
public void onAdSourceAttempt(string placementId, string callbackJson)
@@ -289,7 +289,7 @@ namespace AnyThinkAds.Android
public void onAdSourceLoadFail(string placementId, string callbackJson, string code, string error)
{
Debug.Log("onAdSourceLoadFail...unity3d." + placementId + "," + code + "," + error + "," + callbackJson);
onAdSourceLoadFailureEvent?.Invoke(this,new ATAdErrorEventArgs(placementId, error, code));
onAdSourceLoadFailureEvent?.Invoke(this,new ATAdErrorEventArgs(placementId, code, error));
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f8d0bdf7098d34eb28d38fba39a47b0c
guid: 7c61d4a12a1bc4447a211961cc6867ac
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -85,6 +85,21 @@ namespace AnyThinkAds.Android
}
}
public void showGDPRConsentDialog(ATConsentDismissListener listener)
{
Debug.Log ("showGDPRConsentDialog....");
ATGDPRConsentDismissListener gdprConsentDismissListener = new ATGDPRConsentDismissListener(listener);
try{
if (this.sdkInitHelper != null) {
this.sdkInitHelper.Call ("showGDPRConsentDialog", gdprConsentDismissListener);
}
}catch(System.Exception e){
System.Console.WriteLine("Exception caught: {0}", e);
Debug.Log ("ATSDKAPIClient : error."+e.Message);
}
}
public void setChannel(string channel)
{
Debug.Log("setChannel....");
@@ -357,5 +372,19 @@ namespace AnyThinkAds.Android
}
}
public void showDebuggerUI() {
try
{
if (this.sdkInitHelper != null)
{
this.sdkInitHelper.Call("showDebuggerUI");
}
}
catch (System.Exception e)
{
System.Console.WriteLine("Exception caught: {0}", e);
Debug.Log("ATSDKAPIClient : error." + e.Message);
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 245e7a5e922934f43a6484d5f0189a91
guid: 574bd4316cdbf4b118c89ffa1e5f086d
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,237 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AnyThinkAds.Common;
using AnyThinkAds.Api;
using AnyThinkAds.ThirdParty.LitJson;
namespace AnyThinkAds.Android
{
public class ATSplashAdClient : AndroidJavaProxy, IATSplashAdClient
{
public event EventHandler<ATAdEventArgs> onAdLoadTimeoutEvent;
public event EventHandler<ATAdEventArgs> onDeeplinkEvent;
public event EventHandler<ATAdEventArgs> onDownloadConfirmEvent;
public event EventHandler<ATAdEventArgs> onAdLoadEvent;
public event EventHandler<ATAdErrorEventArgs> onAdLoadFailureEvent;
public event EventHandler<ATAdEventArgs> onAdShowEvent;
public event EventHandler<ATAdErrorEventArgs> onAdShowFailureEvent;
public event EventHandler<ATAdEventArgs> onAdCloseEvent;
public event EventHandler<ATAdEventArgs> onAdClickEvent;
public event EventHandler<ATAdEventArgs> onAdSourceAttemptEvent;
public event EventHandler<ATAdEventArgs> onAdSourceFilledEvent;
public event EventHandler<ATAdErrorEventArgs> onAdSourceLoadFailureEvent;
public event EventHandler<ATAdEventArgs> onAdSourceBiddingAttemptEvent;
public event EventHandler<ATAdEventArgs> onAdSourceBiddingFilledEvent;
public event EventHandler<ATAdErrorEventArgs> onAdSourceBiddingFailureEvent;
private Dictionary<string, AndroidJavaObject> splashHelperMap = new Dictionary<string, AndroidJavaObject>();
private ATSplashAdListener splashAdListener;
private int fetchAdTimeout = 0;
private string defaultAdSourceConfig;
public ATSplashAdClient() : base("com.anythink.unitybridge.splash.SplashListener")
{
}
private AndroidJavaObject getSplashHelper(string placementId)
{
try
{
if (!splashHelperMap.ContainsKey(placementId))
{
AndroidJavaObject splashHelper = new AndroidJavaObject(
"com.anythink.unitybridge.splash.SplashHelper", this);
splashHelper.Call("initSplash", placementId, fetchAdTimeout, defaultAdSourceConfig);
splashHelperMap.Add(placementId, splashHelper);
return splashHelper;
} else {
return splashHelperMap[placementId];
}
}
catch(Exception e)
{
ATLogger.LogError("getSplashHelper() >>> error: {0}", e.Message);
}
return null;
}
public void loadSplashAd(string placementId, int fetchAdTimeout = 0, string defaultAdSourceConfig = "", string mapJson = "")
{
this.fetchAdTimeout = fetchAdTimeout;
this.defaultAdSourceConfig = defaultAdSourceConfig;
try
{
ATLogger.Log("loadSplashAd() >>> placementId: {0}", placementId);
getSplashHelper(placementId).Call("loadAd", mapJson);
}
catch (System.Exception e)
{
ATLogger.LogError("loadSplashAd() >>> error: {0}", e.Message);
}
}
public void setListener(ATSplashAdListener listener)
{
this.splashAdListener = listener;
}
public bool hasSplashAdReady(string placementId)
{
bool isAdReady = false;
ATLogger.Log("hasSplashAdReady() >>> placementId: {0}", placementId);
try
{
isAdReady = getSplashHelper(placementId).Call<bool>("isAdReady");
}
catch(Exception e)
{
ATLogger.LogError("hasSplashAdReady() >>> error: {0}", e.Message);
}
return isAdReady;
}
public string checkAdStatus(string placementId)
{
string adStatusJsonString = "";
ATLogger.Log("checkAdStatus() >>> placementId: {0}", placementId);
try
{
adStatusJsonString = getSplashHelper(placementId).Call<string>("checkAdStatus");
}
catch (System.Exception e)
{
ATLogger.LogError("checkAdStatus() >>> error: {0}", e.Message);
}
return adStatusJsonString;
}
public void showSplashAd(string placementId, string mapJson)
{
ATLogger.Log("showSplashAd() >>> placementId: {0}, mapJson: {1}", placementId, mapJson);
try
{
getSplashHelper(placementId).Call("showAd", mapJson);
}
catch(Exception e)
{
ATLogger.LogError("showSplashAd() >>> error: {0}", e.Message);
}
}
public string getValidAdCaches(string placementId)
{
ATLogger.Log("getValidAdCaches() >>> placementId: {0}", placementId);
string adString = "";
try
{
adString = getSplashHelper(placementId).Call<string>("getValidAdCaches");
}
catch(Exception e)
{
ATLogger.LogError("getValidAdCaches() >>> error: {0}", e.Message);
}
return adString;
}
public void entryScenarioWithPlacementID(string placementId, string scenarioID)
{
ATLogger.Log("entryScenarioWithPlacementID() >>> placementId: {0}, scenarioID: {1}", placementId, scenarioID);
try
{
getSplashHelper(placementId).Call<string>("entryAdScenario", scenarioID);
}
catch(Exception e)
{
ATLogger.LogError("entryScenarioWithPlacementID() >>> error: {0}", e.Message);
}
}
public void onSplashAdLoad(String unitId, bool isTimeout)
{
onAdLoadEvent?.Invoke(this, new ATAdEventArgs(unitId, "", isTimeout));
}
public void onSplashAdLoadTimeOut(String unitId)
{
onAdLoadTimeoutEvent?.Invoke(this, new ATAdEventArgs(unitId, "", true));
}
public void onSplashAdLoadFailed(String unitId, String code, String msg)
{
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(unitId, code, msg));
}
public void onSplashAdShow(String unitId, String callbackJson)
{
onAdShowEvent?.Invoke(this, new ATAdEventArgs(unitId, callbackJson));
}
public void onSplashAdClick(String unitId, String callbackJson)
{
onAdClickEvent?.Invoke(this, new ATAdEventArgs(unitId, callbackJson));
}
public void onSplashAdDismiss(String unitId, String callbackJson)
{
onAdClickEvent?.Invoke(this, new ATAdEventArgs(unitId, callbackJson));
}
public void onSplashAdDeeplinkCallback(String unitId, String callbackJson, bool isSuccess)
{
onDeeplinkEvent?.Invoke(this, new ATAdEventArgs(unitId, callbackJson, false, isSuccess));
}
public void onSplashAdDownloadConfirm(String unitId, String callbackJson)
{
onDownloadConfirmEvent?.Invoke(this, new ATAdEventArgs(unitId, callbackJson));
}
// Adsource Listener
public void onAdSourceBiddingAttempt(string placementId, string callbackJson)
{
ATLogger.Log("onAdSourceBiddingAttempt...unity3d." + placementId + "," + callbackJson);
onAdSourceBiddingAttemptEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void onAdSourceBiddingFilled(string placementId, string callbackJson)
{
ATLogger.Log("onAdSourceBiddingFilled...unity3d." + placementId + "," + callbackJson);
onAdSourceBiddingFilledEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void onAdSourceBiddingFail(string placementId, string callbackJson, string code, string error)
{
ATLogger.Log("onAdSourceBiddingFail...unity3d." + placementId + "," + code + "," + error + "," + callbackJson);
onAdSourceBiddingFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, callbackJson, code, error));
}
public void onAdSourceAttempt(string placementId, string callbackJson)
{
ATLogger.Log("onAdSourceAttempt...unity3d." + placementId + "," + callbackJson);
onAdSourceAttemptEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void onAdSourceLoadFilled(string placementId, string callbackJson)
{
ATLogger.Log("onAdSourceLoadFilled...unity3d." + placementId + "," + callbackJson);
onAdSourceFilledEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void onAdSourceLoadFail(string placementId, string callbackJson, string code, string error)
{
ATLogger.Log("onAdSourceLoadFail...unity3d." + placementId + "," + code + "," + error + "," + callbackJson);
onAdSourceLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, callbackJson, code, error));
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 078be7445a3c3461a811882dd62c1602
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 24acb4405bd40449f82a6ea03b5824c7
guid: da68e624ffa1041e889b8d3eb9187af2
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -103,7 +103,7 @@ namespace AnyThinkAds.iOS {
public void OnBannerAdLoadFail(string placementId, string code, string message) {
Debug.Log("Unity: HBBannerAdWrapper::OnBannerAdLoadFail()");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, message, code));
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, message));
}
public void OnBannerAdImpress(string placementId, string callbackJson) {
@@ -123,7 +123,7 @@ namespace AnyThinkAds.iOS {
public void OnBannerAdAutoRefreshFail(string placementId, string code, string message) {
Debug.Log("Unity: HBBannerAdWrapper::OnBannerAdAutoRefreshFail()");
onAdAutoRefreshFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, message, code));
onAdAutoRefreshFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, message));
}
public void OnBannerAdClose(string placementId) {

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fc5aeee813f974653b6b9947425ec275
guid: e574a07ae76c342a8bdc1dea719b9ad9
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -82,12 +82,12 @@ namespace AnyThinkAds.iOS {
public void OnInterstitialAdLoadFailure(string placementID, string code, string error) {
Debug.Log("onInterstitialAdFailed...unity3d.");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, error, code));
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, code, error));
}
public void OnInterstitialAdVideoPlayFailure(string placementID, string code, string error) {
Debug.Log("Unity: ATInterstitialAdClient::OnInterstitialAdVideoPlayFailure()");
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, error, code));
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, code, error));
}
public void OnInterstitialAdVideoPlayStart(string placementID, string callbackJson) {
@@ -107,7 +107,7 @@ namespace AnyThinkAds.iOS {
public void OnInterstitialAdFailedToShow(string placementID) {
Debug.Log("Unity: ATInterstitialAdClient::OnInterstitialAdFailedToShow()");
onAdShowFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, "Failed to show video ad", "-1"));
onAdShowFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, "-1", "Failed to show video ad"));
}
public void OnInterstitialAdClick(string placementID, string callbackJson) {

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b16f7157dd7a84fbfa1a693d79e37e3e
guid: 83d182fe17f2f414987f2538906c20e5
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3c3f95e41f96d41ff9911a95ecbbabbb
guid: d6530769c410e488cb8d3a16a70551fb
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 56333631c280443b98fed2a60d160ec6
guid: cf2ded1709e664d5a8b2f75a9e16dca4
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -188,7 +188,7 @@ namespace AnyThinkAds.iOS {
public void onRewardedVideoAdFailed(string placementId, string code, string error) {
Debug.Log("Unity: ATRewardedVideoAdClient::onRewardedVideoAdFailed()");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
public void onRewardedVideoAdPlayStart(string placementId, string callbackJson) {
@@ -203,7 +203,7 @@ namespace AnyThinkAds.iOS {
public void onRewardedVideoAdPlayFailed(string placementId, string code, string error) {
Debug.Log("Unity: ATRewardedVideoAdClient::onRewardedVideoAdPlayFailed()");
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}
public void onRewardedVideoAdClosed(string placementId, bool isRewarded, string callbackJson) {
@@ -238,7 +238,7 @@ namespace AnyThinkAds.iOS {
public void onRewardedVideoAdAgainPlayFailed(string placementId, string code, string error)
{
Debug.Log("Unity: ATRewardedVideoAdClient::onRewardedVideoAdAgainPlayFailed()");
onPlayAgainFailure?.Invoke(this, new ATAdErrorEventArgs(placementId, error, code));
onPlayAgainFailure?.Invoke(this, new ATAdErrorEventArgs(placementId, code, error));
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d7cd2abf09bb54cdca25de4b6f4e4375
guid: b84fb181c2949404bb596489b45717c9
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -12,6 +12,8 @@ namespace AnyThinkAds.iOS {
static private ATGetUserLocationListener locationListener;
static private ATGetAreaListener areaListener;
static private ATConsentDismissListener umpListener;
public ATSDKAPIClient () {
Debug.Log("Unity:ATSDKAPIClient::ATSDKAPIClient()");
}
@@ -43,6 +45,13 @@ namespace AnyThinkAds.iOS {
return 0;
}
[MonoPInvokeCallback(typeof(Func<string, int>))]
static public int DidUMP(string location)
{
if (umpListener != null) { umpListener.onConsentDismiss(); }
return 0;
}
[MonoPInvokeCallback(typeof(Func<string, int>))]
static public int GetAreaInfo(string msg)
{
@@ -81,10 +90,17 @@ namespace AnyThinkAds.iOS {
public void showGDPRAuth() {
Debug.Log("Unity:ATSDKAPIClient::showGDPRAuth()");
ATManager.ShowGDPRAuthDialog();
// ATManager.showGDPRAuth();
}
public void setPurchaseFlag() {
public void showGDPRConsentDialog(ATConsentDismissListener listener)
{
Debug.Log("Unity:ATSDKAPIClient::showGDPRConsentDialog()");
ATSDKAPIClient.umpListener = listener;
ATManager.showGDPRConsentDialog(DidUMP);
}
public void setPurchaseFlag() {
ATManager.setPurchaseFlag();
}
@@ -177,5 +193,12 @@ namespace AnyThinkAds.iOS {
Debug.Log("Unity:ATSDKAPIClient::setLocation()");
ATManager.setLocation(longitude, latitude);
}
//iOS显示Debugger UI
public void showDebuggerUI()
{
Debug.Log("Unity:ATSDKAPIClient::showDebuggerUI()");
ATManager.showDebuggerUI();
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 91865ac680a7f418dbed624b52784e38
guid: b6985e2d8821a4acaaa03772b2679da3
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,233 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AnyThinkAds.Common;
using AnyThinkAds.Api;
using AnyThinkAds.ThirdParty.LitJson;
namespace AnyThinkAds.iOS {
public class ATSplashAdClient : IATSplashAdClient {
private ATSplashAdListener anyThinkListener;
public event EventHandler<ATAdEventArgs> onAdLoadEvent;
public event EventHandler<ATAdErrorEventArgs> onAdLoadFailureEvent;
public event EventHandler<ATAdEventArgs> onAdShowEvent;
public event EventHandler<ATAdErrorEventArgs> onAdShowFailureEvent;
public event EventHandler<ATAdEventArgs> onAdCloseEvent;
public event EventHandler<ATAdEventArgs> onAdClickEvent;
public event EventHandler<ATAdEventArgs> onAdVideoStartEvent;
public event EventHandler<ATAdErrorEventArgs> onAdVideoFailureEvent;
public event EventHandler<ATAdEventArgs> onAdVideoEndEvent;
public event EventHandler<ATAdEventArgs> onAdSourceAttemptEvent;
public event EventHandler<ATAdEventArgs> onAdSourceFilledEvent;
public event EventHandler<ATAdErrorEventArgs> onAdSourceLoadFailureEvent;
public event EventHandler<ATAdEventArgs> onAdSourceBiddingAttemptEvent;
public event EventHandler<ATAdEventArgs> onAdSourceBiddingFilledEvent;
public event EventHandler<ATAdErrorEventArgs> onAdSourceBiddingFailureEvent;
public event EventHandler<ATAdEventArgs> onAdLoadTimeoutEvent;
public event EventHandler<ATAdEventArgs> onDeeplinkEvent;
public event EventHandler<ATAdEventArgs> onDownloadConfirmEvent;
public void addsetting(string placementId,string json){
//todo...
}
public void setListener(ATSplashAdListener listener) {
Debug.Log("Unity: ATSplashAdAdClient::setListener()");
anyThinkListener = listener;
}
public void loadSplashAd(string placementId, int fetchAdTimeout, string defaultAdSourceConfig, string mapJson) {
Debug.Log("Unity: ATSplashAdAdClient::loadSplashAd()");
ATSplashAdWrapper.setClientForPlacementID(placementId, this);
ATSplashAdWrapper.loadSplashAd(placementId, mapJson);
}
public bool hasSplashAdReady(string placementId) {
Debug.Log("Unity: ATSplashAdAdClient::hasSplashAdReady()");
return ATSplashAdWrapper.hasSplashAdReady(placementId);
}
public void showSplashAd(string placementId, string mapJson) {
Debug.Log("Unity: ATSplashAdAdClient::showSplashAd()");
ATSplashAdWrapper.showSplashAd(placementId, mapJson);
}
public void cleanCache(string placementId) {
Debug.Log("Unity: ATSplashAdAdClient::cleanCache()");
ATSplashAdWrapper.clearCache(placementId);
}
public string checkAdStatus(string placementId) {
Debug.Log("Unity: ATSplashAdAdClient::checkAdStatus()");
return ATSplashAdWrapper.checkAdStatus(placementId);
}
public string getValidAdCaches(string placementId)
{
Debug.Log("Unity: ATSplashAdAdClient::getValidAdCaches()");
return ATSplashAdWrapper.getValidAdCaches(placementId);
}
public void entryScenarioWithPlacementID(string placementId, string scenarioID){
Debug.Log("Unity: ATSplashAdAdClient::entryScenarioWithPlacementID()");
ATSplashAdWrapper.entryScenarioWithPlacementID(placementId,scenarioID);
}
//Callbacks
public void OnSplashAdDeeplink(string placementID, String callbackJson, bool isSuccess) {
onDeeplinkEvent?.Invoke(this, new ATAdEventArgs(placementID, callbackJson, false, isSuccess));
}
public void OnSplashAdLoadTimeout(string placementID) {
Debug.Log("OnSplashAdLoadTimeout...unity3d.");
onAdLoadTimeoutEvent?.Invoke(this, new ATAdEventArgs(placementID, "", true));
}
public void OnSplashAdLoaded(string placementID) {
Debug.Log("onSplashAdLoaded...unity3d.");
onAdLoadEvent?.Invoke(this, new ATAdEventArgs(placementID));
}
public void OnSplashAdLoadFailure(string placementID, string code, string error) {
Debug.Log("onSplashAdFailed...unity3d.");
onAdLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, code, error));
}
public void OnSplashAdVideoPlayFailure(string placementID, string code, string error) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdVideoPlayFailure()");
onAdVideoFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, code, error));
}
public void OnSplashAdVideoPlayStart(string placementID, string callbackJson) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdPlayStart()");
onAdVideoStartEvent?.Invoke(this, new ATAdEventArgs(placementID, callbackJson));
}
public void OnSplashAdVideoPlayEnd(string placementID, string callbackJson) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdVideoPlayEnd()");
onAdVideoEndEvent?.Invoke(this, new ATAdEventArgs(placementID, callbackJson));
}
public void OnSplashAdShow(string placementID, string callbackJson) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdShow()");
onAdShowEvent?.Invoke(this, new ATAdEventArgs(placementID, callbackJson));
}
public void OnSplashAdFailedToShow(string placementID) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdFailedToShow()");
onAdShowFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementID, "-1", "Failed to show video ad"));
}
public void OnSplashAdClick(string placementID, string callbackJson) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdClick()");
onAdClickEvent?.Invoke(this, new ATAdEventArgs(placementID, callbackJson));
}
public void OnSplashAdClose(string placementID, string callbackJson) {
Debug.Log("Unity: ATSplashAdAdClient::OnSplashAdClose()");
onAdCloseEvent?.Invoke(this, new ATAdEventArgs(placementID, callbackJson));
}
//auto callbacks
public void startLoadingADSource(string placementId, string callbackJson)
{
Debug.Log("Unity: ATSplashAdAdClient::startLoadingADSource()");
onAdSourceAttemptEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void finishLoadingADSource(string placementId, string callbackJson)
{
Debug.Log("Unity: ATSplashAdAdClient::finishLoadingADSource()");
onAdSourceFilledEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void failToLoadADSource(string placementId, string callbackJson,string code, string error)
{
Debug.Log("Unity: ATSplashAdAdClient::failToLoadADSource()");
onAdSourceLoadFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, callbackJson, code, error));
}
public void startBiddingADSource(string placementId, string callbackJson)
{
Debug.Log("Unity: ATSplashAdAdClient::startBiddingADSource()");
onAdSourceBiddingAttemptEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void finishBiddingADSource(string placementId, string callbackJson)
{
Debug.Log("Unity: ATSplashAdAdClient::finishBiddingADSource()");
onAdSourceBiddingFilledEvent?.Invoke(this, new ATAdEventArgs(placementId, callbackJson));
}
public void failBiddingADSource(string placementId,string callbackJson, string code, string error)
{
Debug.Log("Unity: ATSplashAdAdClient::failBiddingADSource()");
onAdSourceBiddingFailureEvent?.Invoke(this, new ATAdErrorEventArgs(placementId, callbackJson, code, error));
}
// Auto
public void addAutoLoadAdPlacementID(string[] placementIDList)
{
Debug.Log("Unity: ATSplashAdAdClient:addAutoLoadAdPlacementID()");
if (placementIDList != null && placementIDList.Length > 0)
{
foreach (string placementID in placementIDList)
{
ATSplashAdWrapper.setClientForPlacementID(placementID, this);
}
string placementIDListString = JsonMapper.ToJson(placementIDList);
ATSplashAdWrapper.addAutoLoadAdPlacementID(placementIDListString);
Debug.Log("addAutoLoadAdPlacementID, placementIDList === " + placementIDListString);
}
else
{
Debug.Log("addAutoLoadAdPlacementID, placementIDList = null");
}
}
public void removeAutoLoadAdPlacementID(string placementId)
{
Debug.Log("Unity: ATSplashAdAdClient:removeAutoLoadAdPlacementID()");
ATSplashAdWrapper.removeAutoLoadAdPlacementID(placementId);
}
public bool autoLoadSplashAdReadyForPlacementID(string placementId)
{
Debug.Log("Unity: ATSplashAdAdClient:autoLoadSplashAdReadyForPlacementID()");
return ATSplashAdWrapper.autoLoadSplashAdReadyForPlacementID(placementId);
}
public string getAutoValidAdCaches(string placementId)
{
Debug.Log("Unity: ATSplashAdAdClient:getAutoValidAdCaches()");
return ATSplashAdWrapper.getAutoValidAdCaches(placementId);
}
public string checkAutoAdStatus(string placementId) {
Debug.Log("Unity: ATSplashAdAdClient::checkAutoAdStatus()");
return ATSplashAdWrapper.checkAutoAdStatus(placementId);
}
public void setAutoLocalExtra(string placementId, string mapJson)
{
Debug.Log("Unity: ATSplashAdAdClient:setAutoLocalExtra()");
ATSplashAdWrapper.setAutoLocalExtra(placementId, mapJson);
}
public void entryAutoAdScenarioWithPlacementID(string placementId, string scenarioID)
{
Debug.Log("Unity: ATSplashAdAdClient:entryAutoAdScenarioWithPlacementID()");
ATSplashAdWrapper.entryAutoAdScenarioWithPlacementID(placementId, scenarioID);
}
public void showAutoAd(string placementId, string mapJson)
{
Debug.Log("Unity: ATSplashAdAdClient::showAutoAd()");
ATSplashAdWrapper.showAutoSplashAd(placementId, mapJson);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a127654c3c9934294aa3dad0d5d01bc8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4787b4f73b23449fa906f342dfca1d00
guid: 71c4a563eff03483d8d19430791ee6f8
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: bd4b39134d1e64f1c9672717d4878e58
guid: 304162e40b68148bb94a0c8806efce99
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 006a9c4ef70b04aef9da361757c85f85
guid: 329be1a5f047c4064b83e8e227cab255
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e2fe4e1278a9f407e9bf696affcfc594
guid: 51884bd21fdee4c22861d1f2e3737ef5
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 11af4b916b2164725bf8a13dd2fbdb37
guid: f7e50faa4b66a45d4beb3292142bbbe3
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -123,13 +123,13 @@ static NSString *kATBannerAdLoadingExtraInlineAdaptiveOrientationKey = @"inline_
statusDict[@"isReady"] = @(checkLoadModel.isReady);
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
NSLog(@"ATBannerAdWrapper::statusDict = %@", statusDict);
return statusDict.jsonString;
return statusDict.jsonFilterString;
}
-(NSString*) getValidAdCaches:(NSString *)placementID {
NSArray *array = [[ATAdManager sharedManager] getBannerValidAdsForPlacementID:placementID];
NSLog(@"ATNativeAdWrapper::array = %@", array);
return array.jsonString;
return array.jsonFilterString;
}
UIEdgeInsets SafeAreaInsets_ATUnityBanner() {

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ac1a4622946d34f26bfcafd57efac5c3
guid: b43a0ea2add1e42719661c1efe22f6f0
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e2eb6428e9bec4bee97e52b2151768c4
guid: e41c93f1d65af414a870503c680c33b6
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -70,6 +70,25 @@
NSMutableDictionary *msgDict = [NSMutableDictionary dictionary];
if (![ATUnityUtilities isEmpty:extra]) {
// SDK user_load_extra_data
if (extra[kATUnityUserExtraDataKey] != nil) {
NSMutableDictionary *extraDictM = [NSMutableDictionary dictionaryWithDictionary:extra];
NSMutableDictionary *extraDataTemp = [NSMutableDictionary dictionary];
NSMutableDictionary *extraDataDictM = [NSMutableDictionary dictionaryWithDictionary:extra[kATUnityUserExtraDataKey]];
for (NSString *key in extraDataDictM.allKeys) {
if ([extraDataDictM[key] isKindOfClass:[NSString class]] || [extraDataDictM[key] isKindOfClass:[NSNumber class]]) {
[extraDataTemp setValue:extraDataDictM[key] forKey:key];
}
}
if ([extraDataTemp count]) {
[extraDictM setValue:extraDataTemp forKey:kATUnityUserExtraDataKey];
} else {
[extraDictM removeObjectForKey:kATUnityUserExtraDataKey];
}
extra = extraDictM;
}
if (extra[@"extra"] != nil) {
msgDict[@"extra"] = extra[@"extra"];
msgDict[@"rewarded"] = extra[@"rewarded"];

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: aa9e3a5ce2adc4eb9b9cd4d2bc9abe47
guid: 42a35ed2985164a3b945006b76e367cb
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7cdfdc46112824f91b18635724af738b
guid: dc580f04ce67f437a88461f335105325
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -108,7 +108,7 @@ static NSString *kATInterstitialSizeUsesPixelFlagKey = @"uses_pixel";
-(NSString*) getValidAdCaches:(NSString *)placementID {
NSArray *array = [[ATAdManager sharedManager] getInterstitialValidAdsForPlacementID:placementID];
NSLog(@"ATNativeAdWrapper::array = %@", array);
return array.jsonString;
return array.jsonFilterString;
}
-(void) showInterstitialAdWithPlacementID:(NSString*)placementID extraJsonString:(NSString*)extraJsonString {
@@ -123,7 +123,7 @@ static NSString *kATInterstitialSizeUsesPixelFlagKey = @"uses_pixel";
statusDict[@"isReady"] = @(checkLoadModel.isReady);
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
NSLog(@"ATInterstitialAdWrapper::statusDict = %@", statusDict);
return statusDict.jsonString;
return statusDict.jsonFilterString;
}
- (void)entryScenarioWithPlacementID:(NSString *)placementID scenarioID:(NSString *)scenarioID{
@@ -177,7 +177,7 @@ static NSString *kATInterstitialSizeUsesPixelFlagKey = @"uses_pixel";
NSLog(@"Unity: getAutoValidAdCaches::array = %@", array);
return array.jsonString;
return array.jsonFilterString;
}
-(NSString*) checkAutoAdStatus:(NSString *)placementID {
@@ -190,7 +190,7 @@ static NSString *kATInterstitialSizeUsesPixelFlagKey = @"uses_pixel";
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
NSLog(@":checkAutoAdStatus statusDict = %@", statusDict);
return statusDict.jsonString;
return statusDict.jsonFilterString;
}
-(void) setAutoLocalExtra:(NSString*)placementID customDataJSONString:(NSString*)customDataJSONString{

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e534e371fd98645f0857baf8dec95667
guid: 98379c144cb4f4245b6a80c423c55ffa
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 896e8a703a8574fb48be91021abe3031
guid: 3f378118b531c4a4fa06102812235b02
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -150,7 +150,7 @@ UIEdgeInsets SafeAreaInsets_ATUnityNative() {
statusDict[@"isReady"] = @(checkLoadModel.isReady);
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
NSLog(@"ATNativeAdWrapper::statusDict = %@", statusDict);
return statusDict.jsonString;
return statusDict.jsonFilterString;
}
- (void)entryScenarioWithPlacementID:(NSString *)placementID scenarioID:(NSString *)scenarioID{
@@ -160,7 +160,7 @@ UIEdgeInsets SafeAreaInsets_ATUnityNative() {
-(NSString*) getValidAdCaches:(NSString *)placementID {
NSArray *array = [[ATAdManager sharedManager] getNativeValidAdsForPlacementID:placementID];
NSLog(@"ATNativeAdWrapper::array = %@", array);
return array.jsonString;
return array.jsonFilterString;
}
-(void) showNativeAdWithPlacementID:(NSString*)placementID metricsJSONString:(NSString*)metricsJSONString extraJsonString:(NSString*)extraJsonString {
@@ -200,8 +200,7 @@ UIEdgeInsets SafeAreaInsets_ATUnityNative() {
kATNativeAdConfigurationContextNetworkLogoViewFrameKey:[NSValue valueWithCGRect:CGRectMake(CGRectGetWidth(configuration.ADFrame) - 54.0f, CGRectGetHeight(configuration.ADFrame) - 18.0f, 54.0f, 18.0f)]
};
ATNativeAdOffer *offer = [[ATAdManager sharedManager] getNativeAdOfferWithPlacementID:placementID];
ATNativeAdOffer *offer = [[ATAdManager sharedManager] getNativeAdOfferWithPlacementID:placementID scene:extraDict[kATUnityUtilitiesAdShowingExtraScenarioKey]];
ATNativeSelfRenderView *selfRenderView = [self getSelfRenderViewOffer:offer withMetrics:parsedMetrics];
@@ -286,15 +285,17 @@ UIEdgeInsets SafeAreaInsets_ATUnityNative() {
NSMutableArray *array = [@[selfRenderView.iconImageView,selfRenderView.titleLabel,selfRenderView.textLabel,selfRenderView.ctaLabel,selfRenderView.mainImageView] mutableCopy];
if (mediaView) {
if (mediaView && offer.nativeAd.isVideoContents) {
[array addObject:mediaView];
selfRenderView.mediaView = mediaView;
[selfRenderView addSubview:mediaView];
//
[selfRenderView bringSubviewToFront:selfRenderView.logoImageView];
}
[nativeADView registerClickableViewArray:array];
selfRenderView.mediaView = mediaView;
[selfRenderView addSubview:mediaView];
self.adView = nativeADView;

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4d00f3756b49d4f5cbc15a35d7282721
guid: 3bcd29d3da90a41f294ae578bab3af13
PluginImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ea80a2164caa74a8bb294b02bae5e928
guid: 118f33a76ed81440280824ff7513bb12
PluginImporter:
externalObjects: {}
serializedVersion: 2

Some files were not shown because too many files have changed in this diff Show More