http://developer.android.com/guide/market/billing/billing_integrate.htmlにある Android のアプリ内課金のサンプル コードに従いました。
そのコードをアプリケーションに統合し、apk への署名、アップロード、アプリ製品リストの作成など、必要に応じてすべての手順に従いました。
何らかの理由で、私のアプリが onCreate メソッドでこれらの行を実行すると:
Log.e("sc2","About to check if billing is supported");
// Check if billing is supported.
ResponseHandler.register(mDungeonsPurchaseObserver);
if (!mBillingService.checkBillingSupported()) {
Log.e("sc2","failed check for billing supported");
showDialog(DIALOG_CANNOT_CONNECT_ID);
}
if (!mBillingService.checkBillingSupported(Consts.ITEM_TYPE_SUBSCRIPTION)) {
Log.e("sc2","failed check for billing supported subscriptions");
showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID);
}
Log.e("sc2","Finished checking if billing is supported");
どちらのダイアログも表示されません - すべてが市場請求サービスに正しくバインドされていることを示唆しています。
ただし、 PurchaseObserver コールバックでは、これらの行:
private class SC2PurchaseObserver extends PurchaseObserver {
public SC2PurchaseObserver(Handler handler) {
super(UpgradesActivity.this, handler);
}
@Override
public void onBillingSupported(boolean supported, String type) {
if (Consts.DEBUG) {
Log.e("sc2", "supported: " + supported+":"+type);
}
if (type == null || type.equals(Consts.ITEM_TYPE_INAPP)) {
if (supported) {
restoreDatabase();
mBuyButton.setEnabled(true);
mEditPayloadButton.setEnabled(true);
} else {
showDialog(DIALOG_BILLING_NOT_SUPPORTED_ID);
}
} else if (type.equals(Consts.ITEM_TYPE_SUBSCRIPTION)) {
mCatalogAdapter.setSubscriptionsSupported(supported);
} else {
showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID);
}
}
ログ メッセージは次のように表示されます。
サポート: false:null サポート: false:subs
Androidマーケットのコールバックが、アプリの請求標準でも、サブスクリプションが有効になっていないとも言われていないことを示唆しています....
誰かが最初のチェックが失敗しない理由を説明してもらえますか?
どうもありがとう