Points can be managed by Tnk Server or by your server depending on the 'Point management' setting. When you selected 'Managed by Tnk', all points are managed by Tnk server and you can inquiry and withdraw points of users using APIs described in this chapter. If you selected 'Callback URL', all the point reward events are sent to your server through the callback URL you entered. For callback URL, see 1.6 Callback URL.
1) TnkSession - queryPointInquiry amount of points of a user from Tnk server. Both sync and async invocation are supported. Invoking this method in main UI thread, you have to use async method not to your UI freeze until data arrives from server. But if you are going to invoke this method not in main UI thread but in other threads such as threads in game engine, you have to create a new thread and invoke sync method. [Async Invocation] Method
- (void) queryPoint:(id)target action:(SEL)action;
Description
This method returns amount of points of a user managed by Tnk server. This method works asynchronously and delivers return values to action SELECTOR of target object.
Parameters
[Sync Invocation] Method
- (NSInteger) queryPoint;
Description
This method returns amount of points of a user managed by Tnk server. This method blocks until a return value arrives.
Return : NSInteger
Amount of user points in Tnk server.
2) TnkSession - purchaseItemUse this method to decrease user points managed by Tnk server. Only async invocation is supported.
Method
- (void) purchaseItem:(NSString *)itemId cost:(NSInteger)poinCost target:(id)target action:(SEL)action;
Parameters
|