Difference between IABHelper and IInAppBillingService in InAPPBilling

£可爱£侵袭症+ 提交于 2019-12-09 12:14:29

问题


In the google document for InAppBilling V3 they used IInAppBillingService to make purchases . check the below URL.

http://developer.android.com/google/play/billing/billing_integrate.html

Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(), sku, "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");

But in the Trivial Example coming along with SDK, they used IABHelper to make purchases.

I am having confusion like whether IABHelper is V2 and IInAppBillingService is V3.

because u cant get the available SKU Details through IABHelper . but through IInAppBillingService , it is possible

Bundle skuDetails = mService.getSkuDetails(3, getPackageName(), "inapp", querySkus);

which one is most current version ?.


回答1:


IABHelper is just a wrapper utility class, which intends to give you an example of how IInAppBillingService is to be used.

IInAppBillingService is a part of in-app billing API. It is used to perform purchases and check statuses. You can use this service directly and forget about the helper class.

Many people find IABHelper simpler and they use it as-is. Other people use service and ignore helper class completely.



来源:https://stackoverflow.com/questions/24106255/difference-between-iabhelper-and-iinappbillingservice-in-inappbilling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!