有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java将iApp价格添加到我的应用程序

我希望在我的应用程序中添加应用程序内购买,这样在用户单击购买按钮之前,他们可以看到价格。我想通过编程来实现这一点,因为每个国家都有不同的货币。这可能吗?我似乎在网上找不到任何东西,或者我使用了错误的关键字来查找


共 (1) 个答案

  1. # 1 楼答案

    这个documentation for in-app Billing has a small tutorial for querying prices。它说

    To retrieve this information from Google Play, call the getSkuDetails method on the In-app Billing API

    关于JSON响应的price键,API documentation for ^{}表示:

    Formatted price of the item, including its currency sign. The price does not include tax.

    因此,如果您只需使用此API查询应用商店,就可以获得所需的信息

    你还没有告诉我们你有什么,你在使用什么框架,或者你的代码到目前为止是什么样子,所以我们无法帮助你从哪里开始调用getSkuDetails()方法。但我们可以说:有一个API和文档正是为了这个;-)