// Obtem o video
    public override void fetchVideo(bool force)
    {
        try
        {
            if (!force && tried_fetching_video)
            {
                return;
            }

            base.fetchVideo(force);

            if (Info.IsEditor())
            {
                return;
            }

                        #if UNITY_ANDROID
            Initializate.AddPrefab("VungleAndroidManager", typeof(VungleAndroidManager));

            VungleAndroid.init(key);
                        #elif UNITY_IPHONE
            Initializate.AddPrefab("VungleManager", typeof(VungleManager));

            VungleBinding.startWithAppId(key);
                        #endif
        }
        catch
        {
            Error(API, ERROR_STARTUP_OBJECT);
        }
    }
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Start"))
        {
            // replace with your app ID!!!
            VungleBinding.startWithAppId("vungleTest");
        }


        if (GUILayout.Button("Start with Custom User Data"))
        {
            var userData = new Dictionary <string, object>();
            userData["gender"]          = 1;    // 0 unknown, 1 male, 2 female
            userData["adOrientation"]   = 1;    // 0 unknown, 1 portrait, 2 landscape
            userData["locationEnabled"] = true;
            userData["age"]             = 21;
            VungleBinding.startWithAppIdAndUserData("vungleTest", userData);
        }


        if (GUILayout.Button("Is Ad Available"))
        {
            Debug.Log("is ad available: " + VungleBinding.isAdAvailable());
        }


        if (GUILayout.Button("Play Modal Ad"))
        {
            VungleBinding.playModalAd(true);
        }


        endColumn(true);


        if (GUILayout.Button("Set Cache Size"))
        {
            VungleBinding.setCacheSize(12);
        }


        if (GUILayout.Button("Enable Logging"))
        {
            VungleBinding.enableLogging(true);
        }


        if (GUILayout.Button("Play Insentivised Ad"))
        {
            VungleBinding.playIncentivizedAd("user", true);
        }

        endColumn();
    }
Beispiel #3
0
    // Initializes the Vungle SDK. Pass in your Android and iOS app ID's from the Vungle web portal.
    public static void init(string androidAppId, string iosAppId, string winAppId = "")
    {
#if UNITY_IPHONE
        VungleBinding.startWithAppId(iosAppId, PLUGIN_VERSION);
#elif UNITY_ANDROID
        VungleAndroid.init(androidAppId, PLUGIN_VERSION);
#elif UNITY_WSA_10_0
        VungleWin.init(winAppId, PLUGIN_VERSION);
#endif
    }
Beispiel #4
0
    // Initializes the Vungle SDK. Pass in your Android and iOS app ID's from the Vungle web portal.
    public static void init(string androidAppId, string iosAppId, string winAppId = "")
    {
#if UNITY_EDITOR
        return;
#endif
#if UNITY_IPHONE
        VungleBinding.startWithAppId(iosAppId, PLUGIN_VERSION);
#elif UNITY_ANDROID
        VungleAndroid.init(androidAppId, PLUGIN_VERSION);
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        VungleWin.init(winAppId, PLUGIN_VERSION);
#endif
    }
Beispiel #5
0
    public static void init(string appId, bool initHeaderBiddingDelegate)
    {
#if (!VUNGLE_AD_OFF)
#if UNITY_EDITOR
        return;
#endif
#if UNITY_IPHONE
        VungleBinding.startWithAppId(appId, PLUGIN_VERSION, initHeaderBiddingDelegate);
#elif UNITY_ANDROID
        VungleAndroid.init(appId, PLUGIN_VERSION);
#elif UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_METRO
        VungleWin.init(appId, PLUGIN_VERSION);
        VungleSceneLoom.Initialize();
#endif
#endif
    }
    // Use this for initialization
    void Awake()
    {
        //Set Static flags
        ChartBoostActiveStaticFlag = ChartBoostActiveFlag;
        RevMobActiveStaticFlag     = RevMobActiveFlag;
        AdMobActiveStaticFlag      = AdMobActiveFlag;
        PlayHavenActiveStaticFlag  = PlayHavenActiveFlag;
        IAdsActiveStaticFlag       = IAdsActiveFlag;
        TapJoyActiveStaticFlag     = TapJoyActiveFlag;
        VungleActiveStaticFlag     = VungleActiveFlag;
        FlurryActiveStaticFlag     = FlurryActiveFlag;
        AppLovinStaticFlag         = AppLovinFlag;

        //Initialize ChartBoost
        if (ChartBoostActiveFlag)
        {
            ChartBoostBinding.init(ChartBoostID, ChartBoostSIG, false);
            ChartBoostBinding.cacheInterstitial(null);
            ChartBoostBinding.cacheMoreApps();
        }

        //Initialize RevMob
        if (RevMobActiveFlag)
        {
            REVMOB_APP_IDS.Add("IOS", RevMobID);
            revMobSession = RevMob.Start(REVMOB_APP_IDS);
        }

        //Initialize Admob
        if (AdMobActiveFlag)
        {
            AdMobBinding.init(AdMobID);
        }

        //Initialize Playhaven
        if (PlayHavenActiveFlag)
        {
            gameObject.SendMessage("OpenNotification");
        }

        //Initialize iAds
        if (IAdsActiveFlag)
        {
        }

        //Initialize TapJoy
        if (TapJoyActiveFlag)
        {
            TapjoyPluginIOS.RequestTapjoyConnect(TapJoyID, TapJoySecretKey);
            Debug.Log("Tapjoy integrated");
        }

        //Initialize Vungle
        if (VungleActiveFlag)
        {
            VungleBinding.startWithAppId(VungleID);
        }

        //Initialize Flurry
        if (FlurryActiveFlag)
        {
            FlurryBinding.startSession(FlurryID);
            //FlurryBinding.logEvent("Testing session started", false);
        }

        if (AppLovinFlag)
        {
            AppLovin.SetSdkKey(AppLovinID);
            AppLovin.InitializeSdk();
        }
    }