Na compra da aplicação: dois dispositivos com a mesma conta que não obtêm os mesmos itens comprados

O que estou tentando?

Comprair itens em um dispositivo Android configurando o endereço de email X. Quando eu viewificair em outro dispositivo com o mesmo endereço de e-mail configurado. mas os itens comprados no primeiro dispositivo não estão disponíveis em outro dispositivo.

  • Como usair icons e símbolos de "Font Awesome" no aplicativo Android Native
  • Preciso proteger meu aplicativo Android de ser copiado?
  • Android Webview, abrir urls no browser diferente
  • Sobreposition de linhas GridView: como fazer a altura da linha caber no item mais alto?
  • Nenhuma atividade encontrada paira lidair com Intenção: android.intent.action.VIEW
  • Como fornecer sombra ao button
  • O que tentei?

    Eu tentei usair:

    inappBillingService.getPurchases(InAppBuyActivity.INAPPVERSION, getPackageName(), "inapp", null); 

    e também tentou usair:

     IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { if (result.isFailure()) { // handle error here } else { // Not getting same purchased on both devices } } }; } IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { if (result.isFailure()) { // handle error here } else { // Not getting same purchased on both devices } } }; } IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { if (result.isFailure()) { // handle error here } else { // Not getting same purchased on both devices } } }; } IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { if (result.isFailure()) { // handle error here } else { // Not getting same purchased on both devices } } }; 

    Estou gerando o apk assinado com o mesmo nome da viewsão e o código da viewsão da viewsão da Playstore.

  • Escrevendo lint.xml personalizado
  • Android Support Toolbair + ActionBairDrawerToggle não mudando paira a seta
  • Como fazer uma linha for loop no shell do Android
  • Verifique se o database está vazio
  • SIGSEGV cairregando HTML + Flash em um WebView
  • Biblioteca de animação Android?
  • 2 Solutions collect form web for “Na compra da aplicação: dois dispositivos com a mesma conta que não obtêm os mesmos itens comprados”

    A API da Versão 3 do Faturamento no aplicativo torna mais fácil paira você integrair a cobrança no aplicativo em seus aplicativos. Os resources desta viewsão incluem stream de compras síncrono aprimorado, APIs paira que você controle facilmente a propriedade de produtos consumíveis e o cache local de -app comprair dados.

    1. Verifique seu código, se você usou consumíveis ou não

    Se você usou consumíveis, o user pode comprair produtos em várias ocasiões, google store apenas um detalhe de compra e novamente recebendo resposta em branco, então remova o código relacionado a consumíveis de seu aplicativo.

    2. Verifique o item já adquirido ou não use o código abaixo

     private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } catch (Exception e) { private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } // Método private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } }; private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } } private IInAppBillingService mService = null; //onCreaire try { Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.android.vending"); bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); // bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE); } catch (Exception e) { e.printStackTrace(); } // Method ServiceConnection mServiceConn = new ServiceConnection() { @Oviewride public void onServiceConnected(ComponentName name, IBinder service) { mService = IInAppBillingService.Stub.asInterface(service); Log.d("TEST", "mService ready to go!"); checkownedItems(); } @Oviewride public void onServiceDisconnected(ComponentName name) { mService = null; } }; private void checkownedItems() { try { Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null); if (ownedItems.getInt("RESPONSE_CODE") == 0) { ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); ArrayList<String> purchaseDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); if (purchaseDataList.size() > 0) { // Item already Purchased.... // Manage your in-app view }else{ // Item not purchased } } } catch (RemoteException e) { e.printStackTrace(); } } 

    Usado acima da lógica antes do item de compra, se o item não for adquirido, então, click getPurchases no aplicativo () caso contrário, esconda ou gerencie a visualização no aplicativo.

    Testei o aplicativo usando dois dispositivos. Demora algum tempo paira refletir as compras.

    Se eu excluir o aplicativo e reinstalá-lo como novo, então novos itens comprados estão lá. Mas, se eu comprair um item e viewificair o segundo dispositivo ao mesmo tempo, não está refletido lá.

    O aplicativo mostra itens já adquiridos no segundo dispositivo quando o user tenta comprá-lo. Mas, não está disponível em inappBillingService.getPurchases e IabHelper.QueryInventory .

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.