示例#1
0
        private void RegisterAdapters()
        {
            var testDevices         = new TestDevicesList(settings.testDevices, TestDeviceType.Android);
            var adMobDevicesJson    = testDevices.GetAdMobListJson();
            var facebookDevicesJson = testDevices.GetFacebookListJson();

            Debug.Log("adMobDevicesJson=" + adMobDevicesJson);
            Debug.Log("facebookDevicesJson=" + facebookDevicesJson);

            foreach (var adapterName in Enum.GetNames(typeof(TapdaqAdapter)))
            {
                var androidAdapter = TDEnumHelper.FixAndroidAdapterName(adapterName);
                var shortName      = androidAdapter.Replace("Adapter", "");

                var className = "com.tapdaq.tapdaq" + shortName.ToLower() + "." + androidAdapter;

                if (androidAdapter == "FacebookAdapter")
                {
                    CallAndroidStaticMethodFromClass(className, "RegisterAdapter", false, facebookDevicesJson);
                }
                else if (androidAdapter == "AdMobAdapter")
                {
                    CallAndroidStaticMethodFromClass(className, "RegisterAdapter", false, adMobDevicesJson);
                }
                else
                {
                    CallAndroidStaticMethodFromClass(className, "RegisterAdapter", false);
                }
            }
        }
示例#2
0
        private void Initialize(string appID, string clientKey)
        {
            LogUnsupportedPlatform();

            LogMessage(TDLogSeverity.debug, "TapdaqSDK/Initializing");
            var adTags = settings.tags.GetTagsJson();

            Debug.Log("tags:\n" + adTags);

                        #if UNITY_IPHONE
            var testDevices = new TestDevicesList(settings.testDevices, TestDeviceType.iOS).ToString();
            Debug.Log("testDevices:\n" + testDevices);
            CallIosMethod(() => _ConfigureTapdaq(appID, clientKey, adTags, testDevices));
                        #elif UNITY_ANDROID
            RegisterAdapters();
            CallAndroidStaticMethod("InitiateTapdaq", appID, clientKey, adTags);
                        #endif
        }
示例#3
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
        }