net.robotmedia.billing.helper
Class AbstractBillingObserver

java.lang.Object
  extended by net.robotmedia.billing.helper.AbstractBillingObserver
All Implemented Interfaces:
IBillingObserver
Direct Known Subclasses:
DefaultBillingObserver

public abstract class AbstractBillingObserver
extends Object
implements IBillingObserver

Abstract subclass of IBillingObserver that provides default implementations for IBillingObserver.onPurchaseIntentOK(String, android.app.PendingIntent) and IBillingObserver.onTransactionsRestored().


Field Summary
protected  android.content.Context context
           
static String KEY_TRANSACTIONS_RESTORED
           
 
Constructor Summary
AbstractBillingObserver(android.content.Context context)
           
 
Method Summary
 boolean isTransactionsRestored()
           
static boolean isTransactionsRestored(android.content.Context context)
           
 void onErrorRestoreTransactions(ResponseCode responseCode)
          Called when a restore transactions request ended with a server error.
 void onPurchaseIntentOK(String productId, android.app.PendingIntent purchaseIntent)
          Called after requesting the purchase of the specified item.
 void onTransactionsRestored()
          Called when a restore transactions request has been successfully received by the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.robotmedia.billing.IBillingObserver
onCheckBillingSupportedResponse, onPurchaseIntentFailure, onPurchaseStateChanged, onRequestPurchaseResponse
 

Field Detail

KEY_TRANSACTIONS_RESTORED

public static final String KEY_TRANSACTIONS_RESTORED
See Also:
Constant Field Values

context

protected android.content.Context context
Constructor Detail

AbstractBillingObserver

public AbstractBillingObserver(android.content.Context context)
Method Detail

isTransactionsRestored

public boolean isTransactionsRestored()

isTransactionsRestored

public static boolean isTransactionsRestored(@Nonnull
                                             android.content.Context context)

onPurchaseIntentOK

public void onPurchaseIntentOK(@Nonnull
                               String productId,
                               @Nonnull
                               android.app.PendingIntent purchaseIntent)
Called after requesting the purchase of the specified item. The default implementation simply starts the pending intent.

Specified by:
onPurchaseIntentOK in interface IBillingObserver
Parameters:
productId - id of the item whose purchase was requested.
purchaseIntent - a purchase pending intent for the specified item.
See Also:
BillingController.requestPurchase(android.content.Context, String, boolean)

onTransactionsRestored

public void onTransactionsRestored()
Description copied from interface: IBillingObserver
Called when a restore transactions request has been successfully received by the server.

Specified by:
onTransactionsRestored in interface IBillingObserver

onErrorRestoreTransactions

public void onErrorRestoreTransactions(@Nonnull
                                       ResponseCode responseCode)
Description copied from interface: IBillingObserver
Called when a restore transactions request ended with a server error.

Specified by:
onErrorRestoreTransactions in interface IBillingObserver
Parameters:
responseCode - response code


Copyright © 2013. All Rights Reserved.