我已经使用静态响应 id 在我的帐户中实现了应用内购买android.test.purchased
。现在,当购买该项目时,会Toast
弹出“谢谢。您的项目将很快出现”。
我认为到目前为止,每件事都完美无缺。
我的问题是
Toast
来的。我找不到我的代码。Reserved product ID
我用的吗?一旦我使用自己的产品 ID,它会改变吗? @Override
public void onPurchaseStateChange(PurchaseState purchaseState, String itemId,
long purchaseTime, String developerPayload) {
if (purchaseState == PurchaseState.PURCHASED) {
// Is it here?
}
}
onPurchaseStateChange
吗?这是我的onPurchaseStateChange
方法
@Override
public void onPurchaseStateChange(PurchaseState purchaseState, String itemId,
long purchaseTime, String developerPayload) {
if (Consts.DEBUG) {
Log.i(TAG, "onPurchaseStateChange() itemId: " + itemId + " " + purchaseState);
}
if (purchaseState == PurchaseState.PURCHASED) {
for (CatalogEntry e : CATALOG) {
if (e.sku.equals(itemId) &&
e.managed.equals(Managed.SUBSCRIPTION)) {
}
}
}
Toast.makeText(getApplicationContext(), "purchase failed", Toast.LENGTH_LONG).show();
}
任何帮助将不胜感激!:) 谢谢!