PrebidMobile Object

Apply global settings with the PrebidMobile object.

Methods

setAccountId

Define the Prebid Server account ID provided by your Prebid Server host.

Parameters

accountId: String containing the Prebid Server account ID.

getAccountId

Retrieve the Prebid Server account ID.

Parameters

none

setHost

Define the Prebid Server host with which Prebid Mobile will communicate. Choose from system-defined Prebid Server hosts or define your own custom Prebid Server host.

Parameters

host: Object containing configuration server host. Default = Host.APPNEXUS.

getHost

Retrieve the Prebid Server host with which Prebid Mobile will communicate.

Parameters

none

setShareGeoLocation

If this flag is True AND the app collects the user’s geographical location data, Prebid Mobile will send the user’s geographical location data to Prebid Server. If this flag is False OR the app does not collect the user’s geographical location data, Prebid Mobile will not populate any user geographical location information in the call to Prebid Server.

Parameters

share: Boolean value. Default = false.

isShareGeoLocation

Returns a boolean value specifying whether geographic location is shared.

Parameters

none

setApplicationContext

Prebid Mobile will use the application context to retrieve metadata needed for targeting, such as user agent, location, device information, and connectivity information.

Parameters

context: Context object (can be retrieved by calling getApplicationContext).

getApplicationContext

Parameters

none

Examples

PrebidMobile.setHost(Prebid.Host.APPNEXUS);
PrebidMobile.setAccountId("PREBID_SERVER_ACCOUNT_ID");
PrebidMobile.setShareGeoLocation(true);
PrebidMobile.setApplicationContext(getApplicationContext());