这是实现应用内计费的代码的一部分。我有两个疑问。
@Override
public void onPurchaseStateChange(PurchaseState purchaseState, String itemId,
int quantity, long purchaseTime, String developerPayload) {
if (Consts.DEBUG) {
Log.i(TAG, "onPurchaseStateChange() itemId: " + itemId + " " + purchaseState);
}
if (developerPayload == null) {
logProductActivity(itemId, purchaseState.toString());
} else {
logProductActivity(itemId, purchaseState + "\n\t" + developerPayload);
}
if (purchaseState == PurchaseState.PURCHASED) {
mOwnedItems.add(itemId);
// At this point I have to put Premium changes
}
}
我的问题:
在我说“此时我必须进行高级更改”时,我如何向您保证该应用程序已被购买?
据我了解,一旦购买,可能需要几个小时才能生效。如何确保我的应用程序将执行正确的代码:“此时我必须进行高级更改”?