// 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); } }
// 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 }
void OnGUI() { beginColumn(); if (GUILayout.Button("Init")) { // replace with your app ID!!! VungleAndroid.init("com.prime31.Vungle"); } if (GUILayout.Button("Is Sound Enabled?")) { Debug.Log("is sound enabled? " + VungleAndroid.isSoundEnabled()); } if (GUILayout.Button("Set Sound Enabled")) { VungleAndroid.setSoundEnabled(true); } if (GUILayout.Button("Is Video Available?")) { Debug.Log("is video available? " + VungleAndroid.isVideoAvailable()); } if (GUILayout.Button("Set Ad Orientation to AutoRotate")) { VungleAndroid.setAdOrientation(VungleAdOrientation.AutoRotate); } endColumn(true); if (GUILayout.Button("Play Ad")) { VungleAndroid.playAd(); } if (GUILayout.Button("Play Insentivised Ad")) { VungleAndroid.playAd(true, "some-user"); } endColumn(); }
// 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 }
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 }
void OnGUI() { beginColumn(); if (GUILayout.Button("Init")) { // replace with your app ID!!! VungleAndroid.init("com.prime31.Vungle"); } if (GUILayout.Button("Is Video Available?")) { Debug.Log("is video available? " + VungleAndroid.isVideoAvailable()); } if (GUILayout.Button("Is Sound Enabled?")) { Debug.Log("is sound enabled? " + VungleAndroid.isSoundEnabled()); } endColumn(true); if (GUILayout.Button("Display Advert")) { VungleAndroid.displayAdvert(); } if (GUILayout.Button("Display Incentivized Advert")) { VungleAndroid.displayIncentivizedAdvert(true); } endColumn(); }
public static void init(string androidAppId, string iosAppId, int age, VungleGender gender) { #if UNITY_IPHONE var userData = new Dictionary <string, object>(); if (age > 0) { userData["gender"] = (int)gender + 1; userData["age"] = age; } VungleBinding.startWithAppIdAndUserData(iosAppId, userData); #elif UNITY_ANDROID if (age > 0) { VungleAndroid.init(androidAppId, age, gender); } else { VungleAndroid.init(androidAppId); } #endif }