本文整理汇总了C#中com.SendBillingRequest方法的典型用法代码示例。如果您正苦于以下问题:C# com.SendBillingRequest方法的具体用法?C# com.SendBillingRequest怎么用?C# com.SendBillingRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com
的用法示例。
在下文中一共展示了com.SendBillingRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public override long Run(com.android.vending.billing.IMarketBillingService service)
{
Bundle request = makeRequestBundle("REQUEST_PURCHASE");
request.PutString(Consts.BILLING_REQUEST_ITEM_ID, mProductId);
request.PutString(Consts.BILLING_REQUEST_ITEM_TYPE, mProductType);
// Note that the developer payload is optional.
if (mDeveloperPayload != null) {
request.PutString(Consts.BILLING_REQUEST_DEVELOPER_PAYLOAD, mDeveloperPayload);
}
Bundle response = service.SendBillingRequest(request);
PendingIntent pendingIntent
= response.GetParcelable(Consts.BILLING_RESPONSE_PURCHASE_INTENT) as PendingIntent;
if (pendingIntent == null)
{
Log.Error("BillingService", "Error with requestPurchase");
return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
}
Intent intent = new Intent();
ResponseHandler.buyPageIntentResponse(pendingIntent, intent);
return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
}
示例2: Run
public override long Run(com.android.vending.billing.IMarketBillingService service)
{
Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS");
request.PutStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds);
Bundle response = service.SendBillingRequest(request);
logResponseCode("confirmNotifications", response);
return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
}
示例3: Run
public override long Run(com.android.vending.billing.IMarketBillingService service)
{
mNonce = Security.generateNonce();
Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS");
request.PutLong(Consts.BILLING_REQUEST_NONCE, mNonce);
Bundle response = service.SendBillingRequest(request);
logResponseCode("restoreTransactions", response);
return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
}
示例4: Run
public override long Run(com.android.vending.billing.IMarketBillingService service)
{
mNonce = Security.generateNonce();
Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION");
request.PutLong(Consts.BILLING_REQUEST_NONCE, mNonce);
request.PutStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds);
Bundle response = service.SendBillingRequest(request);
logResponseCode("getPurchaseInformation", response);
return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
}
示例5: Run
public override long Run(com.android.vending.billing.IMarketBillingService service)
{
Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED");
if (mItemType != null)
request.PutString(Consts.BILLING_REQUEST_ITEM_TYPE, mItemType);
Bundle response = service.SendBillingRequest(request);
int responseCode = response.GetInt(Consts.BILLING_RESPONSE_RESPONSE_CODE);
if (Consts.DEBUG)
Log.Info("BillingService", "CheckBillingSupported response code: " + responseCode.ToString());
bool billingSupported = (responseCode == (int)Consts.ResponseCode.RESULT_OK);
ResponseHandler.checkBillingSupportedResponse(billingSupported);
return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
}