Android In-App Billing v3: “Can't perform operation: queryInventory”

后端 未结 11 2121
野趣味
野趣味 2021-01-31 09:15

I have setup In-App Billing for the first time using the new v3 API. It is working correctly on my devices but I have received a lot of error reports from other users.

O

11条回答
  •  鱼传尺愫
    2021-01-31 09:50

    Make sure you are implementing the IabHelper.han.handleActivityResult(requestCode, resultCode, data) method in your activities onActivityResult method.

       @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    
    // Pass on the activity result to the helper for handling
      if (!mIabHelper.handleActivityResult(requestCode, resultCode, data)) {
          // not handled, so handle it ourselves (here's where you'd
          // perform any handling of activity results not related to in-app
          // billing...
          super.onActivityResult(requestCode, resultCode, data);
      } else {
          Log.i(TAG, "onActivityResult handled by IABUtil.");
      }
    }
    

提交回复
热议问题