public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject) { if (buildTarget != BuildTarget.iOS) { return; } TDDebugLogger.Log("OnPostprocessBuild - Path: " + pathToBuiltProject); EditorPrefs.SetString(BuildPathKey, pathToBuiltProject); var path = PBXProject.GetPBXProjectPath(pathToBuiltProject); if (!File.Exists(path)) { TDDebugLogger.LogError(string.Format("pbxproj '{0}' does not exists", path)); return; } var proj = new PBXProject(); proj.ReadFromString(File.ReadAllText(path)); var unityIPhoneTargetGuid = GetUnityIPhoneTargetGuid(path); SetPListProperties(pathToBuiltProject); proj.UpdateBuildProperty(unityIPhoneTargetGuid, "OTHER_LDFLAGS", new string [] { "-ObjC" }, new string [] {}); File.WriteAllText(path, proj.WriteToString()); }
void _didClick(string jsonMessage) { TDDebugLogger.Log("_onAdClick " + jsonMessage); var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage); TDCallbacks.instance.OnAdClicked(adEvent); }
void _didFailToDisplay(string jsonMessage) { TDDebugLogger.Log("_didFailToDisplay " + jsonMessage); var adEvent = JsonUtility.FromJson <TDAdEvent>(jsonMessage); TDCallbacks.instance.OnAdDidFailToDisplay(adEvent); }
// banner void _didRefresh(string jsonMessage) { TDDebugLogger.Log("_didRefresh " + jsonMessage); var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage); TDCallbacks.instance.OnAdRefresh(adEvent); }
void _didVerify(string message) { TDDebugLogger.Log("_didVerify " + message); var reward = JsonUtility.FromJson <TDVideoReward> (message); TDCallbacks.instance.OnRewardedVideoValidated(reward); }
void _onValidationFailed(string jsonMessage) { TDDebugLogger.Log("_onValidationFailed " + jsonMessage); var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage); TDCallbacks.instance.OnAdError(adEvent); }
void _didFailToLoad(string jsonMessage) { TDDebugLogger.Log("_didFailToLoad " + jsonMessage); var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage); TDCallbacks.instance.OnAdNotAvailable(adEvent); }
public static void LogMessage(TDLogSeverity severity, string message) { string prefix = "Tapdaq Unity SDK: "; if (severity == TDLogSeverity.warning) { TDDebugLogger.LogWarning(prefix + message); } else if (severity == TDLogSeverity.error) { TDDebugLogger.LogError(prefix + message); } else { TDDebugLogger.Log(prefix + message); } }
private static void CallAndroidStaticMethodFromClass(string className, string methodName, bool logException, params object[] paramList) { TDEventHandler.instance.Init(); LogUnsupportedPlatform(); if (Application.platform == RuntimePlatform.Android) { try { using (AndroidJavaClass androidClass = new AndroidJavaClass(className)) { androidClass.CallStatic(methodName, paramList); } } catch (Exception e) { if (logException) { TDDebugLogger.Log("CallAndroidStaticMethod: " + methodName + " FromClass: " + className + " failed. Message: " + e.Message); } } } }
private void Initialize(string appID, string clientKey, TDStatus isUserSubjectToGDPR, TDStatus isConsentGiven, TDStatus isAgeRestrictedUser, string userId, bool shouldForwardUserId) { LogUnsupportedPlatform(); LogMessage(TDLogSeverity.debug, "TapdaqSDK/Initializing"); #if UNITY_IPHONE CallIosMethod(() => TD_SetPluginTools(Application.unityVersion)); var testDevices = new TestDevicesList(settings.testDevices, TestDeviceType.iOS).ToString(); TDDebugLogger.Log("testDevices:\n" + testDevices); CallIosMethod(() => TD_ConfigureTapdaq(appID, clientKey, testDevices, settings.isDebugMode, settings.autoReloadAds, TDSettings.pluginVersion, (int)isUserSubjectToGDPR, (int)isConsentGiven, (int)isAgeRestrictedUser, userId, shouldForwardUserId)); #elif UNITY_ANDROID CallAndroidStaticMethod("SetPluginTools", Application.unityVersion); var testDevices = new TestDevicesList(settings.testDevices, TestDeviceType.Android).ToString(); TDDebugLogger.Log("testDevices:\n" + testDevices); CallAndroidStaticMethod("InitiateTapdaq", appID, clientKey, testDevices, settings.isDebugMode, settings.autoReloadAds, TDSettings.pluginVersion, (int)isUserSubjectToGDPR, (int)isConsentGiven, (int)isAgeRestrictedUser, userId, shouldForwardUserId); #endif }
public void _UnexpectedErrorHandler(string msg) { TDDebugLogger.Log(":: Ad test ::" + msg); LogMessage(TDLogSeverity.error, msg); }
void _didEngagement(string adType) { TDDebugLogger.Log("_didEngagement " + adType); }
void _onUserDeclined(string adType) { TDDebugLogger.Log("_onUserDeclined " + adType); TDCallbacks.instance.OnAdClosed(new TDAdEvent(adType, "DECLINED_TO_VIEW")); }
void _onRejected(string adType) { TDDebugLogger.Log("_onRejected " + adType); TDCallbacks.instance.OnAdError(new TDAdEvent(adType, "VALIDATION_REJECTED")); }
// reeward video void _didReachLimit(string adType) { TDDebugLogger.Log("_didReachLimit " + adType); TDCallbacks.instance.OnAdError(new TDAdEvent(adType, "VALIDATION_EXCEEDED_QUOTA")); }
public void FetchFailed(string msg) { TDDebugLogger.Log(msg); LogMessage(TDLogSeverity.debug, "unable to fetch more ads"); }
// video void _didComplete(string adType) { TDDebugLogger.Log("_didComplete " + adType); }