You've already forked Commercialization.topon
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97674a4b16 | |||
| a248437870 | |||
| c2c8dea87d | |||
| 1e04999628 | |||
| 2cabb0e4e8 | |||
| 874b5edf93 | |||
| 49a35b1b6c | |||
| 37f58dcd84 | |||
| d646659fcf | |||
| 91ef145ede | |||
| e93e33ca2a | |||
| c11f7e3306 |
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 687c8129e7770fe47aa2bdceaab14b6b
|
||||
guid: 0b1601c425ae3b24e9764462dbbe5359
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"name": "AnyThinkAds"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91a7a1e184c2641f79c95f363b8872d2
|
||||
guid: ae70ff20f73a04e91b4e6bb12d7adc69
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 string user_load_extra_data;
|
||||
public readonly int abtest_id;
|
||||
|
||||
public readonly string reward_custom_data;
|
||||
|
||||
@@ -72,15 +76,20 @@ 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 = jsonData.ContainsKey("user_load_extra_data") ? (string)jsonData["user_load_extra_data"] : "";
|
||||
}
|
||||
|
||||
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 +139,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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -14,5 +14,6 @@ namespace AnyThinkAds.Api
|
||||
public ATNativeItemProperty adLogoProperty;
|
||||
public ATNativeItemProperty ctaButtonProperty;
|
||||
public ATNativeItemProperty dislikeButtonProperty;
|
||||
public ATNativeItemProperty elementsProperty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ namespace AnyThinkAds.Api
|
||||
public static void setLogDebug(bool isDebug)
|
||||
{
|
||||
client.setLogDebug(isDebug);
|
||||
ATLogger.IsDebug = isDebug;
|
||||
}
|
||||
|
||||
public static void addNetworkGDPRInfo(int networkType, Dictionary<string,object> dictionary)
|
||||
|
||||
73
AnyThinkAds/Api/ATSplashAd.cs
Normal file
73
AnyThinkAds/Api/ATSplashAd.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4655aa99cf2c1475eb148561285c1d0e
|
||||
guid: 5989e268b2acc4d0dafdbe2ddbf0dd4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
40
AnyThinkAds/Api/ATSplashAdListener.cs
Normal file
40
AnyThinkAds/Api/ATSplashAdListener.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 653ebf512c3af46698bdf323cfb74f53
|
||||
guid: 10be2707423e74e678bcee7dff04f3d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e8456848ebbf4b988a66e831999e0b7
|
||||
guid: 9ded34532e9f04a199738e82a8f7ca89
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
95
AnyThinkAds/Common/ATLogger.cs
Normal file
95
AnyThinkAds/Common/ATLogger.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82226c0ac90874afc9d1b46b47c9dfb5
|
||||
guid: 7bfb781b1a104468281d3a841725635c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
24
AnyThinkAds/Common/IATSplashAdClient.cs
Normal file
24
AnyThinkAds/Common/IATSplashAdClient.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa8c0cec5bff04aeca5dc28fe21ffc89
|
||||
guid: 59530a01ad60b463e8097f851649c20d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b40414c5bb92cc4591777b77d3d888e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cf0d327cc346430caa11f4acd1f815e
|
||||
guid: bbfb513f68b154b0ebfa36897c6e4401
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -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
|
||||
@@ -425,4 +440,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) {}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e06b6a7bea414435806d944b50c9238
|
||||
guid: b0a6ebc6626634f558dc5c05feb59058
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
237
AnyThinkAds/Platform/Android/ATSplashAdClient.cs
Normal file
237
AnyThinkAds/Platform/Android/ATSplashAdClient.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
11
AnyThinkAds/Platform/Android/ATSplashAdClient.cs.meta
Normal file
11
AnyThinkAds/Platform/Android/ATSplashAdClient.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20290a905405e463f823d9c16043cee3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24acb4405bd40449f82a6ea03b5824c7
|
||||
guid: da68e624ffa1041e889b8d3eb9187af2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
233
AnyThinkAds/Platform/iOS/ATSplashAdClient.cs
Normal file
233
AnyThinkAds/Platform/iOS/ATSplashAdClient.cs
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
11
AnyThinkAds/Platform/iOS/ATSplashAdClient.cs.meta
Normal file
11
AnyThinkAds/Platform/iOS/ATSplashAdClient.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff13e06039d104e3e9c3cb155b8f4ecd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4787b4f73b23449fa906f342dfca1d00
|
||||
guid: 71c4a563eff03483d8d19430791ee6f8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd4b39134d1e64f1c9672717d4878e58
|
||||
guid: 304162e40b68148bb94a0c8806efce99
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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] isMemberOfClass:[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"];
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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 {
|
||||
@@ -286,15 +286,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;
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
self.textLabel.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
-(void) configureMetrics:(NSDictionary *)metrics {
|
||||
NSDictionary<NSString*, UIView*> *views = @{kNativeAssetTitle:_titleLabel, kNativeAssetText:_textLabel, kNativeAssetCta:_ctaLabel, kNativeAssetRating:_ratingLabel, kNativeAssetAdvertiser:_advertiserLabel, kNativeAssetIcon:_iconImageView, kNativeAssetMainImage:_mainImageView, kNativeAssetDislike:_dislikeButton};
|
||||
NSDictionary<NSString*, UIView*> *views = @{kNativeAssetTitle:_titleLabel, kNativeAssetText:_textLabel, kNativeAssetCta:_ctaLabel, kNativeAssetRating:_ratingLabel, kNativeAssetAdvertiser:_advertiserLabel, kNativeAssetIcon:_iconImageView, kNativeAssetMainImage:_mainImageView, kNativeAssetSponsorImage:_logoImageView, kNativeAssetDislike:_dislikeButton};
|
||||
[views enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
|
||||
CGRect frame = CGRectFromString(metrics[key][kParsedPropertiesFrameKey]);
|
||||
[self addConstraintsWithVisualFormat:[NSString stringWithFormat:@"|-x-[%@(w)]", key] options:0 metrics:@{@"x":@(frame.origin.x), @"w":@(frame.size.width)} views:views];
|
||||
|
||||
@@ -101,13 +101,13 @@ NSString *const kLoadExtraMediaExtraKey = @"UserExtraData";
|
||||
statusDict[@"isReady"] = @(checkLoadModel.isReady);
|
||||
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
|
||||
NSLog(@"ATRewardedVideoWrapper::statusDict = %@", statusDict);
|
||||
return statusDict.jsonString;
|
||||
return statusDict.jsonFilterString;
|
||||
}
|
||||
|
||||
-(NSString*) getValidAdCaches:(NSString *)placementID {
|
||||
NSArray *array = [[ATAdManager sharedManager] getRewardedVideoValidAdsForPlacementID:placementID];
|
||||
NSLog(@"ATNativeAdWrapper::array = %@", array);
|
||||
return array.jsonString;
|
||||
return array.jsonFilterString;
|
||||
}
|
||||
|
||||
-(void) showRewardedVideoWithPlacementID:(NSString*)placementID extraJsonString:(NSString*)extraJsonString {
|
||||
@@ -177,7 +177,7 @@ NSString *const kLoadExtraMediaExtraKey = @"UserExtraData";
|
||||
-(NSString*) getAutoValidAdCaches:(NSString *)placementID{
|
||||
NSArray *array = [[ATRewardedVideoAutoAdManager sharedInstance] checkValidAdCachesWithPlacementID:placementID];
|
||||
NSLog(@"Unity: getAutoValidAdCaches::array = %@", array);
|
||||
return array.jsonString;
|
||||
return array.jsonFilterString;
|
||||
}
|
||||
|
||||
-(NSString*) checkAutoAdStatus:(NSString *)placementID {
|
||||
@@ -187,7 +187,7 @@ NSString *const kLoadExtraMediaExtraKey = @"UserExtraData";
|
||||
statusDict[@"isReady"] = @(checkLoadModel.isReady);
|
||||
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
|
||||
NSLog(@"ATRewardedVideoWrapper::checkAutoAdStatus statusDict = %@", statusDict);
|
||||
return statusDict.jsonString;
|
||||
return statusDict.jsonFilterString;
|
||||
|
||||
}
|
||||
|
||||
|
||||
18
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.h
Normal file
18
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// ATSplashAdWrapper.h
|
||||
// UnityFramework
|
||||
//
|
||||
// Created by li zhixuan on 2023/5/4.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "ATBaseUnityWrapper.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ATSplashAdWrapper : ATBaseUnityWrapper
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
27
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.h.meta
Normal file
27
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.h.meta
Normal file
@@ -0,0 +1,27 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b3d7c39097da4302b4de8c9415a5f44
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
243
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.m
Normal file
243
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.m
Normal file
@@ -0,0 +1,243 @@
|
||||
//
|
||||
// ATSplashAdWrapper.m
|
||||
// UnityFramework
|
||||
//
|
||||
// Created by li zhixuan on 2023/5/4.
|
||||
//
|
||||
|
||||
#import "ATSplashAdWrapper.h"
|
||||
#import "ATUnityUtilities.h"
|
||||
#import <AnyThinkSplash/AnyThinkSplash.h>
|
||||
|
||||
@interface ATSplashAdWrapper () <ATSplashDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation ATSplashAdWrapper
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static ATSplashAdWrapper *sharedInstance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
sharedInstance = [[ATSplashAdWrapper alloc] init];
|
||||
});
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (NSString *)scriptWrapperClass {
|
||||
return @"ATSplashAdWrapper";
|
||||
}
|
||||
|
||||
- (id)selWrapperClassWithDict:(NSDictionary *)dict callback:(void(*)(const char*, const char*))callback {
|
||||
NSString *selector = dict[@"selector"];
|
||||
NSArray<NSString*>* arguments = dict[@"arguments"];
|
||||
NSString *firstObject = @"";
|
||||
NSString *lastObject = @"";
|
||||
if (![ATUnityUtilities isEmpty:arguments]) {
|
||||
for (int i = 0; i < arguments.count; i++) {
|
||||
if (i == 0) { firstObject = arguments[i]; }
|
||||
else { lastObject = arguments[i]; }
|
||||
}
|
||||
}
|
||||
|
||||
if ([selector isEqualToString:@"loadSplashAdWithPlacementID:customDataJSONString:callback:"]) {
|
||||
[self loadSplashAdWithPlacementID:firstObject customDataJSONString:lastObject callback:callback];
|
||||
} else if ([selector isEqualToString:@"splashAdReadyForPlacementID:"]) {
|
||||
return [NSNumber numberWithBool:[self splashAdReadyForPlacementID:firstObject]];
|
||||
} else if ([selector isEqualToString:@"showSplashAdWithPlacementID:extraJsonString:"]) {
|
||||
[self showSplashAdWithPlacementID:firstObject extraJsonString:lastObject];
|
||||
} else if ([selector isEqualToString:@"checkAdStatus:"]) {
|
||||
return [self checkAdStatus:firstObject];
|
||||
} else if ([selector isEqualToString:@"clearCache"]) {
|
||||
[self clearCache];
|
||||
} else if ([selector isEqualToString:@"getValidAdCaches:"]) {
|
||||
return [self getValidAdCaches:firstObject];
|
||||
}else if ([selector isEqualToString:@"entryScenarioWithPlacementID:scenarioID:"]) {
|
||||
[self entryScenarioWithPlacementID:firstObject scenarioID:lastObject];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)loadSplashAdWithPlacementID:(NSString*)placementID customDataJSONString:(NSString*)customDataJSONString callback:(void(*)(const char*, const char*))callback {
|
||||
|
||||
[self setCallBack:callback forKey:placementID];
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([customDataJSONString isKindOfClass:[NSString class]] && [customDataJSONString length] > 0) {
|
||||
NSDictionary *extraDict = [NSJSONSerialization JSONObjectWithData:[customDataJSONString dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:nil];
|
||||
[extra addEntriesFromDictionary:extraDict];
|
||||
}
|
||||
NSString *defaultAdSourceConfig = extra[@"default_adSource_config"];
|
||||
NSLog(@"ATSplashAdWrapper::extra = %@", extra);
|
||||
[[ATAdManager sharedManager] loadADWithPlacementID:placementID
|
||||
extra:extra
|
||||
delegate:self
|
||||
containerView:nil
|
||||
defaultAdSourceConfig:defaultAdSourceConfig];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)splashAdReadyForPlacementID:(NSString*)placementID {
|
||||
return [[ATAdManager sharedManager] splashReadyForPlacementID:placementID];
|
||||
}
|
||||
|
||||
- (NSString*)getValidAdCaches:(NSString *)placementID {
|
||||
NSArray *array = [[ATAdManager sharedManager] getSplashValidAdsForPlacementID:placementID];
|
||||
NSLog(@"ATSplashAdWrapper::array = %@", array);
|
||||
return array.jsonFilterString;
|
||||
}
|
||||
|
||||
- (void)showSplashAdWithPlacementID:(NSString*)placementID extraJsonString:(NSString*)extraJsonString {
|
||||
[[ATAdManager sharedManager] showSplashWithPlacementID:placementID scene:@"" window:[UIApplication sharedApplication].delegate.window delegate:self];
|
||||
}
|
||||
|
||||
- (NSString*)checkAdStatus:(NSString *)placementID {
|
||||
ATCheckLoadModel *checkLoadModel = [[ATAdManager sharedManager] checkSplashLoadStatusForPlacementID:placementID];
|
||||
NSMutableDictionary *statusDict = [NSMutableDictionary dictionary];
|
||||
statusDict[@"isLoading"] = @(checkLoadModel.isLoading);
|
||||
statusDict[@"isReady"] = @(checkLoadModel.isReady);
|
||||
statusDict[@"adInfo"] = checkLoadModel.adOfferInfo;
|
||||
NSLog(@"ATSplashAdWrapper::statusDict = %@", statusDict);
|
||||
return statusDict.jsonFilterString;
|
||||
}
|
||||
|
||||
- (void)entryScenarioWithPlacementID:(NSString *)placementID scenarioID:(NSString *)scenarioID{
|
||||
[[ATAdManager sharedManager] entrySplashScenarioWithPlacementID:placementID scene:scenarioID];
|
||||
}
|
||||
|
||||
- (void) clearCache {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - ATSplashDelegate
|
||||
/// Splash ad displayed successfully
|
||||
- (void)splashDidShowForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
[self invokeCallback:@"OnSplashAdShow" placementID:placementID error:nil extra:extra];
|
||||
}
|
||||
|
||||
/// Splash ad click
|
||||
- (void)splashDidClickForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
[self invokeCallback:@"OnSplashAdClick" placementID:placementID error:nil extra:extra];
|
||||
}
|
||||
|
||||
/// Splash ad closed
|
||||
- (void)splashDidCloseForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
[self invokeCallback:@"OnSplashAdClose" placementID:placementID error:nil extra:extra];
|
||||
}
|
||||
|
||||
/// Callback when the splash ad is loaded successfully
|
||||
/// @param isTimeout whether timeout
|
||||
/// v 5.7.73
|
||||
- (void)didFinishLoadingSplashADWithPlacementID:(NSString *)placementID
|
||||
isTimeout:(BOOL)isTimeout {
|
||||
}
|
||||
|
||||
/// Splash ad loading timeout callback
|
||||
/// v 5.7.73
|
||||
- (void)didTimeoutLoadingSplashADWithPlacementID:(NSString *)placementID {
|
||||
[self invokeCallback:@"OnSplashAdLoadTimeout" placementID:placementID error:nil extra:nil];
|
||||
}
|
||||
|
||||
/// Splash ad failed to display
|
||||
/// currently supports Pangle, Guangdiantong and Baidu
|
||||
- (void)splashDidShowFailedForPlacementID:(NSString *)placementID
|
||||
error:(NSError *)error
|
||||
extra:(NSDictionary *)extra {
|
||||
[self invokeCallback:@"OnSplashAdFailedToShow" placementID:placementID error:error extra:extra];
|
||||
}
|
||||
|
||||
/// Whether the click jump of Splash ad is in the form of Deeplink
|
||||
/// note: only suport TopOn Adx ad
|
||||
- (void)splashDeepLinkOrJumpForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra
|
||||
result:(BOOL)success {
|
||||
NSMutableDictionary *newExtra = [[NSMutableDictionary alloc] initWithDictionary:extra];
|
||||
newExtra[@"success"] = @(success);
|
||||
[self invokeCallback:@"OnSplashAdDeeplink" placementID:placementID error:nil extra:newExtra];
|
||||
}
|
||||
|
||||
/// Splash ad closes details page
|
||||
- (void)splashDetailDidClosedForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
|
||||
}
|
||||
|
||||
/// Called when splash zoomout view did click
|
||||
/// note: only suport Pangle splash zoomout view and the Tencent splash V+ ad
|
||||
- (void)splashZoomOutViewDidClickForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
|
||||
}
|
||||
|
||||
/// Called when splash zoomout view did close
|
||||
/// note: only suport Pangle splash zoomout view and the Tencent splash V+ ad
|
||||
- (void)splashZoomOutViewDidCloseForPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
|
||||
}
|
||||
|
||||
/// This callback is triggered when the skip button is customized.
|
||||
/// note: only suport TopOn MyOffer, TopOn Adx and TopOn OnlineApi
|
||||
/// 5.7.61+
|
||||
- (void)splashCountdownTime:(NSInteger)countdown
|
||||
forPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary *)extra {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - ATAdLoadingDelegate
|
||||
/// Callback when the successful loading of the ad
|
||||
- (void)didFinishLoadingADWithPlacementID:(NSString *)placementID {
|
||||
[self invokeCallback:@"OnSplashAdLoaded" placementID:placementID error:nil extra:nil];
|
||||
}
|
||||
|
||||
/// Callback of ad loading failure
|
||||
- (void)didFailToLoadADWithPlacementID:(NSString*)placementID
|
||||
error:(NSError*)error {
|
||||
error = error != nil ? error : [NSError errorWithDomain:@"com.anythink.Unity3DPackage" code:100001 userInfo:@{NSLocalizedDescriptionKey:@"AT has failed to load ad", NSLocalizedFailureReasonErrorKey:@"AT has failed to load ad"}];
|
||||
[self invokeCallback:@"OnSplashAdLoadFailure" placementID:placementID error:error extra:nil];
|
||||
|
||||
}
|
||||
|
||||
/// Ad start load
|
||||
- (void)didStartLoadingADSourceWithPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary*)extra {
|
||||
[self invokeCallback:@"startLoadingADSource" placementID:placementID error:nil extra:extra];
|
||||
|
||||
}
|
||||
/// Ad load success
|
||||
- (void)didFinishLoadingADSourceWithPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary*)extra {
|
||||
[self invokeCallback:@"finishLoadingADSource" placementID:placementID error:nil extra:extra];
|
||||
|
||||
}
|
||||
/// Ad load fail
|
||||
- (void)didFailToLoadADSourceWithPlacementID:(NSString*)placementID
|
||||
extra:(NSDictionary*)extra
|
||||
error:(NSError*)error {
|
||||
[self invokeCallback:@"failToLoadADSource" placementID:placementID error:error extra:extra];
|
||||
}
|
||||
|
||||
/// Ad start bidding
|
||||
- (void)didStartBiddingADSourceWithPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary*)extra {
|
||||
[self invokeCallback:@"startBiddingADSource" placementID:placementID error:nil extra:extra];
|
||||
}
|
||||
|
||||
/// Ad bidding success
|
||||
- (void)didFinishBiddingADSourceWithPlacementID:(NSString *)placementID
|
||||
extra:(NSDictionary*)extra {
|
||||
[self invokeCallback:@"finishBiddingADSource" placementID:placementID error:nil extra:extra];
|
||||
}
|
||||
|
||||
/// Ad bidding fail
|
||||
- (void)didFailBiddingADSourceWithPlacementID:(NSString*)placementID
|
||||
extra:(NSDictionary*)extra
|
||||
error:(NSError*)error {
|
||||
[self invokeCallback:@"failBiddingADSource" placementID:placementID error:error extra:extra];
|
||||
}
|
||||
|
||||
@end
|
||||
37
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.m.meta
Normal file
37
AnyThinkAds/Platform/iOS/Internal/C/ATSplashAdWrapper.m.meta
Normal file
@@ -0,0 +1,37 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d17f3acf1ffb4fa9abed493f1c1623b
|
||||
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:
|
||||
@@ -12,17 +12,28 @@ extern NSString *const kATUnityUtilitiesInterstitialCloseNotification;
|
||||
extern NSString *const kATUnityUtilitiesRewardedVideoImpressionNotification;
|
||||
extern NSString *const kATUnityUtilitiesRewardedVideoCloseNotification;
|
||||
extern NSString *const kATUnityUtilitiesAdShowingExtraScenarioKey;
|
||||
extern NSString *const kATUnityUserExtraDataKey;
|
||||
extern NSString *const kATUnityCheckLoadModelAdInfoKey;
|
||||
|
||||
|
||||
@interface ATUnityUtilities : NSObject
|
||||
+(BOOL)isEmpty:(id)object;
|
||||
@end
|
||||
|
||||
@interface NSDictionary (KAKit)
|
||||
-(NSString*) jsonString;
|
||||
|
||||
// 过滤SDK返回参数的 user_load_extra_data 中不支持的类型
|
||||
-(NSString*) jsonFilterString;
|
||||
|
||||
-(BOOL)containsObjectForKey:(id)key;
|
||||
@end
|
||||
|
||||
@interface NSArray (KAKit)
|
||||
-(NSString*) jsonString;
|
||||
|
||||
// 过滤SDK返回参数的 user_load_extra_data 中不支持的类型
|
||||
-(NSString*) jsonFilterString;
|
||||
@end
|
||||
|
||||
@interface NSData(ATKit)
|
||||
|
||||
@@ -13,6 +13,9 @@ NSString *const kATUnityUtilitiesRewardedVideoImpressionNotification = @"kATUnit
|
||||
NSString *const kATUnityUtilitiesRewardedVideoCloseNotification = @"kATUnityUtilitiesRewardedVideoCloseNotification";
|
||||
NSString *const kATUnityUtilitiesAdShowingExtraScenarioKey = @"Scenario";
|
||||
|
||||
NSString *const kATUnityUserExtraDataKey = @"user_load_extra_data";
|
||||
NSString *const kATUnityCheckLoadModelAdInfoKey = @"adInfo";
|
||||
|
||||
@implementation ATUnityUtilities
|
||||
+(BOOL)isEmpty:(id)object {
|
||||
return (object == nil || [object isKindOfClass:[NSNull class]] || ([object respondsToSelector:@selector(length)] && [(NSData *)object length] == 0) || ([object respondsToSelector:@selector(count)] && [(NSArray *)object count] == 0));
|
||||
@@ -37,6 +40,41 @@ NSString *const kATUnityUtilitiesAdShowingExtraScenarioKey = @"Scenario";
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*)jsonFilterString {
|
||||
|
||||
NSError *error;
|
||||
NSData *jsonData;
|
||||
|
||||
NSMutableDictionary *extraDictM = [NSMutableDictionary dictionaryWithDictionary:self[kATUnityCheckLoadModelAdInfoKey]];
|
||||
NSMutableDictionary *extraDataTemp = [NSMutableDictionary dictionary];
|
||||
NSMutableDictionary *extraDataDictM = [NSMutableDictionary dictionaryWithDictionary:self[kATUnityCheckLoadModelAdInfoKey][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];
|
||||
}
|
||||
|
||||
@try {
|
||||
jsonData = [NSJSONSerialization dataWithJSONObject:extraDictM
|
||||
options:kNilOptions
|
||||
error:&error];
|
||||
} @catch (NSException *exception) {
|
||||
return @"{}";
|
||||
} @finally {}
|
||||
|
||||
if (!jsonData) {
|
||||
return @"{}";
|
||||
} else {
|
||||
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(BOOL)containsObjectForKey:(id)key {
|
||||
return [self.allKeys containsObject:key];
|
||||
}
|
||||
@@ -61,6 +99,46 @@ NSString *const kATUnityUtilitiesAdShowingExtraScenarioKey = @"Scenario";
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*)jsonFilterString {
|
||||
|
||||
NSError *error;
|
||||
NSData *jsonData;
|
||||
|
||||
NSMutableArray *filterArrayM = [NSMutableArray arrayWithCapacity:self.count];
|
||||
for (NSDictionary *adTempDict in self) {
|
||||
|
||||
NSMutableDictionary *extraDictM = [NSMutableDictionary dictionaryWithDictionary:adTempDict];
|
||||
NSMutableDictionary *extraDataTemp = [NSMutableDictionary dictionary];
|
||||
NSMutableDictionary *extraDataDictM = [NSMutableDictionary dictionaryWithDictionary:adTempDict[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];
|
||||
}
|
||||
[filterArrayM addObject:extraDictM];
|
||||
}
|
||||
|
||||
@try {
|
||||
jsonData = [NSJSONSerialization dataWithJSONObject:filterArrayM
|
||||
options:kNilOptions
|
||||
error:&error];
|
||||
} @catch (NSException *exception) {
|
||||
return @"[]";
|
||||
} @finally {}
|
||||
|
||||
if (!jsonData) {
|
||||
return @"[]";
|
||||
} else {
|
||||
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSData(ATKit)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 299bd02f216b54e2db98218be4653d60
|
||||
guid: 2e059c89366e24ea9ad9a677576c896a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
263
AnyThinkAds/Platform/iOS/Internal/Script/ATSplashAdWrapper.cs
Normal file
263
AnyThinkAds/Platform/iOS/Internal/Script/ATSplashAdWrapper.cs
Normal file
@@ -0,0 +1,263 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using AOT;
|
||||
using AnyThinkAds.ThirdParty.LitJson;
|
||||
using AnyThinkAds.iOS;
|
||||
#pragma warning disable 0109
|
||||
public class ATSplashAdWrapper:ATAdWrapper {
|
||||
static private Dictionary<string, ATSplashAdClient> clients;
|
||||
static private string CMessaageReceiverClass = "ATSplashAdWrapper";
|
||||
|
||||
static public new void InvokeCallback(JsonData jsonData) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::InvokeCallback()");
|
||||
string extraJson = "";
|
||||
string callback = (string)jsonData["callback"];
|
||||
Dictionary<string, object> msgDict = JsonMapper.ToObject<Dictionary<string, object>>(jsonData["msg"].ToJson());
|
||||
JsonData msgJsonData = jsonData["msg"];
|
||||
IDictionary idic = (System.Collections.IDictionary)msgJsonData;
|
||||
|
||||
if (idic.Contains("extra")) {
|
||||
JsonData extraJsonDate = msgJsonData["extra"];
|
||||
if (extraJsonDate != null) {
|
||||
extraJson = msgJsonData["extra"].ToJson();
|
||||
}
|
||||
}
|
||||
|
||||
if (callback.Equals("OnSplashAdLoaded")) {
|
||||
OnSplashAdLoaded((string)msgDict["placement_id"]);
|
||||
} else if (callback.Equals("OnSplashAdLoadFailure")) {
|
||||
Dictionary<string, object> errorDict = new Dictionary<string, object>();
|
||||
Dictionary<string, object> errorMsg = JsonMapper.ToObject<Dictionary<string, object>>(msgJsonData["error"].ToJson());
|
||||
if (errorMsg.ContainsKey("code")) { errorDict.Add("code", errorMsg["code"]); }
|
||||
if (errorMsg.ContainsKey("reason")) { errorDict.Add("message", errorMsg["reason"]); }
|
||||
OnSplashAdLoadFailure((string)msgDict["placement_id"], errorDict);
|
||||
} else if (callback.Equals("OnSplashAdVideoPlayFailure")) {
|
||||
Dictionary<string, object> errorDict = new Dictionary<string, object>();
|
||||
Dictionary<string, object> errorMsg = JsonMapper.ToObject<Dictionary<string, object>>(msgJsonData["error"].ToJson());
|
||||
if (errorMsg.ContainsKey("code")) { errorDict.Add("code", errorMsg["code"]); }
|
||||
if (errorMsg.ContainsKey("reason")) { errorDict.Add("message", errorMsg["reason"]); }
|
||||
OnSplashAdVideoPlayFailure((string)msgDict["placement_id"], errorDict);
|
||||
} else if (callback.Equals("OnSplashAdVideoPlayStart")) {
|
||||
OnSplashAdVideoPlayStart((string)msgDict["placement_id"], extraJson);
|
||||
} else if (callback.Equals("OnSplashAdVideoPlayEnd")) {
|
||||
OnSplashAdVideoPlayEnd((string)msgDict["placement_id"], extraJson);
|
||||
} else if (callback.Equals("OnSplashAdShow")) {
|
||||
OnSplashAdShow((string)msgDict["placement_id"], extraJson);
|
||||
} else if (callback.Equals("OnSplashAdClick")) {
|
||||
OnSplashAdClick((string)msgDict["placement_id"], extraJson);
|
||||
} else if (callback.Equals("OnSplashAdClose")) {
|
||||
OnSplashAdClose((string)msgDict["placement_id"], extraJson);
|
||||
} else if (callback.Equals("OnSplashAdFailedToShow")) {
|
||||
OnSplashAdFailedToShow((string)msgDict["placement_id"]);
|
||||
}else if (callback.Equals("startLoadingADSource")) {
|
||||
StartLoadingADSource((string)msgDict["placement_id"], extraJson);
|
||||
}else if (callback.Equals("finishLoadingADSource")) {
|
||||
FinishLoadingADSource((string)msgDict["placement_id"], extraJson);
|
||||
}else if (callback.Equals("failToLoadADSource")) {
|
||||
|
||||
Dictionary<string, object> errorDict = new Dictionary<string, object>();
|
||||
Dictionary<string, object> errorMsg = JsonMapper.ToObject<Dictionary<string, object>>(msgJsonData["error"].ToJson());
|
||||
if (errorMsg["code"] != null) { errorDict.Add("code", errorMsg["code"]); }
|
||||
if (errorMsg["reason"] != null) { errorDict.Add("message", errorMsg["reason"]); }
|
||||
FailToLoadADSource((string)msgDict["placement_id"],extraJson, errorDict);
|
||||
|
||||
}else if (callback.Equals("startBiddingADSource")) {
|
||||
StartBiddingADSource((string)msgDict["placement_id"], extraJson);
|
||||
|
||||
}else if (callback.Equals("finishBiddingADSource")) {
|
||||
FinishBiddingADSource((string)msgDict["placement_id"], extraJson);
|
||||
|
||||
}else if (callback.Equals("failBiddingADSource")) {
|
||||
Dictionary<string, object> errorDict = new Dictionary<string, object>();
|
||||
Dictionary<string, object> errorMsg = JsonMapper.ToObject<Dictionary<string, object>>(msgJsonData["error"].ToJson());
|
||||
if (errorMsg["code"] != null) { errorDict.Add("code", errorMsg["code"]); }
|
||||
if (errorMsg["reason"] != null) { errorDict.Add("message", errorMsg["reason"]); }
|
||||
FailBiddingADSource((string)msgDict["placement_id"],extraJson, errorDict);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static public void setClientForPlacementID(string placementID, ATSplashAdClient client) {
|
||||
if (clients == null) clients = new Dictionary<string, ATSplashAdClient>();
|
||||
if (clients.ContainsKey(placementID)) clients.Remove(placementID);
|
||||
clients.Add(placementID, client);
|
||||
}
|
||||
|
||||
static public void loadSplashAd(string placementID, string customData) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::loadSplashAd(" + placementID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "loadSplashAdWithPlacementID:customDataJSONString:callback:", new object[]{placementID, customData != null ? customData : ""}, true);
|
||||
}
|
||||
|
||||
static public bool hasSplashAdReady(string placementID) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::isSplashAdReady(" + placementID + ")");
|
||||
return ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "splashAdReadyForPlacementID:", new object[]{placementID});
|
||||
}
|
||||
|
||||
static public void showSplashAd(string placementID, string mapJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::showSplashAd(" + placementID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "showSplashAdWithPlacementID:extraJsonString:", new object[]{placementID, mapJson});
|
||||
}
|
||||
|
||||
static public void clearCache(string placementID) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::clearCache()");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "clearCache", null);
|
||||
}
|
||||
|
||||
static public string checkAdStatus(string placementID) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::checkAdStatus(" + placementID + ")");
|
||||
return ATUnityCBridge.GetStringMessageFromC(CMessaageReceiverClass, "checkAdStatus:", new object[]{placementID});
|
||||
}
|
||||
|
||||
static public string getValidAdCaches(string placementID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::checkAdStatus(" + placementID + ")");
|
||||
return ATUnityCBridge.GetStringMessageFromC(CMessaageReceiverClass, "getValidAdCaches:", new object[] { placementID });
|
||||
}
|
||||
|
||||
static public void entryScenarioWithPlacementID(string placementID, string scenarioID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::entryScenarioWithPlacementID(" + placementID + scenarioID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "entryScenarioWithPlacementID:scenarioID:", new object[]{placementID, scenarioID});
|
||||
}
|
||||
|
||||
//Callbacks
|
||||
static private void OnSplashAdLoaded(string placementID) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdLoaded()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdLoaded(placementID);
|
||||
}
|
||||
|
||||
static private void OnSplashAdLoadFailure(string placementID, Dictionary<string, object> errorDict) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdLoadFailure()");
|
||||
Debug.Log("placementID = " + placementID + "errorDict = " + JsonMapper.ToJson(errorDict));
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdLoadFailure(placementID, (string)errorDict["code"], (string)errorDict["message"]);
|
||||
}
|
||||
|
||||
static private void OnSplashAdVideoPlayFailure(string placementID, Dictionary<string, object> errorDict) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdVideoPlayFailure()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdVideoPlayFailure(placementID, (string)errorDict["code"], (string)errorDict["message"]);
|
||||
}
|
||||
|
||||
static private void OnSplashAdVideoPlayStart(string placementID, string callbackJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdPlayStart()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdVideoPlayStart(placementID, callbackJson);
|
||||
}
|
||||
|
||||
static private void OnSplashAdVideoPlayEnd(string placementID, string callbackJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdVideoPlayEnd()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdVideoPlayEnd(placementID, callbackJson);
|
||||
}
|
||||
|
||||
static private void OnSplashAdShow(string placementID, string callbackJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdShow()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdShow(placementID, callbackJson);
|
||||
}
|
||||
|
||||
static private void OnSplashAdFailedToShow(string placementID) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdFailedToShow()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdFailedToShow(placementID);
|
||||
}
|
||||
|
||||
static private void OnSplashAdClick(string placementID, string callbackJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdClick()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdClick(placementID, callbackJson);
|
||||
}
|
||||
|
||||
static private void OnSplashAdClose(string placementID, string callbackJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::OnSplashAdClose()");
|
||||
if (clients[placementID] != null) clients[placementID].OnSplashAdClose(placementID, callbackJson);
|
||||
}
|
||||
// ad source callback
|
||||
static public void StartLoadingADSource(string placementID, string callbackJson)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::StartLoadingADSource()");
|
||||
if (clients[placementID] != null) clients[placementID].startLoadingADSource(placementID, callbackJson);
|
||||
}
|
||||
static public void FinishLoadingADSource(string placementID, string callbackJson)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::FinishLoadingADSource()");
|
||||
if (clients[placementID] != null) clients[placementID].finishLoadingADSource(placementID, callbackJson);
|
||||
}
|
||||
|
||||
static public void FailToLoadADSource(string placementID,string callbackJson, Dictionary<string, object> errorDict)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::FailToLoadADSource()");
|
||||
|
||||
Debug.Log("placementID = " + placementID + "errorDict = " + JsonMapper.ToJson(errorDict));
|
||||
if (clients[placementID] != null) clients[placementID].failToLoadADSource(placementID,callbackJson,(string)errorDict["code"], (string)errorDict["message"]);
|
||||
}
|
||||
|
||||
static public void StartBiddingADSource(string placementID, string callbackJson)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::StartBiddingADSource()");
|
||||
if (clients[placementID] != null) clients[placementID].startBiddingADSource(placementID, callbackJson);
|
||||
}
|
||||
static public void FinishBiddingADSource(string placementID, string callbackJson)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::FinishBiddingADSource()");
|
||||
if (clients[placementID] != null) clients[placementID].finishBiddingADSource(placementID, callbackJson);
|
||||
}
|
||||
|
||||
static public void FailBiddingADSource(string placementID, string callbackJson,Dictionary<string, object> errorDict)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::FailBiddingADSource()");
|
||||
|
||||
Debug.Log("placementID = " + placementID + "errorDict = " + JsonMapper.ToJson(errorDict));
|
||||
if (clients[placementID] != null) clients[placementID].failBiddingADSource(placementID,callbackJson,(string)errorDict["code"], (string)errorDict["message"]);
|
||||
}
|
||||
|
||||
// Auto
|
||||
static public void addAutoLoadAdPlacementID(string placementID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::addAutoLoadAdPlacementID(" + placementID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "addAutoLoadAdPlacementID:callback:", new object[]{placementID}, true);
|
||||
}
|
||||
|
||||
static public void removeAutoLoadAdPlacementID(string placementID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::removeAutoLoadAdPlacementID(" + placementID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "removeAutoLoadAdPlacementID:", new object[]{placementID});
|
||||
}
|
||||
static public bool autoLoadSplashAdReadyForPlacementID(string placementID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::autoLoadSplashAdReadyForPlacementID(" + placementID + ")");
|
||||
|
||||
return ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "autoLoadSplashAdReadyForPlacementID:", new object[]{placementID});
|
||||
}
|
||||
static public string getAutoValidAdCaches(string placementID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::getAutoValidAdCaches");
|
||||
return ATUnityCBridge.GetStringMessageFromC(CMessaageReceiverClass, "getAutoValidAdCaches:", new object[]{placementID});
|
||||
}
|
||||
|
||||
static public string checkAutoAdStatus(string placementID) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::checkAutoAdStatus(" + placementID + ")");
|
||||
return ATUnityCBridge.GetStringMessageFromC(CMessaageReceiverClass, "checkAutoAdStatus:", new object[]{placementID});
|
||||
}
|
||||
|
||||
static public void setAutoLocalExtra(string placementID, string customData)
|
||||
{
|
||||
|
||||
Debug.Log("Unity: ATSplashAdWrapper::setAutoLocalExtra(" + placementID + customData + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "setAutoLocalExtra:customDataJSONString:", new object[] {placementID, customData != null ? customData : ""});
|
||||
}
|
||||
|
||||
static public void entryAutoAdScenarioWithPlacementID(string placementID, string scenarioID)
|
||||
{
|
||||
Debug.Log("Unity: ATSplashAdWrapper::entryAutoAdScenarioWithPlacementID(" + placementID + scenarioID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "entryAutoAdScenarioWithPlacementID:scenarioID:", new object[]{placementID, scenarioID});
|
||||
}
|
||||
|
||||
static public void showAutoSplashAd(string placementID, string mapJson) {
|
||||
Debug.Log("Unity: ATSplashAdWrapper::showAutoSplashAd(" + placementID + ")");
|
||||
ATUnityCBridge.SendMessageToC(CMessaageReceiverClass, "showAutoSplashAd:extraJsonString:", new object[]{placementID, mapJson});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72f0a51acef9146669a7d7aaa8f899af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -35,6 +35,8 @@ public class ATUnityCBridge {
|
||||
ATBannerAdWrapper.InvokeCallback(jsonData);
|
||||
} else if (wrapperClass.Equals("ATNativeBannerAdWrapper")) {
|
||||
ATNativeBannerAdWrapper.InvokeCallback(jsonData);
|
||||
} else if (wrapperClass.Equals("ATSplashAdWrapper")) {
|
||||
ATSplashAdWrapper.InvokeCallback(jsonData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29db9515d99e97b4e86706b3b5a1b4f2
|
||||
guid: 81948355b66d24e4b9cb273bbe56eac4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d10ccf786e1ad1489b35928a36f68a4
|
||||
guid: 8aa118c29ade9fd4b9a0768c2be07862
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<!--
|
||||
~ Copyright © 2018-2020 TopOn. All rights reserved.
|
||||
~ https://www.toponad.com
|
||||
~ Licensed under the TopOn SDK License Agreement
|
||||
~ https://github.com/toponteam/TopOn-Android-SDK/blob/master/LICENSE
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.anythink.mobrain">
|
||||
|
||||
<!--必要权限-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
|
||||
<!--必要权限,解决安全风险漏洞,发送和注册广播事件需要调用带有传递权限的接口-->
|
||||
<permission
|
||||
android:name="${applicationId}.openadsdk.permission.TT_PANGOLIN"
|
||||
android:protectionLevel="signature" />
|
||||
<uses-permission android:name="${applicationId}.openadsdk.permission.TT_PANGOLIN" />
|
||||
|
||||
<!--可选权限-->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.GET_TASKS"/>
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
|
||||
<!--可选,Mobrain SDK提供“获取地理位置权限”方式上报用户位置,两种方式均可不选,添加位置权限或参数将帮助投放定位广告-->
|
||||
<!--请注意:无论通过何种方式提供给穿山甲用户地理位置,均需向用户声明地理位置权限将应用于穿山甲广告投放,穿山甲不强制获取地理位置信息-->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
|
||||
<!-- 如果有视频相关的广告且使用textureView播放,请务必添加,否则黑屏 -->
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<!-- 高于Android 11的系统上,如果应用的 targetSdkVersion >= 30 ,推荐增加以下权限声明
|
||||
(SDK将通过此权限正常触发广告行为,并保证广告的正确投放。此权限需要在用户隐私文档中声明)-->
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
|
||||
|
||||
|
||||
<application>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3732f65f0db68044d8a92831451f9edf
|
||||
guid: 00e755c66928bf845a74801253f3a0ff
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66e0968f254244152ae5a813ed8d0b38
|
||||
guid: 063c2379fd28a4ea9b8113386f6e2a94
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8796f84f818a647e487c69b334805515
|
||||
guid: de346304da6da453fb4e4028ccfa87d9
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
3
AnyThinkAds/Plugins/Android/China/Editor/Gromore.meta
Normal file
3
AnyThinkAds/Plugins/Android/China/Editor/Gromore.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51a89bd698bd46358af7ea78f5245d04
|
||||
timeCreated: 1693816810
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<repositories>
|
||||
<repository>https://artifact.bytedance.com/repository/pangle</repository>
|
||||
</repositories>
|
||||
|
||||
<androidPackage spec="com.gromore.cn:gromore-sdk:4.3.0.3"/>
|
||||
<androidPackage spec="com.gromore.cn:pangle-adapter:5.4.1.6.0"/>
|
||||
|
||||
</androidPackages>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aed17cf9003947689bdd0e379dc9c087
|
||||
timeCreated: 1693815837
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3fed59c8c3f2f47edb4c1c29abbb1db1
|
||||
guid: 0b639822d913a42d08a8da694163cad7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d2eadb320c6448a7a4d2f4e2b90b4da
|
||||
guid: 33c67038f4c904d05bd0875c937fa880
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48ab74722adda4a78a3cbdcaa8194930
|
||||
guid: 3af96bb77620145fb9abbd1844f5431f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba760aa6a72eb4d4fa5b45d56a01eb88
|
||||
guid: 81345eb1278404c50abd5f44ab66ccec
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c51c213b59544f83af22c17ddb34baa
|
||||
guid: 65e41ebac4da64cdeab7d162d1212cac
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5cf0e27873d8640d58f965370b8e4894
|
||||
guid: 7ad65e2aacd7a4428b74871d91234e4a
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 582c425272e48470eaa96bbc41a19ada
|
||||
guid: 80b54a91dd4004c8188635f7563c603c
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1253ef962331451c920d9a9cfec5d64
|
||||
guid: 0585b7a575916456b90cbbe4efd2b060
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69eadc53c9e9c476494b0ec77e3bd34f
|
||||
guid: c8aa9f53a23284bf8b454b66a6c95826
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ed214925e60e2147bbab3c2f5dcd242
|
||||
guid: b4495cf048f8b564e885f7a5205cabe5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c345117aff0e042ac85ce3315da4d6fb
|
||||
guid: f0d79a94646b5be45b4acb42e1336674
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e98980da5c894df4a84b91d90c80398
|
||||
guid: 204d1c2a7960e48ceaee45173764f175
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4abbc90e2bfe9438083fa2bad2088718
|
||||
guid: 90dd56ba21d3f46ce8799318c4c697f6
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba11efe87ceb04de0993c8cf97924e43
|
||||
guid: 5931f1f57fd9a4414be7508e413219e2
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1610503b01fd04462a2e8403e6b665b5
|
||||
guid: 727c8d0c38d5c45698625e7047fa202f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fbff6d0de904402ba1ed3df04ad07a3
|
||||
guid: 8e1455b7aa64746c8b9f3e6054db6dfb
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edd3f0c5204174a9c90fe7fd5df5a017
|
||||
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.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9eafffd68d739204a9a9e9065e469602
|
||||
guid: ee3ef3812baa6438dbe5f11e2e336a95
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2923aac3c298e4033a3b415a8f471a55
|
||||
guid: e47bd66773b7f401384c6ea05bf570ac
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,8 @@
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="io.reactivex.rxjava2:rxjava:2.0.1"/>
|
||||
<androidPackage spec="io.reactivex.rxjava2:rxandroid:2.0.1"/>
|
||||
<androidPackage spec="com.squareup.okhttp3:okhttp:3.12.1"/>
|
||||
<androidPackage spec="com.github.bumptech.glide:glide:4.9.0"/>
|
||||
</androidPackages>
|
||||
</dependencies>
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31bf077fc98a646eba2c2bbab09fa1dd
|
||||
guid: b942c862531b54da5887a4aa6bc1c1e9
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user