/android-store-google-play

Google Play billing hook to SOOMLA android-store

Primary LanguageJavaMIT LicenseMIT

This project is a billing provider plugin to android-store.

android-store-google-play

android-store-google-play is the default billing service plugin for android-store. It uses the default code given by Google which was adapted to IabHelper and IIabService interface so it'll be useful to SOOMLA's android-store.

Getting Started

In order to work with this plugin you first need to go over android-store's Getting Started.

The steps to integrate this billing service are also in android-store's Selecting Billing Service but we will also write them here for convenience:

  1. Add AndroidStoreGooglePlay.jar from the build folder to your project.
  2. Make the following changes in AndroidManifest.xml:

Add the following permission (for Google Play):

  <uses-permission android:name="com.android.vending.BILLING" />

Add the IabActivity to your application element, the plugin will spawn a transparent activity to make purchases. Also, you need to tell us what plugin you're using so add a meta-data tag for that:

  <activity android:name="com.soomla.store.billing.google.GooglePlayIabService$IabActivity"
    android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
  <meta-data android:name="billing.service" android:value="google.GooglePlayIabService" />
  1. After you initialize SoomlaStore, let the plugin know your public key from the dev console:
  GooglePlayIabService.getInstance().setPublicKey("[YOUR PUBLIC KEY FROM THE MARKET]");
  1. If you want to allow the test purchases, all you need to do is tell that to the plugin:
  GooglePlayIabService.AllowAndroidTestPurchases = true;

For Google Play, We recommend that you open the IAB Service and keep it open in the background in cases where you have an in-game storefront. This is how you do that:

When you open the store, call:

  SoomlaStore.getInstance().startIabServiceInBg();

When the store is closed, call:

  SoomlaStore.getInstance().stopIabServiceInBg();

Contribution

SOOMLA appreciates code contributions! You are more than welcome to extend the capabilities of SOOMLA.

Fork -> Clone -> Implement -> Add documentation -> Test -> Pull-Request.

IMPORTANT: If you would like to contribute, please follow our Documentation Guidelines. Clear, consistent comments will make our code easy to understand.

SOOMLA, Elsewhere ...

License

Apache License. Copyright (c) 2012-2014 SOOMLA. http://soom.la