Example #1
0
 public static void SendInterstitialImpression(TapdaqInterstitialAd ad)
 {
     if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor)
     {
         Debug.Log("Tapdaq Dummy: Send Interstitial Impression");
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
                     #if UNITY_IPHONE
         _SendInterstitialImpression(ad.pointer);
                     #endif
     }
 }
Example #2
0
    void Awake()
    {
        if (TDinstance != null)           // Ensuring no clones
        {
            Destroy(gameObject);
            return;
        }
        //Make the plugin available across all scenes
        TDinstance = this;
        GameObject.DontDestroyOnLoad(gameObject);
        settings   = GetComponent <TapdaqSettings>();
        view       = GetComponent <TapdaqView>();
        closeImage = Resources.Load("tdCircle") as Texture;


        //Apply All Settings
        showLogMessages = settings.showLogs;
        _TEST_MODE_     = settings.testMode;

        ios_applicationID     = settings.ios_applicationID;
        ios_clientKey         = settings.ios_clientKey;
        android_applicationID = settings.android_applicationID;
        android_clientKey     = settings.android_clientKey;

        frequency = settings.frequency;
        duration  = settings.duration;

        interstitials = settings.interstitials;
        //interstitialPortrait = settings.interstitialPortrait;
        //interstitialLandscape = settings.interstitialLandscape;


        nativeSquareLarge  = settings.nativeSquareLarge;
        nativeSquareMedium = settings.nativeSquareMedium;
        nativeSquareSmall  = settings.nativeSquareSmall;

        nativeNewsfeedPortraitLarge  = settings.nativeNewsfeedPortraitLarge;
        nativeNewsfeedPortraitMedium = settings.nativeNewsfeedPortraitMedium;
        nativeNewsfeedPortraitSmall  = settings.nativeNewsfeedPortraitSmall;

        nativeNewsfeedLandscapeLarge  = settings.nativeNewsfeedLandscapeLarge;
        nativeNewsfeedLandscapeMedium = settings.nativeNewsfeedLandscapeMedium;
        nativeNewsfeedLandscapeSmall  = settings.nativeNewsfeedLandscapeSmall;

        nativeFullscreenPortraitLarge  = settings.nativeFullscreenPortraitLarge;
        nativeFullscreenPortraitMedium = settings.nativeFullscreenPortraitMedium;
        nativeFullscreenPortraitSmall  = settings.nativeFullscreenPortraitSmall;

        nativeFullscreenLandscapeLarge  = settings.nativeFullscreenLandscapeLarge;
        nativeFullscreenLandscapeMedium = settings.nativeFullscreenLandscapeMedium;
        nativeFullscreenLandscapeSmall  = settings.nativeFullscreenLandscapeSmall;

        nativeStripPortraitLarge  = settings.nativeStripPortraitLarge;
        nativeStripPortraitMedium = settings.nativeStripPortraitMedium;
        nativeStripPortraitSmall  = settings.nativeStripPortraitSmall;

        nativeStripLandscapeLarge  = settings.nativeStripLandscapeLarge;
        nativeStripLandscapeMedium = settings.nativeStripLandscapeMedium;
        nativeStripLandscapeSmall  = settings.nativeStripLandscapeSmall;


        if (showLogMessages)
        {
            Debug.Log("TapdaqSDK/Test Mode Active? -- " + _TEST_MODE_);
#if UNITY_IPHONE
            Debug.Log("TapdaqSDK/Application ID -- " + ios_applicationID);
            Debug.Log("TapdaqSDK/Client Key -- " + ios_clientKey);
#elif UNITY_ANDROID
            Debug.Log("TapdaqSDK/Application ID -- " + android_applicationID);
            Debug.Log("TapdaqSDK/Client Key -- " + android_clientKey);
#endif

            Debug.Log("TapdaqSDK/Ad Frequency -- " + frequency);
            Debug.Log("TapdaqSDK/Ad Duration -- " + duration);

            //if(interstitialPortrait)Debug.Log("TapdaqSDK/Portrait Interstitials enabled");
            //if(interstitialLandscape)Debug.Log("TapdaqSDK/Landscape Interstitials enabled");

            if (interstitials)
            {
                if (Screen.width >= Screen.height)
                {
                    Debug.Log("TapdaqSDK/Landscape Interstitials enabled");
                }
                else
                {
                    Debug.Log("TapdaqSDK/Portrait Interstitials enabled");
                }
            }

            if (nativeSquareLarge)
            {
                Debug.Log("TapdaqSDK/Native Square Large enabled");
            }
            if (nativeSquareMedium)
            {
                Debug.Log("TapdaqSDK/Native Square Medium enabled");
            }
            if (nativeSquareSmall)
            {
                Debug.Log("TapdaqSDK/Native Square Small enabled");
            }

            if (nativeNewsfeedPortraitLarge)
            {
                Debug.Log("TapdaqSDK/Native News Feed Portrait Large enabled");
            }
            if (nativeNewsfeedPortraitMedium)
            {
                Debug.Log("TapdaqSDK/Native News Feed Portrait Medium enabled");
            }
            if (nativeNewsfeedPortraitSmall)
            {
                Debug.Log("TapdaqSDK/Native News Feed Portrait Small enabled");
            }

            if (nativeNewsfeedLandscapeLarge)
            {
                Debug.Log("TapdaqSDK/Native News Feed Landscape Large enabled");
            }
            if (nativeNewsfeedLandscapeMedium)
            {
                Debug.Log("TapdaqSDK/Native News Feed Landscape Medium enabled");
            }
            if (nativeNewsfeedLandscapeSmall)
            {
                Debug.Log("TapdaqSDK/Native News Feed Landscape Small enabled");
            }

            if (nativeFullscreenPortraitLarge)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Portrait Large enabled");
            }
            if (nativeFullscreenPortraitMedium)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Portrait Medium enabled");
            }
            if (nativeFullscreenPortraitSmall)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Portrait Small enabled");
            }

            if (nativeFullscreenLandscapeLarge)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Landscape Large enabled");
            }
            if (nativeFullscreenLandscapeMedium)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Landscape Medium enabled");
            }
            if (nativeFullscreenLandscapeSmall)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Landscape Small enabled");
            }

            if (nativeStripPortraitLarge)
            {
                Debug.Log("TapdaqSDK/Native Strip Portrait Large enabled");
            }
            if (nativeStripPortraitMedium)
            {
                Debug.Log("TapdaqSDK/Native Strip Portrait Medium enabled");
            }
            if (nativeStripPortraitSmall)
            {
                Debug.Log("TapdaqSDK/Native Strip Portrait Small enabled");
            }

            if (nativeStripLandscapeLarge)
            {
                Debug.Log("TapdaqSDK/Native Strip Landscape Large enabled");
            }
            if (nativeStripLandscapeMedium)
            {
                Debug.Log("TapdaqSDK/Native Strip Landscape Medium enabled");
            }
            if (nativeStripLandscapeSmall)
            {
                Debug.Log("TapdaqSDK/Native Strip Landscape Small enabled");
            }
        }

//		group = ns_group;
//		interstitialCanvas = ns_interstitialCanvas;
//		interstitialPortraitImage = ns_interstitialPortraitImage;
//		interstitialLandscapeImage = ns_interstitialLandscapeImage;

        //Initialize tapdaq and commence ad caching
        BuildEnabledAdTypesList();
#if UNITY_IPHONE
        GenerateCallbacks();
        TDinitialize(ios_applicationID, ios_clientKey, frequency, duration, flatList);
#elif UNITY_ANDROID
        TDinitialize(android_applicationID, android_clientKey, frequency, duration, flatList);
#endif

        externalInterstitial = new TapdaqInterstitialAd();
        externalNative       = new TapdaqNativeAd();
    }