Package | com.kongregate.air |
Interface | public interface IMtx |
This API can be used to query the server to determine if a Kongregate user owns a particular item. Currently, the functionality provided by this API is used for cross-promotion between games. For example, a bonus item in one game can be awarded by obtaining a badge in another.
Method | Defined By | ||
---|---|---|---|
hasItem(identifier:String):Boolean
Used to check if a user owns an item with the given identifier. | IMtx | ||
receiptVerificationStatus(transactionIdentifier:String):void | IMtx | ||
requestUserItemList():void
Call this function to request the user's inventory from the remote
server. | IMtx | ||
verifyGoogleReceipt(receipt:String, signature:String):void | IMtx | ||
verifyTransactionId(transactionIdentifier:String):void | IMtx |
hasItem | () | method |
public function hasItem(identifier:String):Boolean
Used to check if a user owns an item with the given identifier. Only valid
after a call to requestUserItemList
generates the KONGREGATE_EVENT_USER_INVENTORY
event. It is recommended you persist the value of this call to disk once it returns
true so that repeated requests to the server don't need to be made.
Parameters
identifier:String — The Kongregate item identifier
|
Boolean — True if the user has the specified identifier in their inventor
|
receiptVerificationStatus | () | method |
public function receiptVerificationStatus(transactionIdentifier:String):void
Parameters
transactionIdentifier:String — The transaction to check the status of
|
requestUserItemList | () | method |
public function requestUserItemList():void
Call this function to request the user's inventory from the remote
server. Once the list of items has been retrieved, a KONGREGATE_EVENT_USER_INVENTORY
event will be broadcast, at which point you can call hasItem
to
determine if the user owns a specific item.
verifyGoogleReceipt | () | method |
public function verifyGoogleReceipt(receipt:String, signature:String):void
Parameters
receipt:String — The full JSON receipt for the purchase
| |
signature:String — The data signature included with the purchase response.
|
verifyTransactionId | () | method |
public function verifyTransactionId(transactionIdentifier:String):void
Parameters
transactionIdentifier:String — The transaction id to verify
|