Package com.magnite.sdk.adsbase
Class MagniteSDK
java.lang.Object
com.magnite.sdk.adsbase.MagniteSDK
Class contains static methods to initialize and configure the Magnite SDK
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvides a convenient way to configure SDK parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableConsent(android.content.Context context, boolean enabled) static voidenableReturnAds(boolean enableReturnAd) Deprecated.static voidDeprecated.static voidDeprecated.static voidinit(android.content.Context context, String appId, com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs) Deprecated.static voidinit(android.content.Context context, String appId, com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs, boolean enableReturnAds) Deprecated.static voidDeprecated.static voidDeprecated.static voidinit(android.content.Context context, String accountId, String appId, com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs) Deprecated.static voidinit(android.content.Context context, String accountId, String appId, com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs, boolean enableReturnAds) Deprecated.static MagniteSDK.InitParamsinitParams(android.content.Context context, String appId) Creates an intermediate object which holds parameters for SDK initialization.static voidsetTestAdsEnabled(boolean enable) Configure test ads.
-
Constructor Details
-
MagniteSDK
public MagniteSDK()
-
-
Method Details
-
init
Deprecated. UseinitParams(Context, String)instead.Initialize the SDK with default configuration.
- Parameters:
context- contextappId- app ID from the publisher's portal
-
init
public static void init(@NonNull android.content.Context context, @NonNull String appId, @NonNull com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs) Deprecated. UseinitParams(Context, String)instead.Initialize the SDK with customized configuration.
- Parameters:
context- contextappId- app ID from the publisher's portalsdkAdPrefs- default ad preferences
-
init
public static void init(@NonNull android.content.Context context, @Nullable String accountId, @NonNull String appId) Deprecated. UseinitParams(Context, String)instead.Initialize the SDK with default configuration.
- Parameters:
context- contextaccountId- account ID from the publisher's portalappId- app ID from the publisher's portal
-
init
public static void init(@NonNull android.content.Context context, @Nullable String accountId, @NonNull String appId, @NonNull com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs) Deprecated. UseinitParams(Context, String)instead.- Parameters:
context- contextaccountId- account ID from the publisher's portalappId- app ID from the publisher's portalsdkAdPrefs- ad preferences
-
init
@Deprecated public static void init(@NonNull android.content.Context context, @NonNull String appId, boolean enableReturnAds) Deprecated.Deprecated. UseinitParams(Context, String)instead. This method will be removed completely from future release of SDK 6.0.0.- Parameters:
context- contextappId- app ID from the publisher's portalenableReturnAds- this parameter is ignored and has no effect
-
init
@Deprecated public static void init(@NonNull android.content.Context context, @Nullable String accountId, @NonNull String appId, boolean enableReturnAds) Deprecated.Deprecated. UseinitParams(Context, String)instead. This method will be removed completely from future release of SDK 6.0.0.- Parameters:
context- contextaccountId- account ID from the publisher's portalappId- app ID from the publisher's portalenableReturnAds- this parameter is ignored and has no effect
-
init
@Deprecated public static void init(@NonNull android.content.Context context, @NonNull String appId, @NonNull com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs, boolean enableReturnAds) Deprecated.Deprecated. UseinitParams(Context, String)instead. This method will be removed completely from future release of SDK 6.0.0.- Parameters:
context- contextappId- app ID from the publisher's portalsdkAdPrefs- ad preferencesenableReturnAds- this parameter is ignored and has no effect
-
init
@Deprecated public static void init(@NonNull android.content.Context context, @Nullable String accountId, @NonNull String appId, @Nullable com.magnite.sdk.adsbase.SDKAdPreferences sdkAdPrefs, boolean enableReturnAds) Deprecated.Deprecated. UseinitParams(Context, String)instead. This method will be removed completely from future release of SDK 6.0.0.- Parameters:
context- contextaccountId- account ID from the publisher's portalappId- app ID from the publisher's portalsdkAdPrefs- ad preferencesenableReturnAds- this parameter is ignored and has no effect
-
enableReturnAds
Deprecated.This method does nothing and it will be removed completely from future release of SDK 6.0.0 -
setTestAdsEnabled
public static void setTestAdsEnabled(boolean enable) Configure test ads. Must be used during development.Example usage:
if (BuildConfig.DEBUG) { MagniteSDK.setTestAdsEnabled(true); }- Parameters:
enable-true- enabled,false- disabled
-
enableConsent
public static void enableConsent(@NonNull android.content.Context context, boolean enabled) -
initParams
@NonNull public static MagniteSDK.InitParams initParams(@NonNull android.content.Context context, @NonNull String appId) Creates an intermediate object which holds parameters for SDK initialization.Example usage:
MagniteSDK.initParams(context, "YOUR_APP_ID") .setCallback(new Runnable() { public void run() { // request ads } }) .init();- Parameters:
context- contextappId- appId- Returns:
- new instance for method-chain calls
- See Also:
-