C# 클래스 Billing.BillingService

상속: Android.App.Service, Android.Content.IServiceConnection
파일 보기 프로젝트 열기: MarkEaton1/Monodroid-InApp-Billing 1 사용 예제들

공개 메소드들

메소드 설명
BillingService ( ) : System
CheckBillingSupportedMethod ( string itemType ) : bool

Checks if in-app billing is supported. @pram itemType Either Consts.ITEM_TYPE_INAPP or Consts.ITEM_TYPE_SUBSCRIPTION, indicating the type of item support is being checked for.

HandleCommand ( Android.Content.Intent intent, int startId ) : void

The BillingReceiver sends messages to this service using intents. Each intent has an action and some extra arguments specific to that action.

OnBind ( Android.Content.Intent intent ) : IBinder

We don't support binding to this service, only starting the service.

OnServiceConnected ( ComponentName name, IBinder service ) : void

This is called when we are connected to the MarketBillingService. This runs in the main UI thread.

OnServiceDisconnected ( ComponentName name ) : void

This is called when we are disconnected from the MarketBillingService.

OnStart ( Android.Content.Intent intent, int startId ) : void
RequestPurchaseMethod ( string productId, string itemType, string developerPayload ) : bool

Requests that the given item be offered to the user for purchase. When the purchase succeeds (or is canceled) the BillingReceiver receives an intent with the action Consts#ACTION_NOTIFY. Returns false if there was an error trying to connect to Android Market.

RestoreTransactionsMethod ( ) : bool

Requests transaction information for all managed items. Call this only when the application is first installed or after a database wipe. Do NOT call this every time the application starts up.

Unbind ( ) : void

Unbinds from the MarketBillingService. Call this when the application terminates to avoid leaking a ServiceConnection.

비공개 메소드들

메소드 설명
BindToMarketBillingService ( ) : bool

Binds to the MarketBillingService and returns true if the bind succeeded.

CheckBillingSupportedMethod ( ) : bool
CheckResponseCode ( long requestId, Consts responseCode ) : void

This is called when we receive a response code from Android Market for a request that we made. This is used for reporting various errors and for acknowledging that an order was sent to the server. This is NOT used for any purchase state changes. All purchase state changes are received in the BillingReceiver and passed to this service, where they are handled in #purchaseStateChanged(int, String, String).

ConfirmNotificationsMethod ( int startId, string notifyIds ) : bool

Confirms receipt of a purchase state change. Each {@code notifyId} is an opaque identifier that came from the server. This method sends those identifiers back to the MarketBillingService, which ACKs them to the server. Returns false if there was an error trying to connect to the MarketBillingService.

GetPurchaseInformationMethod ( int startId, string notifyIds ) : bool

Gets the purchase information. This message includes a list of notification IDs sent to us by Android Market, which we include in our request. The server responds with the purchase information, encoded as a JSON string, and sends that to the BillingReceiver in an intent with the action Consts#ACTION_PURCHASE_STATE_CHANGED. Returns false if there was an error trying to connect to the MarketBillingService.

PurchaseStateChanged ( int startId, string signedData, string signature ) : void

Verifies that the data was signed with the given signature, and calls ResponseHandler#purchaseResponse(Context, PurchaseState, String, String, long) for each verified purchase.

RunPendingRequests ( ) : void

Runs any pending requests that are waiting for a connection to the service to be established. This runs in the main UI thread.

메소드 상세

BillingService() 공개 메소드

public BillingService ( ) : System
리턴 System

CheckBillingSupportedMethod() 공개 메소드

Checks if in-app billing is supported. @pram itemType Either Consts.ITEM_TYPE_INAPP or Consts.ITEM_TYPE_SUBSCRIPTION, indicating the type of item support is being checked for.
public CheckBillingSupportedMethod ( string itemType ) : bool
itemType string
리턴 bool

HandleCommand() 공개 메소드

The BillingReceiver sends messages to this service using intents. Each intent has an action and some extra arguments specific to that action.
public HandleCommand ( Android.Content.Intent intent, int startId ) : void
intent Android.Content.Intent the intent containing one of the supported actions
startId int an identifier for the invocation instance of this service
리턴 void

OnBind() 공개 메소드

We don't support binding to this service, only starting the service.
public OnBind ( Android.Content.Intent intent ) : IBinder
intent Android.Content.Intent
리턴 IBinder

OnServiceConnected() 공개 메소드

This is called when we are connected to the MarketBillingService. This runs in the main UI thread.
public OnServiceConnected ( ComponentName name, IBinder service ) : void
name ComponentName
service IBinder
리턴 void

OnServiceDisconnected() 공개 메소드

This is called when we are disconnected from the MarketBillingService.
public OnServiceDisconnected ( ComponentName name ) : void
name ComponentName
리턴 void

OnStart() 공개 메소드

public OnStart ( Android.Content.Intent intent, int startId ) : void
intent Android.Content.Intent
startId int
리턴 void

RequestPurchaseMethod() 공개 메소드

Requests that the given item be offered to the user for purchase. When the purchase succeeds (or is canceled) the BillingReceiver receives an intent with the action Consts#ACTION_NOTIFY. Returns false if there was an error trying to connect to Android Market.
public RequestPurchaseMethod ( string productId, string itemType, string developerPayload ) : bool
productId string an identifier for the item being offered for purchase
itemType string Either Consts.ITEM_TYPE_INAPP or Consts.ITEM_TYPE_SUBSCRIPTION, indicating /// the type of item type support is being checked for.
developerPayload string a payload that is associated with a given /// purchase, if null, no payload is sent
리턴 bool

RestoreTransactionsMethod() 공개 메소드

Requests transaction information for all managed items. Call this only when the application is first installed or after a database wipe. Do NOT call this every time the application starts up.
public RestoreTransactionsMethod ( ) : bool
리턴 bool

Unbind() 공개 메소드

Unbinds from the MarketBillingService. Call this when the application terminates to avoid leaking a ServiceConnection.
public Unbind ( ) : void
리턴 void