Interface UM_iInAppClient
Communicates with the Billing service and presents a user interface so that the user can authorize payment.
Namespace: SA.CrossPlatform.InApp
Assembly: cs.temp.dll.dll
Syntax
public interface UM_iInAppClient
Properties
IsConnected
Returns true
if connected to the billing service. Otherwise false
.
Declaration
bool IsConnected { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Products
An available product list for yor app. When you not connected to the payment service, see the IsConnected property, product list will contain the products info you set before the connection request (using the plugin Editor UI).
Once you connected to the service, products info will be updated according to the data received from a payment service.
Declaration
IEnumerable<UM_iProduct> Products { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<UM_iProduct> |
Methods
AddPayment(String)
Adds a payment request to the queue.
An application should always have at least one observer of the payment queue before adding payment requests. The payment request must have a product identifier registered with the platform payment service.
When a payment request is added to the queue, the payment queue processes that request with the Apple App Store and arranges for payment from the user. When that transaction is complete or if a failure occurs, the payment queue sends the UM_iTransactionObserver object that encapsulates the request to all transaction observers.
Declaration
void AddPayment(string productId)
Parameters
Type | Name | Description |
---|---|---|
System.String | productId | Product identifier. |
Connect(Action<SA_iResult>)
Initializes the billing service with the set of previously defined products. With plugin editor UI. Once the connection is successfully established, Products list will be update with the information received from a payment service.
Declaration
void Connect(Action<SA_iResult> callback)
Parameters
Type | Name | Description |
---|---|---|
Action<SA_iResult> | callback | Operation callback. |
Connect(IEnumerable<UM_ProductTemplate>, Action<SA_iResult>)
Initializes the billing service with the set of defined products. Once the connection is successfully established, Products list will be update with the information received from a payment service.
Declaration
void Connect(IEnumerable<UM_ProductTemplate> products, Action<SA_iResult> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<UM_ProductTemplate> | products | Manually defined products list. |
Action<SA_iResult> | callback | Operation callback. |
FinishTransaction(UM_iTransaction)
Completes a pending transaction.
Your application should call this method from a transaction observer that received a notification from the payment queue. Calling FinishTransaction(UM_iTransaction) on a transaction removes it from the queue. Your application should call FinishTransaction(UM_iTransaction) only after it has successfully processed the transaction and unlocked the functionality purchased by the user.
Declaration
void FinishTransaction(UM_iTransaction transaction)
Parameters
Type | Name | Description |
---|---|---|
UM_iTransaction | transaction | transaction to finish |
GetProductById(String)
Gets the product by identifier.
Declaration
UM_iProduct GetProductById(string productIdentifier)
Parameters
Type | Name | Description |
---|---|---|
System.String | productIdentifier | Product identifier. |
Returns
Type | Description |
---|---|
UM_iProduct |
RestoreCompletedTransactions()
Asks the payment queue to restore previously completed purchases.
our application calls this method to restore transactions that were previously finished so that you can process them again. For example, your application would use this to allow a user to unlock previously purchased content onto a new device.
Declaration
void RestoreCompletedTransactions()
SetTransactionObserver(UM_iTransactionObserver)
Sets an observer to the payment queue.
Your application should add an observer to the payment queue during application initialization. If there are no observers attached to the queue, the payment queue does not synchronize its list of pending transactions with the payment service, because there is no observer to respond to updated transactions.
If an application quits when transactions are still being processed, those transactions are not lost. The next time the application launches, the payment queue will resume processing the transactions. Your application should always expect to be notified of completed transactions.
Declaration
void SetTransactionObserver(UM_iTransactionObserver observer)
Parameters
Type | Name | Description |
---|---|---|
UM_iTransactionObserver | observer | The observer to add to the queue. |