Android在应用程序内结算恢复交易 [英] Android In App Billing Restore Transaction

查看:187
本文介绍了Android在应用程序内结算恢复交易的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的在应用程序内结算的实施方案: 1.主屏幕显示产品,我打算卖掉列表。 2.将细节画面(上选择在主屏幕列表项显示屏幕)将不得不购买该产品的选项。

My scenario of In App Billing implementation: 1. The Home screen shows the list of products which I am planning to sell. 2. The detail screen (Screen shown on selecting a list item in home screen) will have the option to buy that product.

我的理解是,恢复交易的要求,并要求检查是否支持InAppBilling将要在主屏幕上的活动进行。而剩余的请求(开始购买等)应在细节屏幕活动完成。这是理解是否正确?

My understanding is that , Restore transaction request and request to check if InAppBilling is supported will have to be done in the Home screen activity. And the remaining requests(to initiate purchase etc) should be done on detail screen activity. Is this understanding correct?

如果是的,我应该怎么修改魔域例如要分开和落实在主屏幕上的活动,这两套要求我每一次我浏览到细节画面活动不需要做。我将不得不在这两个活动创建采购观察员和独立实例相关的类?

If yes, how should i modify the Dungeons example to seperate out and implement on home screen activity, the two sets of requests which i need not do every time i navigate to the detail screen activity. Will i have to create seperate instances of purchase observer and related classes in both these activities?

推荐答案

恢复交易不应该经常做的,可能只在应用程序的第一次运行(这样你就可以恢复购买,如果用户重新安装应用程序等),你不'T需要购买的产品。

Restore transactions should not be done frequently, possibly only on the app's first run (so you can restore purchases if the user reinstalled the app, etc.) You don't need it for purchasing a product.

BillingService有提供了一个请求购买和恢复交易单独的方法。只要打电话从相关活动的一个合适的。你只需要购买一次观测,它并没有多么的UI /活动是结构化的。

The BillingService offers separate methods for requesting a purchase and restoring transactions. Just call the appropriate one from the relevant activity. You only need one purchase observer, it doesn't matter how UI/activities are structured.

这篇关于Android在应用程序内结算恢复交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆