NonceGenerator

public final class NonceGenerator extends Object

Programmatic Access Library that collects signals for publishers that do not wish to use the entire IMA SDK. Allows publishers to create the programmatic access nonce. The user of this class should create single instance and use it to generate nonce string each time an ad needs to be requested. User can gain some performance improvement without going through object construction for second time since object construction uses services. Minimum Android API version supported is 19.

Nested Class Summary

interface NonceGenerator.NonceGeneratorCallback Callback for when nonce is created. 

Constant Summary

String SDK_VERSION

Public Constructor Summary

Public Method Summary

void
generateNonce()
Generate the programmatic access nonce in an encrypted format.
void
registerNonceGeneratorCallback(NonceGenerator.NonceGeneratorCallback callback)
Register nonce generation callback.
void
reset()
Resets all the metrics to their default values.
void
setDescriptionURL(String descriptionURL)
Set the description URL of the video being played.
void
setOmidPartner(String partnerName, String partnerVersion)
Set the name and version of the partner integrating OMID measurement.
void
setOmidVersion(String omidVersion)
Set the version of the OMID SDK supported by the ad player.
void
setPlayerType(String playerType)
Set the name of the partner player being used to play the ad.
void
setPlayerVersion(String playerVersion)
Set the version of the partner player being used to play the ad.
void
setPpid(String ppid)
Set the publisher provided ID.
void
setVideoPlayerHeight(int videoPlayerHeight)
Set the height of the video player.
void
setVideoPlayerWidth(int videoPlayerWidth)
Set the width of the video player.
void
setWillAdAutoPlay(boolean willAdAutoPlay)
Set whether the ad will be played automatically.
void
setWillAdPlayMuted(boolean willAdPlayMuted)
Set whether the ad will be play while muted.
void

Inherited Method Summary

Constants

protected static final String SDK_VERSION

Constant Value: "h.3.2.2/n.android.3.2.2"

Public Constructors

public NonceGenerator (Context context)

Public Methods

public void generateNonce ()

Generate the programmatic access nonce in an encrypted format. This method should be called in UI thread. We generate nonce using background thread internally since certain services are used and this should not block the user. After nonce generation, success or failure callbacks will be invoked.

public void registerNonceGeneratorCallback (NonceGenerator.NonceGeneratorCallback callback)

Register nonce generation callback. The callback methods will be invoked on the main thread.

public void reset ()

Resets all the metrics to their default values.

public void setDescriptionURL (String descriptionURL)

Set the description URL of the video being played.

public void setOmidPartner (String partnerName, String partnerVersion)

Set the name and version of the partner integrating OMID measurement.

public void setOmidVersion (String omidVersion)

Set the version of the OMID SDK supported by the ad player.

public void setPlayerType (String playerType)

Set the name of the partner player being used to play the ad.

public void setPlayerVersion (String playerVersion)

Set the version of the partner player being used to play the ad.

public void setPpid (String ppid)

Set the publisher provided ID.

public void setVideoPlayerHeight (int videoPlayerHeight)

Set the height of the video player.

public void setVideoPlayerWidth (int videoPlayerWidth)

Set the width of the video player.

public void setWillAdAutoPlay (boolean willAdAutoPlay)

Set whether the ad will be played automatically. False by default.

public void setWillAdPlayMuted (boolean willAdPlayMuted)

Set whether the ad will be play while muted. False by default.

public void unregisterNonceGeneratorCallback (NonceGenerator.NonceGeneratorCallback callback)

Remove nonce generation callback.