Get Featured to 10,000 SOOMLA Blog ReadersSubmit Request

iOS

In-App Purchase with a single line of code

ANDROID

In-App Billing with a single line of code

Unity

Plugin for the leading 3D game engine

COCOS2d-X

Extension for the popluar 2D framework
Fork me on GitHub

SOOMLA LOGO

Welcome to The SOOMLA Project

The SOOMLA Project is an open source framework for mobile game economies. Our goal is to allow mobile game developers easier implementation of virtual currencies, virtual goods and in-app purchases. The framework includes:

New features added in V3:


ios-store

Didn't you ever want an in-app purchase one liner that looks like this:

    [StoreInventory buyItemWithItemId:@"[itemId]"]

The ios-store is our iOS-flavored code initiative and part of The SOOMLA Project. It is an iOS SDK that simplifies the App Store's in-app purchasing API and complements it with storage, security and event handling. The project also includes a sample app for reference.

Usage Examples

Apart from calling the IAP API, the day to day interaction with SOOMLA will be to update balances of virtual goods. This is done through StoreInventory. Here are 3 basic examples:

  • Give the user 10 pieces of a virtual currency with an itemId of "currency_coin":

    [StoreInventory giveAmount:10 ofItem:@"currency_coin"];
    
  • Take 10 virtual goods with an itemId of "green_hat":

    [StoreInventory takeAmount:10 ofItem:@"currency_coin"];
    
  • Get the current balance of a virtual good with an itemId of "green_hat"
    (This the 'long' way of achieving this, you can also use StoreInventory.):

    VirtualGood* greenHat = (VirtualGood*)[[StoreInfo getInstance] virtualItemWithId:@"green_hat"];
    int greenHatsBalance = [[[StorageManager getInstance] virtualGoodStorage] balanceForItem:greenHat];
    

android-store

Didn't you ever want an in-app purchase one liner that looks like this:

    StoreInventory.buy("[itemId]");

The android-store is our first open code initiative as part of The SOOMLA Project. It is a Java API that simplifies Google Play's in-app purchasing API and complements it with storage, security and event handling. The project also includes a sample app for reference.

Usage Example

Apart from calling the IAP API, the day to day interaction with SOOMLA will be to update balances of virtual goods. This is done through StoreInventory. Here are 3 basic examples:

  • Give the user 10 pieces of a virtual currency with an itemId of "currency_coin":

    StoreInventory.giveVirtualItem("currency_coin", 10);
    
  • Take 10 virtual goods with an itemId of "green_hat":

    StoreInventory.takeVirtualItem("green_hat", 10);
    
  • Get the current balance of a virtual good with an itemId of "green_hat"
    (This is the 'long' way of achieving this. You can also use StoreInventory):

    VirtualGood greenHat = (VirtualGood)StoreInfo.getVirtualItem("green_hat");
    int greenHatsBalance = StorageManager.getVirtualGoodsStorage().getBalance(greenHat);
    

unity3d-store

Didn't you ever want an in-app purchase one liner that looks like this:

    StoreInventory.BuyItem("[itemId]");

The unity3d-store is the Unity3D flavour of The SOOMLA Project. This project uses android-store and ios-store in order to provide game developers with in-app billing for their Unity projects.

Download

We've created a .unityPackage and an example project:

unity3d-store v1.3 (release version)

Unity 4.0 - unity3d-store v1.3
Unity 3.5 - unity3d-store v1.3

unity3d-store v1.3 example

  • The example project is mostly what we have in our GitHub repo. You can either download it or clone unity3d-store.

Unity 4.0 - unity3d-store v1.3 example
Unity 3.5 - unity3d-store v1.3 example

Example Usages

Apart from calling the IAP API, the day to day interaction with SOOMLA will be to update balances of virtual goods. This is done through StoreInventory. Here are 3 basic examples:

  • Get a virtual currency with an itemId of "currency_coin":

    VirtualCurrency coin = StoreInfo.GetVirtualCurrencyByItemId("currency_coin");
    
  • Give the user 10 pieces of a virtual currency with an itemId of "currency_coin":

    StoreInventory.GiveItem("currency_coin", 10);
    
  • Take away 10 virtual goods with an itemId of "green_hat":

    StoreInventory.TakeItem("green_hat", 10);
    
  • Get the current balance of green hats (virtual goods with an itemId of "green_hat"):

    int greenHatsBalance = StoreInventory.GetItemBalance("green_hat");
    

cocos2dx-store

Didn't you ever want an in-app purchase one liner that looks like this:

CCStoreInventory::sharedStoreInventory()->buy("[itemId]");

cocos2dx-store is our open source Cocos2d-x flavoured initiative as part of The SOOMLA Project. It is a Cocos2d-x API that simplifies in-app purchasing APIs in Cocos2d-x and complements it with storage, security and event handling. It handles forwarding of C++ code over to the operating systems' Java and Objective C APIs. This project also includes a sample app for reference.

Example Project

Our example project is called cocod2dx-store-example. It shows an example of using cocos2dx-store in your own projects. cocos2dx-store-example is built with CocosBuiler and includes 3 scenes:

  • MainScene: This is the welcome scene from which you open the store.
  • StoreAScene: This is the store's first window. It contains a list of VirtualGoods
  • StoreBScene: This is the store's second window. It contains a list of VirtualCurrencyPacks

cocos2dx-store-example can be cloned from GitHub.

Usage Examples

Apart from calling the IAP api, the day to day interaction with SOOMLA will be to update balances of virtual goods. This is done through CCStoreInventory. Here are 3 basic examples:

  • Add 10 coins to the virtual currency with itemId "currency_coin":

    CCString *itemId = CCString::create("currency_coin");
    CCStoreInventory::sharedStoreInventory()->
                           giveItem(itemId, 10, NULL);
  • Remove 10 virtual goods with itemId "green_hat":

    CCString *itemId = CCString::create("green_hat");
    CCStoreInventory::sharedStoreInventory()->
                           giveItem(itemId, 10, NULL);
  • Get the current balance of green hats (virtual goods with itemId "green_hat"):

    CCString *itemId = CCString::create("green_hat");
    int balance = CCStoreInventory::sharedStoreInventory()->
                                          getItemBalance(itemId, NULL);

General Information

Contribution

We want you!

Fork -> Clone -> Implement -> Test -> Pull-Request. We have great RESPECT for contributors.

SOOMLA, Elsewhere...

Popular Articles via SOOMLA Blog

License

MIT License. Copyright (c) 2012 SOOMLA. http://project.soom.la