You've already forked Commercialization.topon
release: 1.4.7
This commit is contained in:
@@ -9,11 +9,13 @@ namespace AnyThinkAds.Android
|
||||
public class ATSDKAPIClient : AndroidJavaProxy, IATSDKAPIClient
|
||||
{
|
||||
private AndroidJavaObject sdkInitHelper;
|
||||
private AndroidJavaClass sdkClass;
|
||||
private ATSDKInitListener sdkInitListener;
|
||||
public ATSDKAPIClient () : base("com.anythink.unitybridge.sdkinit.SDKInitListener")
|
||||
{
|
||||
this.sdkInitHelper = new AndroidJavaObject(
|
||||
"com.anythink.unitybridge.sdkinit.SDKInitHelper", this);
|
||||
this.sdkClass = new AndroidJavaClass("com.anythink.core.api.ATSDK");
|
||||
}
|
||||
|
||||
public void initSDK(string appId, string appKey)
|
||||
@@ -390,5 +392,59 @@ namespace AnyThinkAds.Android
|
||||
Debug.Log("ATSDKAPIClient : error." + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void start()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.sdkClass != null)
|
||||
{
|
||||
this.sdkClass.CallStatic("start");
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
System.Console.WriteLine("Exception caught: {0}", e);
|
||||
Debug.Log("ATSDKAPIClient : start error." + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public bool isCnSDK()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.sdkClass != null)
|
||||
{
|
||||
return this.sdkClass.CallStatic<bool>("isCnSDK");
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
System.Console.WriteLine("Exception caught: {0}", e);
|
||||
Debug.Log("ATSDKAPIClient : isCnSDK error." + e.Message);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setLocalStrategyAssetPath(string assetPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.sdkClass != null)
|
||||
{
|
||||
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
using (AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
this.sdkClass.CallStatic("setLocalStrategyAssetPath", currentActivity, assetPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
System.Console.WriteLine("Exception caught: {0}", e);
|
||||
Debug.Log("ATSDKAPIClient : setLocalStrategyAssetPath error." + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user