public class Chartboost
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Chartboost.CBFramework
Used with setFramework(final CBFramework framework) calls to set suffix for
wrapper libraries like Unity or Corona.
|
static class |
Chartboost.CBMediation
Used with setMediation(final CBMediation medation, final String libraryVersion) calls to set suffix for
wrapper libraries like Unity or Corona.
|
static class |
Chartboost.CBPIDataUseConsent
GDPR compliance settings:
UNKNOWN(-1) means the publisher hasn't implemented functionality or the user has the option to not answer
NO_BEHAVIORAL(0) means the user does not consent to targeting (Contextual ads)
YES_BEHAVIORAL(1) means the user consents (Behavioral and Contextual Ads)
|
Modifier and Type | Method and Description |
---|---|
static void |
cacheInterstitial(java.lang.String location)
Cache an interstitial with a location argument
|
static void |
cacheInterstitial(java.lang.String location,
java.lang.String bidResponseJson)
Cache an interstitial with a location argument with the given JSON object
|
static void |
cacheMoreApps(java.lang.String location)
Deprecated.
Support for MoreApps has been removed as of SDK 7.
|
static void |
cacheRewardedVideo(java.lang.String location)
Cache an rewarded interstitial with a default location argument
|
static void |
cacheRewardedVideo(java.lang.String location,
java.lang.String bidResponseJson) |
static void |
closeImpression()
Deprecated.
This method and its functionality are no-op and it will be removed in a future release
|
static boolean |
getAutoCacheAds()
Return whether or not a new impression of the same type and location
is automatically cached when one is shown.
|
static java.lang.String |
getCustomId()
Get the current custom identifier being sent in the POST body for all Chartboost API server requests.
|
static com.chartboost.sdk.AbstractChartboostDelegate |
getDelegate() |
static com.chartboost.sdk.Libraries.CBLogging.Level |
getLoggingLevel() |
static Chartboost.CBPIDataUseConsent |
getPIDataUseConsent()
Gets the GDPR status.
|
static java.lang.String |
getSDKVersion() |
static boolean |
hasInterstitial(java.lang.String location)
Check interstitial cache with a location argument
|
static boolean |
hasMoreApps(java.lang.String location)
Deprecated.
Support for MoreApps has been removed as of SDK 7.
|
static boolean |
hasRewardedVideo(java.lang.String location)
Check rewarded interstitial cache with a location argument
|
static boolean |
isAnyViewVisible()
Check to see if any chartboost ad views are visible
|
static boolean |
isWebViewEnabled() |
static boolean |
onBackPressed()
Required method: MUST called by the host activity in its
onBackPressed() method. |
static void |
onCreate(android.app.Activity activity)
Required method: MUST be called by the host activity in its
onCreate method.
Sets up Chartboost to run in your activity. |
static void |
onDestroy(android.app.Activity activity)
Required method: MUST called by the host activity in its
onDestroy() method |
static void |
onPause(android.app.Activity activity)
[VIDEO ONLY] Required method: MUST called by the host activity in its
onPause() method.
Lets Chartboost know that an activity using Chartboost has been paused. |
static void |
onResume(android.app.Activity activity)
[VIDEO ONLY] Required method: MUST called by the host activity in its
onResume() method.
Lets Chartboost know that an activity using Chartboost has been resumed. |
static void |
onStart(android.app.Activity activity)
Required method: MUST called by the host activity in its
onStart() method.
Lets Chartboost know that an activity using Chartboost has appeared. |
static void |
onStop(android.app.Activity activity)
Required method: MUST called by the host activity in its
onStop() method.
Lets Chartboost know that an activity using Chartboost has disappeared. |
static void |
restrictDataCollection(android.content.Context context,
boolean restrict)
Deprecated.
|
static void |
setActivityAttrs(android.app.Activity activity) |
static void |
setActivityCallbacks(boolean enabled) |
static void |
setAutoCacheAds(boolean autoCacheAds)
Sets whether or not a new impression of the same type and location
is automatically cached when one is shown.
|
static void |
setChartboostWrapperVersion(java.lang.String version)
Set a custom framework SDK version to append to the POST body of every request.
|
static void |
setCustomId(java.lang.String customID)
Set a custom identifier to send in the POST body for all Chartboost API server requests.
|
static void |
setDelegate(ChartboostDelegate delegate)
WARNING: usually you should just use
onCreate(android.app.Activity)
for the functionality provided by this method. |
static void |
setFramework(Chartboost.CBFramework framework,
java.lang.String version)
Set a custom framework.
|
static void |
setFrameworkVersion(java.lang.String version)
Deprecated.
Use
setChartboostWrapperVersion instead |
static void |
setLoggingLevel(com.chartboost.sdk.Libraries.CBLogging.Level lvl)
Set the Chartboost SDK logging level.
|
static void |
setMediation(Chartboost.CBMediation mediation,
java.lang.String libraryVersion)
Set a mediation library.
|
static void |
setPIDataUseConsent(android.content.Context context,
Chartboost.CBPIDataUseConsent consent)
GDPR Compliance method with which you can limit our SDK's data collection.
|
static void |
setShouldDisplayLoadingViewForMoreApps(boolean shouldDisplay)
Deprecated.
Support for MoreApps has been removed as of SDK 7.
|
static void |
setShouldHideSystemUI(java.lang.Boolean hide)
Decide if Chartboost Views should hide the status and navigation bars when being shown
|
static void |
setShouldPrefetchVideoContent(boolean shouldPrefetch)
Decide if Chartboost SDK will attempt to fetch videos from the Chartboost API servers.
|
static void |
setShouldRequestInterstitialsInFirstSession(boolean shouldRequest)
Decide if Chartboost SDK should show interstitials in the first session.
|
static void |
showInterstitial(java.lang.String location)
Load an interstitial with a location argument.
|
static void |
showMoreApps(java.lang.String location)
Deprecated.
Support for MoreApps has been removed as of SDK 7.
|
static void |
showRewardedVideo(java.lang.String location)
Load an rewarded interstitial with a default location argument
Even if the rewarded interstitial is already cached, it is shown asynchronously.
|
static void |
startWithAppId(android.app.Activity activity,
java.lang.String appId,
java.lang.String appSignature)
Start Chartboost with required appId, appSignature and delegate.This method must be executed before any other Chartboost SDK methods can be used.
|
public static void startWithAppId(android.app.Activity activity, java.lang.String appId, java.lang.String appSignature)
activity
- Android Activity
activity instance.appId
- The Chartboost application ID for this application.appSignature
- The Chartboost application signature for this application.public static void setPIDataUseConsent(android.content.Context context, Chartboost.CBPIDataUseConsent consent)
public static Chartboost.CBPIDataUseConsent getPIDataUseConsent()
@Deprecated public static void restrictDataCollection(android.content.Context context, boolean restrict)
setPIDataUseConsent(Context,CBPIDataUseConsent)
instead.
If you pass in a true value, it will equal to Chartboost.CBPIDataUseConsent.NO_BEHAVIORAL
,
while a false value will mean Chartboost.CBPIDataUseConsent.UNKNOWN
.public static void onCreate(android.app.Activity activity)
onCreate
method.
Sets up Chartboost to run in your activity.activity
- : the host activitypublic static void onStart(android.app.Activity activity)
onStart()
method.
Lets Chartboost know that an activity using Chartboost has appeared.activity
- The host activitypublic static void onResume(android.app.Activity activity)
onResume()
method.
Lets Chartboost know that an activity using Chartboost has been resumed.activity
- The host activitypublic static void onPause(android.app.Activity activity)
onPause()
method.
Lets Chartboost know that an activity using Chartboost has been paused.activity
- The host activitypublic static void onStop(android.app.Activity activity)
onStop()
method.
Lets Chartboost know that an activity using Chartboost has disappeared.activity
- The host activitypublic static boolean onBackPressed()
onBackPressed()
method.public static void onDestroy(android.app.Activity activity)
onDestroy()
methodactivity
- The host activitypublic static boolean hasRewardedVideo(java.lang.String location)
location
- The location within the apppublic static void cacheRewardedVideo(java.lang.String location)
location
- The location for the Chartboost impression type.public static void cacheRewardedVideo(java.lang.String location, java.lang.String bidResponseJson)
public static void showRewardedVideo(java.lang.String location)
location
- The location for the Chartboost impression type.public static boolean hasInterstitial(java.lang.String location)
location
- The location for the Chartboost impression type.public static void cacheInterstitial(java.lang.String location)
location
- The location for the Chartboost impression type.public static void cacheInterstitial(java.lang.String location, java.lang.String bidResponseJson)
location
- The location for the Chartboost impression type.bidResponseJson
- the bid response from the Helium SDK in JSON formatpublic static void showInterstitial(java.lang.String location)
location
- The location for the Chartboost impression type.@Deprecated public static void closeImpression()
public static boolean hasMoreApps(java.lang.String location)
location
- The location for the Chartboost impression type.public static void cacheMoreApps(java.lang.String location)
location
- The location for the Chartboost impression type.public static void showMoreApps(java.lang.String location)
location
- The location for the Chartboost impression type.public static boolean isAnyViewVisible()
public static void setMediation(Chartboost.CBMediation mediation, java.lang.String libraryVersion)
mediation
- The mediation library to send with all Chartboost API server requests.libraryVersion
- The mediation library version
This is an internal method used via Chartboost's mediation partners to track their usage.
Please use the setFramework(CBFramework framework, String version) methodpublic static void setFramework(Chartboost.CBFramework framework, java.lang.String version)
framework
- The framework to send with all Chartboost API server requests.version
- The version of the framework
This is an internal method used via Chartboost's Unity and Corona SDKs
to track their usage.@Deprecated public static void setFrameworkVersion(java.lang.String version)
setChartboostWrapperVersion
insteadversion
- The version of the framework SDK.
This is an internal method used via Chartboost's Unity and Corona SDKs
to track their usage.public static void setChartboostWrapperVersion(java.lang.String version)
version
- The version of the framework SDK.
This is an internal method used via Chartboost's Unity and Corona SDKs
to track their usage.public static java.lang.String getCustomId()
public static void setCustomId(java.lang.String customID)
customID
- The identifier to send with all Chartboost API server requests.
Use this method to set a custom identifier that can be used later in the Chartboost
dashboard to group information by.public static void setLoggingLevel(com.chartboost.sdk.Libraries.CBLogging.Level lvl)
lvl
- The logging level.public static com.chartboost.sdk.Libraries.CBLogging.Level getLoggingLevel()
public static com.chartboost.sdk.AbstractChartboostDelegate getDelegate()
public static void setDelegate(ChartboostDelegate delegate)
onCreate(android.app.Activity)
for the functionality provided by this method. This directly sets the delegate object used by Chartboost.delegate
- The delegate to set.public static boolean getAutoCacheAds()
public static void setAutoCacheAds(boolean autoCacheAds)
autoCacheAds
- If True, a new impression will automatically be cached.public static void setShouldRequestInterstitialsInFirstSession(boolean shouldRequest)
shouldRequest
- Default is true.
Set to control if Chartboost SDK can show interstitials in the first session.
The session count is controlled via the startWithAppId:appSignature:delegate: method in the Chartboost
class.public static void setShouldDisplayLoadingViewForMoreApps(boolean shouldDisplay)
shouldDisplay
- Default is false.
Set to control if Chartboost SDK should show a loading view while
preparing to display the "more applications" UI.public static void setShouldPrefetchVideoContent(boolean shouldPrefetch)
shouldPrefetch
- Default is true.
Set to control if Chartboost SDK control if videos should be prefetched.public static java.lang.String getSDKVersion()
public static void setShouldHideSystemUI(java.lang.Boolean hide)
hide
- default is true.
Make sure you change the theme of the Chartboost activity to android:theme="@android:style/Theme.Translucent"public static boolean isWebViewEnabled()
public static void setActivityCallbacks(boolean enabled)
public static void setActivityAttrs(android.app.Activity activity)