Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
550 views
in Technique[技术] by (71.8m points)

android - GooglePlay: The item you requested is not available for purchase

I am getting the following from the Google Play IAB API;

The item you requested is not available for purchase

I have however successfully tested against static responses, and in addition, the following code returns myProductId in the list of available products;

ArrayList<String> skuList = new ArrayList<String> ();
skuList.add("myProductId");
Bundle querySkus = new Bundle();
querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
Bundle skuDetails = service.getSkuDetails(3, activity.getPackageName(), "inapp", querySkus);

In addition I have;

  • Published a beta APK
  • Added a test user to the beta and opted in via the URL
  • Logged on the device with the test user (gmail account)
  • Pushed a signed APK with the same versioncode to the device
  • Activated the product

The purchasing code I am using is;

Bundle buyIntentBundle = service.getBuyIntent(3, activity.getPackageName(), "myProductId", "inapp", "payload");
PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
activity.startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));

Finally, logcat shows the following;

D/Finsky: [1] PurchaseFragment.onStateChange: Error: PurchaseError{type=3 subtype=0}
D/Finsky: [1] PurchaseFragment.onStateChange: Purchase failed: PurchaseError{type=3 subtype=0}

Whilst there are other questions related to this issue, none of them solve it for me;

  1. the item you requested is not available for purchase
    • Product is active
  2. The item you have requested is not available for purchase
    • Testing with Static Responses is successful for product android.test.purchased
  3. Android In App Purchase “Item that you have requested is not available for purchase” Error
    • Test user logged in
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

App must be installed from Playstore via opt-in URL. this will help the app to authorize from LICENSING & IN-APP BILLING(Base64-encoded).

Edit : We can test the signed apk on device by installing using adb tool. and

1.The android:versionCode and android:versionName attributes values in the AndroidManifest.xml of the application that you are installing matches the values of your APK in the Developer Console.

2.Your application is signed with the same certificate that you used for the APK that you uploaded to the Developer Console, before installing it on your device.

http://developer.android.com/training/in-app-billing/test-iab-app.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...