Class RewardItem

java.lang.Object
com.codename1.ads.RewardItem

public class RewardItem extends java.lang.Object

The reward earned by a user who finished watching a RewardedAd or RewardedInterstitialAd. The type and amount are configured in the ad network console for the specific ad unit.

Note: for production apps that grant valuable rewards you should verify the reward server side rather than trusting the client. See ServerSideVerificationOptions.

  • Constructor Summary

    Constructors
    Constructor
    Description
    RewardItem(String type, int amount)
    Creates a new reward item.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The reward amount.
    The reward type as configured in the ad network console (e.g. "coins").
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RewardItem

      public RewardItem(String type, int amount)

      Creates a new reward item.

      Parameters
      • type: the reward type as configured in the ad network console (e.g. "coins")
      • amount: the reward amount
  • Method Details

    • getType

      public String getType()
      The reward type as configured in the ad network console (e.g. "coins").
    • getAmount

      public int getAmount()
      The reward amount.
    • toString

      public String toString()
      Overrides:
      toString in class java.lang.Object