0

アプリ内のアプリ購入で利用したい。私は例を挙げて的を射ていました。アプリの購入で完了するまで、すべてが正常に機能します。商品を購入できます。プロセスの完了後にハンドラーを呼び出す必要がありますが、機能しません。したがって、製品はユーザーに渡されません。  

コード部分は次のとおりです。

BillingHelper.requestPurchase(activity, productId); 
Handler mTransactionHandler = new Handler(){

@Override
public void handleMessage(android.os.Message msg) {
   Log.i(TAG, "Transaction complete");
   Log.i(TAG, "Transaction status: "+BillingHelper.latestPurchase.purchaseState);
   Log.i(TAG, "Item purchased is: "+BillingHelper.latestPurchase.productId);
   if(BillingHelper.latestPurchase.isPurchased()){
            // my code is here
       }     
    };
};

startService(new Intent(activity, BillingService.class));
BillingHelper.setCompletedHandler(mTransactionHandler);

何か考えはありますか?

4

0 に答える 0