// Token: 0x06000043 RID: 67 RVA: 0x0000381C File Offset: 0x00001C1C
        public static CBInPlay getInPlay(CBLocation location)
        {
            CBExternal.Log("Android : getInPlay at location = " + location.ToString());
            if (!CBExternal.checkInitialized())
            {
                return(null);
            }
            if (location == null)
            {
                Debug.LogError("Chartboost SDK: location passed is null cannot perform the operation requested");
                return(null);
            }
            CBInPlay result;

            try
            {
                AndroidJavaObject inPlayAd = CBExternal._plugin.Call <AndroidJavaObject>("getInPlay", new object[]
                {
                    location.ToString()
                });
                CBInPlay cbinPlay = new CBInPlay(inPlayAd, CBExternal._plugin);
                result = cbinPlay;
            }
            catch
            {
                result = null;
            }
            return(result);
        }
Beispiel #2
0
        public static CBInPlay getInPlay(CBLocation location)
        {
            if (!checkInitialized())
            {
                return(null);
            }
            else if (location == null)
            {
                Debug.LogError("Chartboost SDK: location passed is null cannot perform the operation requested");
                return(null);
            }

            IntPtr inPlayId = _chartBoostGetInPlay(location.ToString());

            // No Inplay was available right now
            if (inPlayId == IntPtr.Zero)
            {
                return(null);
            }

            CBInPlay inPlayAd = new CBInPlay(inPlayId);

            Log("iOS : getInPlay at location = " + location.ToString());
            return(inPlayAd);
        }
Beispiel #3
0
        public static CBInPlay getInPlay(CBLocation location)
        {
            Log("Android : getInPlay at location = " + location.ToString());

            if (!checkInitialized())
            {
                return(null);
            }

            else if (location == null)
            {
                Debug.LogError("Chartboost SDK: location passed is null cannot perform the operation requested");

                return(null);
            }

            try

            {
                AndroidJavaObject androidInPlayAd = _plugin.Call <AndroidJavaObject>("getInPlay", location.ToString());

                CBInPlay inPlayAd = new CBInPlay(androidInPlayAd, _plugin);

                return(inPlayAd);
            }

            catch

            {
                return(null);
            }
        }
	void LayoutButtons()
	{
		// The view with buttons to trigger the main Chartboost API calls
		GUILayout.Space(5);
		GUILayout.Label("Has Interstitial: " + hasInterstitial);

		if (GUILayout.Button("Cache Interstitial", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.cacheInterstitial(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show Interstitial", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.showInterstitial(CBLocation.Default);
		}
		
		GUILayout.Space(5);
		GUILayout.Label("Has MoreApps: " + hasMoreApps);
		if (GUILayout.Button("Cache More Apps", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.cacheMoreApps(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show More Apps", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.showMoreApps(CBLocation.Default);
		}
		
		GUILayout.Space(5);
		GUILayout.Label("Has Rewarded Video: " + hasRewardedVideo);
		if (GUILayout.Button("Cache Rewarded Video", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.cacheRewardedVideo(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show Rewarded Video", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.showRewardedVideo(CBLocation.Default);
		}
		
		GUILayout.Space(5);
		GUILayout.Label("Has InPlay: " + hasInPlay);
		if (GUILayout.Button("Cache InPlay Ad", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.cacheInPlay(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show InPlay Ad", GUILayout.Width(ELEMENT_WIDTH))) {
			inPlayAd = Chartboost.getInPlay(CBLocation.Default);
			if(inPlayAd != null) {
				inPlayAd.show();
			}
		}
		if(inPlayAd != null) {
			// Set the texture of InPlay Ad Icon
			// Link its onClick() event with inPlay's click()
			GUILayout.Label("app: " + inPlayAd.appName);
			if(GUILayout.Button(inPlayAd.appIcon, GUILayout.Width(ELEMENT_WIDTH))) {
				inPlayAd.click();
			}
		}

		GUILayout.Space(5);
		GUILayout.Label("Post install events:");
		if (GUILayout.Button("Send PIA Main Level Event", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, "Test Send mail level Information");
		}
		
		if (GUILayout.Button("Send PIA Sub Level Event", GUILayout.Width(ELEMENT_WIDTH))) {
			Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, 2, "Test Send sub level Information");
		}

		if (GUILayout.Button("Track IAP", GUILayout.Width(ELEMENT_WIDTH))) {
			TrackIAP();
		}
	}
	void OnGUI() {
/*
#if UNITY_ANDROID
		// Disable user input for GUI when impressions are visible
		// This is only necessary on Android if we have disabled impression activities
		//   by having called CBBinding.init(ID, SIG, false), as that allows touch
		//   events to leak through Chartboost impressions
		GUI.enabled = !Chartboost.isImpressionVisible();
#endif
*/
		GUI.matrix = Matrix4x4.Scale(new Vector3(2, 2, 2));
		
		if (GUILayout.Button("Cache Interstitial")) {
			Chartboost.cacheInterstitial(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show Interstitial")) {
			Chartboost.showInterstitial(CBLocation.Default);
		}
		
		if (GUILayout.Button("Cache More Apps")) {
			Chartboost.cacheMoreApps(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show More Apps")) {
			Chartboost.showMoreApps(CBLocation.Default);
		}
		
		if (GUILayout.Button("Cache Rewarded Video")) {
			Chartboost.cacheRewardedVideo(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show Rewarded Video")) {
			Chartboost.showRewardedVideo(CBLocation.Default);
		}
		
		if (GUILayout.Button("Cache InPlay Ad")) {
			Chartboost.cacheInPlay(CBLocation.Default);
		}
		
		if (GUILayout.Button("Show InPlay Ad")) {
			inPlayAd = Chartboost.getInPlay(CBLocation.Default);
			if(inPlayAd != null) {
				// Set the texture of InPlay Ad Icon
				// Link its onClick() event with inPlay's click()
				inPlayIcon.guiTexture.texture = inPlayAd.appIcon;
				inPlayText.guiText.text = inPlayAd.appName;
				inPlayAd.show();
			}
		}
		
	}
Beispiel #6
0
 public static CBInPlay getInPlay(CBLocation location)
 {
     Log("Android : getInPlay at location = " + location.ToString());
     if (!checkInitialized())
         return null;
     else if(location == null) {
         Debug.LogError("Chartboost SDK: location passed is null cannot perform the operation requested");
         return null;
     }
     try
     {
         AndroidJavaObject androidInPlayAd = _plugin.Call<AndroidJavaObject>("getInPlay", location.ToString());
         CBInPlay inPlayAd = new CBInPlay(androidInPlayAd, _plugin);
         return inPlayAd;
     }
     catch
     {
         return null;
     }
 }
Beispiel #7
0
        public static CBInPlay getInPlay(CBLocation location)
        {
            if (!checkInitialized())
                return null;
            else if(location == null) {
                Debug.LogError("Chartboost SDK: location passed is null cannot perform the operation requested");
                return null;
            }

            IntPtr inPlayId = _chartBoostGetInPlay(location.ToString());
            // No Inplay was available right now
            if(inPlayId == IntPtr.Zero) {
                return null;
            }

            CBInPlay inPlayAd = new CBInPlay(inPlayId);
            Log("iOS : getInPlay at location = " + location.ToString());
            return inPlayAd;
        }