Android In-App Billing list of available products

北战南征 提交于 2019-12-07 00:18:36

问题


Is it somehow possible to get a list of all available products from the Play Store?

What I want to do is to get all available items and then show them in a ListView. Whenever someone taps the ListView the right item is opened in Google Play Store.

Is that possible? And if yes, how?


回答1:


Third-paty apis and services are not reliable. There is no reliable and convenient way for production yet. You have to store it on your server in encrypted json data file for example, without any php/java/something, just static file.

OR you can guess item skus in your code and check even non-existing items: myitem_00-myitem_99 for example.




回答2:


As mentioned in this post, this is now possible using the Google Play Developer API (a.k.a. android-publisher):

https://developers.google.com/android-publisher/

In particular, the Inappproducts: list API:

List all the in-app products for an Android app, both subscriptions and managed in-app products.




回答3:


You can try this Google Play Store Api, or you can also look into this Android Market API.

But both of these are unofficial.




回答4:


This url will show you what to do:

http://developer.android.com/training/in-app-billing/list-iab-products.html#QueryDetails




回答5:


You have to do below things.

  • establish the connection between your app and google play app.
  • Get the list of products which is register in your google console.
  • prapare arraylist that contains product's id name and put into Bundle
  • code to get purchase
    ArrayList<String> skuList = new ArrayList<String> (); skuList.add("premiumUpgrade"); skuList.add("gas"); Bundle querySkus = new Bundle(); querySkus.putStringArrayList(“ITEM_ID_LIST”, skuList);

    • finaly one methode is reday in google_play_app that we need to call
  • Bundle skuDetails = mService.getSkuDetails(3, getPackageName(), "inapp", querySkus);

  • call the getSkuDetails method on the In-app Billing Version 3 API, and pass the method the In-app Billing API version (“3”), the package name of your calling app, the purchase type (“inapp”), and the Bundle is our response

  • extract the bundle and get the product names and display it in ativity.


来源:https://stackoverflow.com/questions/14135571/android-in-app-billing-list-of-available-products

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!