Android的 - 如何检查是否在应用程序内购买已经完成? [英] Android - how to check if in app purchase has already been done?
问题描述
我要如何检查是否在应用程序内购买之前已经做了什么?
所以,我的用户不必在卸载并重新安装应用程序,以购回本在应用程序内购买?
How do i check if a in app purchase has been done before? So that my user doesnt need to repurchase the in app purchase upon uninstalling and reinstalling the app?
我已将我的应用程序项目在Android市场上易于管理发布页面。
I have set my in app item to managable in the android market publish page.
我看了一下 RESTORE_TRANSACTION
,但我不知道我需要寻找这里面的反应,以及如何对此进行测试。
i have read about RESTORE_TRANSACTION
but I do not know what i need to look for inside this response and also how to test this.
任何帮助将大大AP preaciated。
Any help would be greatly appreaciated.
推荐答案
您需要恢复交易,你使用上面指定的RESTORE_TRANSACTION标志。您应该只这样做一次,当应用程序首次启动时间,或者如果用户清除数据。
You need to restore the transactions, using the RESTORE_TRANSACTION flag you specified above. You should only do this once, when the application starts for the first time or if the user clears the data.
我会建议为你自己这个过程更简单,你寻找到<一个href=\"https://github.com/robotmedia/AndroidBillingLibrary/blob/master/DungeonsRedux/src/net/robotmedia/billing/example/Dungeons.java\"相对=nofollow> AndroidBillingLibrary ,它允许你在一个简单得多的方式与Android的界面应用内结算。
I would advice to make this process simpler for yourself, you looking into the AndroidBillingLibrary, which allows you to interface with the Android In App Billing in a much simpler manner.
下面是对事务如何恢复一个片段:
Here is a snippet of how the transactions are restored:
private void restoreTransactions() {
if (!mBillingObserver.isTransactionsRestored()) {
BillingController.restoreTransactions(this);
Toast.makeText(this, R.string.restoring_transactions, Toast.LENGTH_LONG).show();
}
}
这篇关于Android的 - 如何检查是否在应用程序内购买已经完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!