userpurchasemanager - TogetherGames/Public-Corona-Lua GitHub Wiki
together.UserPurchaseManager
The UserPurchaseManager class contains a collection UserPurchases. With this class, a developer will be able to Create and Retrieve All their UserPurchases.
table UserPurchases
Stores all the UserPurchases contained in the Manager.
Adds a UserPurchase to the internally managed list without persistence.
Note
This method is deprecated
Returns void
UserPurchaseManager:Add( userPurchase )
TogetherUserPurchase userPurchase
Instance of a UserPurchase to add internally
--------------------------------------------------------------------------------Finds the UserPurchase with the specified UserPurchaseID if it exists, otherwise returns nil
Returns TogetherUserPurchase
UserPurchaseManager:FindByUserPurchaseID( userPurchaseID )
number userPurchaseID
The ID of the UserPurchase to find
--------------------------------------------------------------------------------Gets the number of UserPurchases currently managed internally.
Returns number
UserPurchaseManager:GetCount( )
Gets the UserPurchase at the specified index if it exists, otherwise returns nil.
Returns TogetherUserPurchase
UserPurchaseManager:Get( index )
number index
The index of the UserPurchase to find
--------------------------------------------------------------------------------Returns the index of the specified UserPurchase if it exists, otherwise returns nil.
Returns number
UserPurchaseManager:IndexOf( userItem )
TogetherUserPurchase userItem
Instance of the UserPurchase to find the index of
--------------------------------------------------------------------------------Returns the index of the UserPurchase with the specified UserPurchaseID if it exists, otherwise returns -1.
Returns number
UserPurchaseManager:IndexOfByUserPurchaseID( userPurchaseID )
number userPurchaseID
The ID of the UserPurchase to find the index of
--------------------------------------------------------------------------------Removes a UserPurchase from the internally managed list. This does not delete the purchase from the user's account persistently.
Note
This method is deprecated
Returns void
UserPurchaseManager:Remove( index )
number index
The index of the UserPurchase to remove internally
--------------------------------------------------------------------------------Creates a new UserPurchase record. Upon success, this will automatically update the internal list.
Returns void
UserPurchaseManager:Create( roomID, achievementID, itemID, description, count, userPurchaseProperties, callbackFunc )
number roomID
The ID of the room where the purchase occurred. Pass in 0 for no room.
[number](#) achievementIDThe ID of the achievement that was purchase.
[number](#) itemIDThe ID of the item that was purchased.
[string](#) descriptionA textual description of the purchase.
[number](#) countthe Number of (Achievements, Items, things) purchased.
[PropertyCollection](./propertycollection) userPurchasePropertiesThe properties to assign to the UserPurchase record. Pass an instance to link properties. Pass nil to assign no properties.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Gets all UserPurchases done by a User. Upon success, this will automatically update the internal list.
Returns void
UserPurchaseManager:GetAll( callbackFunc )
function callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------