Packagecom.distriqt.extension.facebook.appevents
Classpublic class AppPurchaseEvent
InheritanceAppPurchaseEvent Inheritance Object

This class represents data to be used for sending Facebook App events for a specific purchase.

Note that only the purchaseAmount and currency are required. parameters are optional.

See also

https://developers.facebook.com/docs/ios/app-events
https://developers.facebook.com/docs/android/app-events


Public Properties
 PropertyDefined By
  currency : String
The currency for the purchase. The currency specification is expected to be an ISO 4217 currency code, which can be found here: http://en.wikipedia.org/wiki/ISO_4217
AppPurchaseEvent
  parameters : Object
[read-only] A key/value object storing additional parameters to be sent with the purchase event (optional) Keys must be of type String, while their values must either be a String or a Number.
AppPurchaseEvent
  purchaseAmount : Number = 0
The purchase amount to be logged.
AppPurchaseEvent
Public Methods
 MethodDefined By
  
AppPurchaseEvent(purchaseAmount:Number, currency:String)
Constructor
AppPurchaseEvent
  
Removes a parameter from this event
AppPurchaseEvent
  
setCurrency(currency:String):AppPurchaseEvent
Sets the currency
AppPurchaseEvent
  
setParameter(key:String, value:*):AppPurchaseEvent
Adds or updates a parameter for this purchase event Keys must be of type String, while their values must either be a String or a Number.
AppPurchaseEvent
  
setPurchaseAmount(purchaseAmount:Number):AppPurchaseEvent
Sets the purchase amount
AppPurchaseEvent
  
toObject():Object
AppPurchaseEvent
Property Detail
currencyproperty
public var currency:String

The currency for the purchase.

The currency specification is expected to be an ISO 4217 currency code, which can be found here: http://en.wikipedia.org/wiki/ISO_4217

parametersproperty 
parameters:Object  [read-only]

A key/value object storing additional parameters to be sent with the purchase event (optional)

Keys must be of type String, while their values must either be a String or a Number. Anything which does not match these types will be converted to a String.

While you can modify this object directly, it's recommended to use the setParameter and removeParameter methods to ensure data validation.


Implementation
    public function get parameters():Object
purchaseAmountproperty 
public var purchaseAmount:Number = 0

The purchase amount to be logged. Defaults to 0.

Constructor Detail
AppPurchaseEvent()Constructor
public function AppPurchaseEvent(purchaseAmount:Number, currency:String)

Constructor

Parameters
purchaseAmount:Number
 
currency:String
Method Detail
removeParameter()method
public function removeParameter(key:String):AppPurchaseEvent

Removes a parameter from this event

Parameters

key:String — String - name of the parameter

Returns
AppPurchaseEventAppPurchaseEvent instance for chaining calls
setCurrency()method 
public function setCurrency(currency:String):AppPurchaseEvent

Sets the currency

Parameters

currency:String

Returns
AppPurchaseEventAppPurchaseEvent instance for chaining calls
setParameter()method 
public function setParameter(key:String, value:*):AppPurchaseEvent

Adds or updates a parameter for this purchase event

Keys must be of type String, while their values must either be a String or a Number. Any value which does not match these types will be converted to a String.

Parameters

key:String — String - name of the parameter
 
value:* — String or Number - value of the parameter

Returns
AppPurchaseEventAppPurchaseEvent instance for chaining calls
setPurchaseAmount()method 
public function setPurchaseAmount(purchaseAmount:Number):AppPurchaseEvent

Sets the purchase amount

Parameters

purchaseAmount:Number

Returns
AppPurchaseEventAppPurchaseEvent instance for chaining calls
toObject()method 
public function toObject():Object

Returns
Object