2016-06-23 45 views
0

我正在進行應用內購買的第一次。所以請引導我一些很好的解決方案。我試圖刪除並添加Playstore帳戶清除數據等,但沒有爲我工作。所以請給出一些很好的建議。這是我的問題。錯誤檢索信息從服務器[df-dic-02]在android中

我使用第三方API [鏈接] [1]

[1]在應用程序內購買工作:https://github.com/anjlab/android-inapp-billing-v3但是當我在購買點擊,谷歌播放顯示此對話框(出錯信息檢索從服務器[df-dic-02])。這裏是我使用

public class Launcher extends Activity 
 
     implements BillingProcessor.IBillingHandler{ 
 

 

 
bp = new BillingProcessor(this,license_key, this); 
 

 
    @Override 
 
    public void onBillingInitialized() { 
 
     /* 
 
     * Called when BillingProcessor was initialized and it's ready to purchase 
 
     */ 
 
    } 
 

 
    @Override 
 
    public void onProductPurchased(String productId, TransactionDetails details) { 
 
     /* 
 
     * Called when requested PRODUCT ID was successfully purchased 
 
     */ 
 
    } 
 

 
    @Override 
 
    public void onBillingError(int errorCode, Throwable error) { 
 
     /* 
 
     * Called when some error occurred. See Constants class for more details 
 
     * 
 
     * Note - this includes handling the case where the user canceled the buy dialog: 
 
     * errorCode = Constants.BILLING_RESPONSE_RESULT_USER_CANCELED 
 
     */ 
 
    } 
 

 
    @Override 
 
    public void onPurchaseHistoryRestored() { 
 
     /* 
 
     * Called when purchase history was restored and the list of all owned PRODUCT ID's 
 
     * was loaded from Google Play 
 
     */ 
 
    } 
 

 
    @Override 
 
    protected void onActivityResult(
 
      final int requestCode, final int resultCode, final Intent data) { 
 
     if (!bp.handleActivityResult(requestCode, resultCode, data)) 
 
      super.onActivityResult(requestCode, resultCode, data); 
 
    } 
 
}

回答

0

這個問題是竊聽我,直到我意識到我錯過鍵入的產品ID代碼。 你可能想檢查你的也。

我使用谷歌的虛擬產品ID的

"android.test.purchased" 

和呼叫

billingProcessor.purchase(this, "android.test.purchased"); 

此調用應該工作,讓你從Play商店正常的虛擬迴應

相關問題