# Class ApplePromotionalOffer

java.lang.Object
com.codename1.payment.ApplePromotionalOffer

All Implemented Interfaces:
  `PromotionalOffer`

public class ApplePromotionalOffer extends Object implements PromotionalOffer

Encapsulates a promotional offer for use with in-app-purchase in Apple's App store. This mirrors the information required to construct a SKPaymentDiscount object.

See Apple's documentation for implementing promotional offers.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ApplePromotionalOffer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getKeyIdentifier()`
  A string that identifies the key used to generate the signature.
  `String`
  `getNonce()`
  A universally unique ID (UUID) value that you define.
  `String`
  `getOfferIdentifier()`
  A string used to uniquely identify a discount offer for a product.
  `String`
  `getSignature()`
  A string representing the properties of a specific promotional offer, cryptographically signed.
  `long`
  `getTimestamp()`
  The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.
  `void`
  `setKeyIdentifier(String keyIdentifier)`
  A string that identifies the key used to generate the signature.
  `void`
  `setNonce(String nonce)`
  A universally unique ID (UUID) value that you define.
  `void`
  `setOfferIdentifier(String offerIdentifier)`
  A string used to uniquely identify a discount offer for a product.
  `void`
  `setSignature(String signature)`
  A string representing the properties of a specific promotional offer, cryptographically signed.
  `void`
  `setTimestamp(long timestamp)`
  The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Constructor Details

  - ### ApplePromotionalOffer

    public ApplePromotionalOffer()

- ## Method Details

  - ### getOfferIdentifier

    public String getOfferIdentifier()

    A string used to uniquely identify a discount offer for a product.

    See Apple docs.

    ###### Returns

    The offer identifier.

  - ### setOfferIdentifier

    public void setOfferIdentifier(String offerIdentifier)

    A string used to uniquely identify a discount offer for a product.

    ###### Parameters

    - `offerIdentifier`: @param offerIdentifier The offer identifier.

    See Apple docs.

  - ### getKeyIdentifier

    public String getKeyIdentifier()

    A string that identifies the key used to generate the signature.

    See Apple's docs.

    ###### Returns

    The key identifier.

  - ### setKeyIdentifier

    public void setKeyIdentifier(String keyIdentifier)

    A string that identifies the key used to generate the signature.

    ###### Parameters

    - `keyIdentifier`: @param keyIdentifier The key identifier.

    See Apple's docs.

  - ### getNonce

    public String getNonce()

    A universally unique ID (UUID) value that you define. (As a string).

    See Apple's docs.

    ###### Returns

    The nonce

  - ### setNonce

    public void setNonce(String nonce)

    A universally unique ID (UUID) value that you define. (As a string).

    See Apple's docs.

    ###### Parameters

    - `nonce`: The nonce

  - ### getSignature

    public String getSignature()

    A string representing the properties of a specific promotional offer, cryptographically signed.

    See Apple's docs

    ###### Returns

    The signature.

  - ### setSignature

    public void setSignature(String signature)

    A string representing the properties of a specific promotional offer, cryptographically signed.

    See Apple's docs

    ###### Parameters

    - `signature`: The signature.

  - ### getTimestamp

    public long getTimestamp()

    The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.

    ###### Returns

    The timestamp

  - ### setTimestamp

    public void setTimestamp(long timestamp)

    The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.

    ###### Parameters

    - `timestamp`: The timestamp.