コード例 #1
0
    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);
 }