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());
    }
예제 #2
0
        void _didClick(string jsonMessage)
        {
            TDDebugLogger.Log("_onAdClick " + jsonMessage);
            var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage);

            TDCallbacks.instance.OnAdClicked(adEvent);
        }
예제 #3
0
        void _didFailToDisplay(string jsonMessage)
        {
            TDDebugLogger.Log("_didFailToDisplay " + jsonMessage);
            var adEvent = JsonUtility.FromJson <TDAdEvent>(jsonMessage);

            TDCallbacks.instance.OnAdDidFailToDisplay(adEvent);
        }
예제 #4
0
        // banner
        void _didRefresh(string jsonMessage)
        {
            TDDebugLogger.Log("_didRefresh " + jsonMessage);
            var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage);

            TDCallbacks.instance.OnAdRefresh(adEvent);
        }
예제 #5
0
        void _didVerify(string message)
        {
            TDDebugLogger.Log("_didVerify " + message);
            var reward = JsonUtility.FromJson <TDVideoReward> (message);

            TDCallbacks.instance.OnRewardedVideoValidated(reward);
        }
예제 #6
0
        void _onValidationFailed(string jsonMessage)
        {
            TDDebugLogger.Log("_onValidationFailed " + jsonMessage);
            var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage);

            TDCallbacks.instance.OnAdError(adEvent);
        }
예제 #7
0
        void _didFailToLoad(string jsonMessage)
        {
            TDDebugLogger.Log("_didFailToLoad " + jsonMessage);
            var adEvent = JsonUtility.FromJson <TDAdEvent> (jsonMessage);

            TDCallbacks.instance.OnAdNotAvailable(adEvent);
        }
예제 #8
0
        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);
            }
        }
예제 #9
0
        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);
                    }
                }
            }
        }
예제 #10
0
        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
        }
예제 #11
0
 public void _UnexpectedErrorHandler(string msg)
 {
     TDDebugLogger.Log(":: Ad test ::" + msg);
     LogMessage(TDLogSeverity.error, msg);
 }
예제 #12
0
 void _didEngagement(string adType)
 {
     TDDebugLogger.Log("_didEngagement " + adType);
 }
예제 #13
0
 void _onUserDeclined(string adType)
 {
     TDDebugLogger.Log("_onUserDeclined " + adType);
     TDCallbacks.instance.OnAdClosed(new TDAdEvent(adType, "DECLINED_TO_VIEW"));
 }
예제 #14
0
 void _onRejected(string adType)
 {
     TDDebugLogger.Log("_onRejected " + adType);
     TDCallbacks.instance.OnAdError(new TDAdEvent(adType, "VALIDATION_REJECTED"));
 }
예제 #15
0
 // reeward video
 void _didReachLimit(string adType)
 {
     TDDebugLogger.Log("_didReachLimit " + adType);
     TDCallbacks.instance.OnAdError(new TDAdEvent(adType, "VALIDATION_EXCEEDED_QUOTA"));
 }
예제 #16
0
 public void FetchFailed(string msg)
 {
     TDDebugLogger.Log(msg);
     LogMessage(TDLogSeverity.debug, "unable to fetch more ads");
 }
예제 #17
0
 // video
 void _didComplete(string adType)
 {
     TDDebugLogger.Log("_didComplete " + adType);
 }