Class POBImpression
-
- All Implemented Interfaces:
public class POBImpressionHolds the general information about an ad impression. It is required to pass the impression level information in bid request.
-
-
Field Summary
Fields Modifier and Type Field Description public POBBannerbannerpublic POBVideovideopublic booleanisInterstitialpublic booleanisRewardedAdpublic booleanisCtaOverlayEnabledpublic booleanisMRAIDAppStatusEnabled
-
Constructor Summary
Constructors Constructor Description POBImpression(String id, String adUnitId)Constructor POBImpression(String id, String adUnitId, boolean isRewardedAd, boolean isInterstitial)Constructor to be used for creating Impression object for the Rewarded Ad
-
Method Summary
Modifier and Type Method Description POBBannergetBanner()ORTB banner object voidsetBanner(@Nullable() POBBanner banner)To set ortb banner POBVideogetVideo()ORTB video object voidsetVideo(@Nullable() POBVideo video)To set Ortb video booleanisInterstitial()Returns true if this impression is configured for Interstitials ad, else return false voidsetInterstitial(boolean interstitial)Set true if the impression is configured for insterstitial booleanisRewardedAd()Returns true if this impression is configured for Rewarded ad, else return false booleanisCtaOverlayEnabled()Returns true if CTA overlay is enabled for this impression. voidsetCtaOverlayEnabled(boolean ctaOverlayEnabled)Enables or disables CTA overlay for this impression. booleanisMRAIDAppStatusEnabled()Returns true if MRAID app status is enabled for this impression. voidsetMRAIDAppStatusEnabled(boolean mraidAppStatusEnabled)Enables or disables MRAID app status signal for this impression. voidsetNative(@Nullable() POBNative pobNative)Sets the oRTB native object POBNativegetNative()ORTB native object voidsetGpid(@NonNull() String gpid)Set the GPID for the impression. JSONObjectgetImpressionJson()(Internal for OpenWrap SDK) StringgetId()Returns the unique identifier of the impression. StringgetAdUnitId()Returns the unique identifier which represents an ad placement on the app screen. voidsetPMZoneId(@Nullable() String pmZoneId)Set the zone id. StringgetTestCreativeId()Returns a test creative id. voidsetTestCreativeId(@Nullable() String testCreativeId)This parameter is used to request a test creative. voidsetCustomParam(@Nullable() Map<String, List<String>> map)Adds custom key-value parameters in an Ad request. POBRequest.AdPositiongetAdPosition()Returns the Fold placement of the ad to be served. voidsetAdPosition(@NonNull() POBRequest.AdPosition adPosition)Sets the fold placement of the ad to be served. static booleancanEnableMRAIDAppStatus(@NonNull() Context context)Checks if MRAID app status should be enabled based on device permissions. -
-
Constructor Detail
-
POBImpression
POBImpression(String id, String adUnitId)
Constructor- Parameters:
id- Impression IdadUnitId- Ad unit Id
-
POBImpression
POBImpression(String id, String adUnitId, boolean isRewardedAd, boolean isInterstitial)
Constructor to be used for creating Impression object for the Rewarded Ad- Parameters:
id- Impression IdadUnitId- Ad unit IdisRewardedAd- true for identifying as Rewarded AdisInterstitial- true for identifying as Interstitial Rewarded Ad
-
-
Method Detail
-
setBanner
void setBanner(@Nullable() POBBanner banner)
To set ortb banner
- Parameters:
banner- the POBBanner
-
setVideo
void setVideo(@Nullable() POBVideo video)
To set Ortb video
- Parameters:
video- the POBVideo
-
isInterstitial
boolean isInterstitial()
Returns true if this impression is configured for Interstitials ad, else return false
- Returns:
true if interstitial is configured else false
-
setInterstitial
void setInterstitial(boolean interstitial)
Set true if the impression is configured for insterstitial
- Parameters:
interstitial- true if the impression is configured for insterstitial, else false
-
isRewardedAd
boolean isRewardedAd()
Returns true if this impression is configured for Rewarded ad, else return false
- Returns:
true if Rewarded is configured else false
-
isCtaOverlayEnabled
boolean isCtaOverlayEnabled()
Returns true if CTA overlay is enabled for this impression.
- Returns:
true if CTA overlay is enabled, false otherwise
-
setCtaOverlayEnabled
void setCtaOverlayEnabled(boolean ctaOverlayEnabled)
Enables or disables CTA overlay for this impression. When enabled, CTA overlay will be included in the request regardless of ad placement type.
- Parameters:
ctaOverlayEnabled- true to enable CTA overlay, false to disable
-
isMRAIDAppStatusEnabled
boolean isMRAIDAppStatusEnabled()
Returns true if MRAID app status is enabled for this impression.
-
setMRAIDAppStatusEnabled
void setMRAIDAppStatusEnabled(boolean mraidAppStatusEnabled)
Enables or disables MRAID app status signal for this impression. Currently it is enabled only for banner, MREC, interstitial and rewarded ad format
- Parameters:
mraidAppStatusEnabled- true to enable MRAID app status, false to disable
-
setNative
void setNative(@Nullable() POBNative pobNative)
Sets the oRTB native object
- Parameters:
pobNative- oRTB object for Native Ad
-
setGpid
void setGpid(@NonNull() String gpid)
Set the GPID for the impression. If not set, ad unit id will be used as GPID. global placement identifier (GPID) is a publisher-specified placement (tag) ID that is passed unchanged by all supply-side platforms (SSPs). Refer https://github.com/InteractiveAdvertisingBureau/openrtb/blob/main/extensions/community_extensions/gpid.md for more details.
- Parameters:
gpid- GPID String
-
getImpressionJson
@NonNull() JSONObject getImpressionJson()
(Internal for OpenWrap SDK)
- Returns:
Returns JSONObject
-
getId
@NonNull() String getId()
Returns the unique identifier of the impression.
- Returns:
Impression ID.
-
getAdUnitId
@NonNull() String getAdUnitId()
Returns the unique identifier which represents an ad placement on the app screen. This is the one you defined while creating profile mappings on the OpenWrap dashboard.
- Returns:
OpenWrap specific ad unit ID.
-
setPMZoneId
@Deprecated() void setPMZoneId(@Nullable() String pmZoneId)
Set the zone id. This parameter is used to pass a zone ID for reporting.
- Parameters:
pmZoneId- zone id
-
getTestCreativeId
@Nullable() String getTestCreativeId()
Returns a test creative id.
- Returns:
test creative id
-
setTestCreativeId
void setTestCreativeId(@Nullable() String testCreativeId)
This parameter is used to request a test creative.
- Parameters:
testCreativeId- test creative id.
-
setCustomParam
void setCustomParam(@Nullable() Map<String, List<String>> map)
Adds custom key-value parameters in an Ad request. Multiple values against the same key can be passed in list.
- Parameters:
map- map of key-value pair
-
getAdPosition
@NonNull() POBRequest.AdPosition getAdPosition()
Returns the Fold placement of the ad to be served.
- Returns:
Fold placement of the ad
-
setAdPosition
void setAdPosition(@NonNull() POBRequest.AdPosition adPosition)
Sets the fold placement of the ad to be served. Possible values are: ABOVE_THE_FOLD BELOW_THE_FOLD HEADER FOOTER SIDEBAR FULL_SCREEN
- Parameters:
adPosition- Value of ad placement
-
canEnableMRAIDAppStatus
static boolean canEnableMRAIDAppStatus(@NonNull() Context context)
Checks if MRAID app status should be enabled based on device permissions. MRAID app status requires QUERY_ALL_PACKAGES permission on Android R (API 30) and above. On devices below Android R, this check always returns true.
- Parameters:
context- The application context- Returns:
true if MRAID app status can be enabled, false otherwise
-
-
-
-