|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazon.InApp.transaction.TransactionObserver
public abstract class TransactionObserver
Clients must subclass the TransactionObserver
and register an instance of their subclass with
TransactionManager.registerObserver(TransactionObserver)
before using other APIs in the
TransactionManager
.
Your registered subclass of the TransactionObserver
will asynchronously receive callbacks when operations you
initiate via methods in the TransactionManager
have completed.
For example, if you initiate a purchase with TransactionManager.initiatePurchaseRequest(String)
you will
eventually receive a notification that the PurchaseResponse
is available via the
notifyPurchaseResponse(PurchaseResponse)
method you have implemented.
Please be aware that the callbacks you implement here will be invoked on your UI thread. If you must perform any long-running tasks you should do them on another thread, possibly using an AsyncTask.
Constructor Summary | |
---|---|
TransactionObserver(android.content.Context context)
Creates a new TransactionObserver that is associated with your Activity or Application Context. |
Method Summary | |
---|---|
abstract void |
notifyContentDownloadResponse(ContentDownloadResponse contentDownloadResponse)
This callback method allows you to be notified when a ContentDownloadResponse is available for a request
that was initiated previously via TransactionManager.initiateContentDownloadRequest(String, String) . |
abstract void |
notifyItemDataResponse(ItemDataResponse itemDataResponse)
This callback method allows you to be notified when an ItemDataResponse is available for a request that
was initiated previously via TransactionManager.initiateItemDataRequest(java.util.Set) . |
abstract void |
notifyPurchaseResponse(PurchaseResponse purchaseResponse)
This callback method allows you to be notified when a PurchaseResponse is available for a purchase that
was initiated previously via TransactionManager.initiatePurchaseRequest(String) . |
abstract void |
notifyReceiptDataResponse(ReceiptDataResponse receiptDataResponse)
This callback method allows you to be notified when a ReceiptDataResponse is available for a request that
was initiated previously via TransactionManager.initiateReceiptDataRequest(Offset) . |
abstract void |
notifyRevokedSkuDataResponse(RevokedSkuDataResponse revokedSkuDataResponse)
This callback method allows you to be notified when a RevokedSkuDataResponse is available for a request
that was initiated previously via TransactionManager.initiateRevokedSkusDataRequest(Offset) . |
abstract void |
notifySdkAvailable(boolean isSandboxMode)
This is the first callback that will be invoked after you register your TransactionObserver with the
TransactionManager , and will indicate whether the In-App SDK is running in sandbox mode (with test data)
or production mode (with real data). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionObserver(android.content.Context context)
TransactionObserver
that is associated with your Activity or Application Context.
context
- The Activity or Application Context in which you are creating this TransactionObserver
Method Detail |
---|
public abstract void notifySdkAvailable(boolean isSandboxMode)
This is the first callback that will be invoked after you register your TransactionObserver
with the
TransactionManager
, and will indicate whether the In-App SDK is running in sandbox mode (with test data)
or production mode (with real data).
Please be aware that this method will be invoked on your UI thread. If you must perform any long-running tasks in your implementation you should do them on another thread, possibly using an AsyncTask.
isSandboxMode
- true if we are running in sandbox mode with test data, false if we're running in production mode with
real datapublic abstract void notifyPurchaseResponse(PurchaseResponse purchaseResponse)
This callback method allows you to be notified when a PurchaseResponse
is available for a purchase that
was initiated previously via TransactionManager.initiatePurchaseRequest(String)
.
Implement this method to update your application state, save purchase information to a database, send it to your developer server, etc.
Please be aware that this method will be invoked on your UI thread. If you must perform any long-running tasks in your implementation you should do them on another thread, possibly using an AsyncTask.
purchaseResponse
- Indicates the status of the purchase operation and may contain a receiptpublic abstract void notifyItemDataResponse(ItemDataResponse itemDataResponse)
This callback method allows you to be notified when an ItemDataResponse
is available for a request that
was initiated previously via TransactionManager.initiateItemDataRequest(java.util.Set)
.
Please be aware that this method will be invoked on your UI thread. If you must perform any long-running tasks in your implementation you should do them on another thread, possibly using an AsyncTask.
itemDataResponse
- Provides access to item data and the status of the requestpublic abstract void notifyContentDownloadResponse(ContentDownloadResponse contentDownloadResponse)
This callback method allows you to be notified when a ContentDownloadResponse
is available for a request
that was initiated previously via TransactionManager.initiateContentDownloadRequest(String, String)
. Note
that you may receive several callbacks for a single original request. Each callback will indicate the current
progress of the download.
Please be aware that this method will be invoked on your UI thread. If you must perform any long-running tasks in your implementation you should do them on another thread, possibly using an AsyncTask.
contentDownloadResponse
- Provides access to the status of the requestpublic abstract void notifyReceiptDataResponse(ReceiptDataResponse receiptDataResponse)
This callback method allows you to be notified when a ReceiptDataResponse
is available for a request that
was initiated previously via TransactionManager.initiateReceiptDataRequest(Offset)
.
Please be aware that this method will be invoked on your UI thread. If you must perform any long-running tasks in your implementation you should do them on another thread, possibly using an AsyncTask.
receiptDataResponse
- Provides access to receipt data and the status of the requestpublic abstract void notifyRevokedSkuDataResponse(RevokedSkuDataResponse revokedSkuDataResponse)
This callback method allows you to be notified when a RevokedSkuDataResponse
is available for a request
that was initiated previously via TransactionManager.initiateRevokedSkusDataRequest(Offset)
.
Please be aware that this method will be invoked on your UI thread. If you must perform any long-running tasks in your implementation you should do them on another thread, possibly using an AsyncTask.
revokedSkuDataResponse
- Provides access to revoked SKU data and the status of the request
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |