2013-10-06 1 views
0

저는 이것을 알아 내려고 몇 시간 동안 조사했습니다. 지금까지 내가 한 일이 여기있다. (참고 : 나는 안드로이드 스튜디오에서 개발하고 있어요)IAB 설치가 완료되지 않음

  1. 서명 된 APK를 생성하고있는 인앱 상품을 만들어 내 개발자 콘솔
  2. 에 업로드과
  3. 추가 내 매니페스트에 결제 권한을 활성화
  4. 비슷한 문제를 시도하고 찾기 위해 광범위하게 빗어 낸 스택.

기본적으로 logcat에서 IABHelper가 설정을 시작하지만 언제든지 완료되지는 않습니다. 46 : 44.485 20787-20787/com.ssa.digitaldeskclock의 D/IabHelper :

private static final String TAG = "Preference Activity"; 
private static final String SKU_PRO = "desk.clock.pro.license"; 
static final int RC_REQUEST = 10001; 
IabHelper mHelper; 
private boolean mIsPremium; 
private ArrayList<Preference> proSettings; 
IInAppBillingService mService; 

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    addPreferencesFromResource(R.xml.preferences); 
    bindService(new 
      Intent("com.android.vending.billing.InAppBillingService.BIND"), 
      mServiceConn, Context.BIND_AUTO_CREATE); 
    proSettings = new ArrayList<Preference>(); 
    ActionBar b = getActionBar(); 
    b.setDisplayHomeAsUpEnabled(true); 
    colorListener(); 
    textureListener(); 
    bgColorListener(); 
    onPresetListener(); 
    gradListener(); 


    String base64Key = "[my key from dev console]"; 
    bindService(new 
      Intent("com.android.vending.billing.InAppBillingService.BIND"), 
      mServiceConn, Context.BIND_AUTO_CREATE); 
    mHelper = new IabHelper(this, base64Key); 
    mHelper.enableDebugLogging(true); 
    Log.d(TAG, "Starting setup"); 
    mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() { 
     public void onIabSetupFinished(IabResult result) { 
      if (!result.isSuccess()) { 
       // Oh noes, there was a problem. 
       Log.d(TAG, "Problem setting up In-app Billing: " + result); 
      } 
      Log.d(TAG, "Setting up success"); 

      Log.d(TAG, "querying inventory"); 
      mHelper.queryInventoryAsync(mGotInventoryListener); 
      Log.d(TAG, "queried"); 
     } 
    }); 
IabHelper.QueryInventoryFinishedListener mGotInventoryListener 
     = new IabHelper.QueryInventoryFinishedListener() { 
    public void onQueryInventoryFinished(IabResult result, 
             Inventory inventory) { 

     if (result.isFailure()) { 
      // handle error here 
      mIsPremium = false; 
      disableProAndRevertSettings(); 
     } 
     else { 
      // does the user have the premium upgrade? 
      mIsPremium = inventory.hasPurchase(SKU_PRO); 
      if(mIsPremium) { 
       enableProSettings(); 
      }else { 
       disableProAndRevertSettings(); 
      } 
     } 
    } 
}; 
ServiceConnection mServiceConn = new ServiceConnection() { 
    @Override 
    public void onServiceDisconnected(ComponentName name) { 
     mService = null; 
    } 

    @Override 
    public void onServiceConnected(ComponentName name, 
            IBinder service) { 
     mService = IInAppBillingService.Stub.asInterface(service); 
    } 
}; 
//rest of my activity 

내가이 10-06 15 일 이후 아무것도 결코 내 로그 캣이 라인을 얻을 수 없지만 (리스너는 콜백을 얻을 수 없다) 시작 인앱 결제 설정

+1

실제 장치에서 테스트 중이십니까? 에뮬레이터에서는 작동하지 않습니다. – Tenfour04

+0

예, 개발자 계정과 동일한 계정에 등록 된 HTC에서 테스트했습니다. – Stephen

답변

0

IAB v3 샘플에 대한 모든 util 클래스의 새 버전을 구하는 방법으로 문제가 해결되었습니다. 나는 모든 새로운 파일을 내 util 디렉토리에 추가했고 그것은 완벽하게 진행되었다. 희망적으로 이것은 다른 누군가를 도울 수 있기를 바랍니다. 출처에 대한 링크를 참조하십시오 https://code.google.com/p/marketbilling/source/browse/v3/src/com/example/android/trivialdrivesample/util/IabHelper.java?r=5f6b7abfd0534acd5bfc7c14436f4500c99e0358