I am working on an Android Game. I got stuck at In app purchase programming. I have decided to use Soomla Unity IAP plugin. I tried their sample program of muffins, that worked well. But I did not get idea how would I know if some one purchased coins(Or any good) from my game. I have seen some videos on youtube, I have gone through git hub page of SOOMLA but didn't find anything which can clear my doubts. Please help me out guys Or refer any worthy material you know. Thank you !!
-
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Celeo Feb 18 '15 at 18:15
-
@Celeo I have mentioned my problem. and I didn't asked for the book. reference like any video or any link for similar discussion – kishorB Feb 18 '15 at 18:35
1 Answers
Your question isn't specific enough so I'll try to address several ways to go:
First, assuming you are selling coins for real money (market purchases), you want to use SOOMLA's event system to handle events when they're dispatched. A common event to register a handler for is OnMarketPurchase
in which you will get notified when users purchase things with Google Play, Apple App Store, or Amazon, depending on your platform:
StoreEvents.OnMarketPurchase += onMarketPurchase;
public void onMarketPurchase(PurchasableVirtualItem pvi, string payload,
Dictionary<string, string> extra) {
// pvi - the PurchasableVirtualItem that was just purchased
// payload - a text that you can give when you initiate the purchase operation and
// you want to receive back upon completion
// extra - contains platform specific information about the market purchase
// Android: The "extra" dictionary will contain "orderId" and "purchaseToken"
// iOS: The "extra" dictionary will contain "receipt" and "token"
// ... your game specific implementation here ...
}
Second, you can use the StoreInventory
class to query a user's inventory and thus know his \ her balances and what they've purchased:
StoreInventory.GetItemBalance("currency_coins");
Third - the method SoomlaStore.RefreshInventory
(which runs by default on Android builds, but not iOS) should all also restore the user's previous transactions for lifetime goods, in which you can also handle triggered events, so that's another way of telling if a user has previously purchased something ("Remove Ads" for example).

- 922
- 8
- 12