android - 亚马逊应用内支付

标签 android amazon

我已按照以下步骤操作如图所示..In AppPayment amazon 中的步骤 但问题是当我单击时运行 sdk 中提供的代码,如图 4 所示 该按钮的点击次数应该被扣除,但事实并非如此。 我已经在这些步骤中将以下值放在 string.xml 中了吗?

  <string name="app_name">amazoncheckout</string>
 <string name="nothing"></string>
<string name="consumable_sku">com.amazon.checkout</string>
<string name="entitlement_sku_purple">com.amazoncheckoutconsumable</string>
<string name="entitlement_sku_green">com.amazoncheckoutentitlementn</string>
<string name="entitlement_sku_blue">com.amazon.buttonclicker.blue_button</string>
<string name="parent_subscription_sku">com.amazoncheckoutsubscription</string>
<string  name="child_subscription_sku_monthly">com.amazoncheckoutsubscriptionmonthly</string>

enter image description here

上面的 sku 是我生成的,我也想知道图三所示的 json 文件,我已经下载并放置了 在 assert 文件夹中 .. 这个 json 文件是做什么用的? 请在我错误的地方对我的步骤发表评论...点击次数显示为 5 但当我点击时它没有被扣除,为什么? 任何帮助都会被应用.... 谢谢

最佳答案

我将尝试解释您如何让演示工作,因为,我认为,这是您的问题,如果我错了,抱歉...

  1. 在您的设备中安装 AmazonSDKTester.apk 并打开它。它位于 SDK 包中的 tools 文件夹内。要安装它,您可以在终端中使用:

    adb install AmazonSDKTester.apk

  2. 接下来将您的项目添加到 Eclipse:

    File > New > Project...>Android Project from Existing Code,浏览 SDK 文件夹中的 Button Clicker Demo Project 并完成。

  3. 将amazon.sdktester.json文件复制到SD内存。在 ButtonClicker 项目文件夹中,转到 Assets 文件夹并将 amazon.sdktester.json 文件添加到 SD 内存。一种简单的方法是使用 DDMS 文件资源管理器将文件拖到 SD 文件夹。您的 SD 文件夹可能因设备而异,在我的 Nexus S 中就像您在图像中看到的那样。

enter image description here

就是这样,您必须让 Button Clicker Demo 示例完全正常工作。当您进行购买时,您可以前往 AmazonSDKTester 并查看您的所有购买。希望对您有所帮助,解决您的问题。

更新:

我要从开发人员文档中复制并粘贴一些文本 (please read this doc because it explains everything great)我希望这对你有帮助:

The SDK Tester is a developer tool that allows users of the Amazon Mobile App SDK to test their implementation in a production-like environment before submitting it to Amazon for publication. This will allow developers to construct test cases that cover all responses generated by the Amazon Mobile App SDK APIs, and give them confidence their apps will be published and run correctly.

这意味着,您必须使用 AmazonSDKTester.apk 来在类似生产的环境中进行测试,一旦它工作正常,您就可以提交您的应用程序以供发布。

The SDK Tester Uses a JavaScript Object Notation (JSON) text file to contain the IAP item information used to respond to IAP API calls. This file resides on the device containing the app under test and the SDK Tester. Once created, the file needs to reside on the device's file system under the path: /mnt/sdcard/amazon.sdktester.json

点击次数没有减少,因为当点击按钮时返回 SKU INVALID 消息(查看 logcat),因为在 sd 卡路径中找不到 .json 文件。

关于android - 亚马逊应用内支付,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16143033/

相关文章:

Android 如何使用 2.2 的新功能并仍然保持代码与 2.1 api 兼容

java - 在膨胀的布局上创建 onClick 事件

android - 如何有条件地为 Android 应用程序使用特定于供应商的 API?

android - 如何向Android真机发送 "geo fix"命令?

android - 如何使用 Gradle 将 romainguy 的 ViewServer 包含在 Android Studio 中?

amazon-s3 - Amazon S3 是否向 CloudFront 发送失效信号?

像亚马逊一样以星级(1-5)排名的算法?

amazon-web-services - 亚马逊 Alexa 技能套件 : How do you link with external app account/userId

amazon-ec2 - Amazon EC2 弹性负载均衡器 : Does its IP ever Change?

android - Appsflyer崩溃:致命异常:MultipleInstallBroadcastReceiver.java第43行的java.lang.NoSuchMethodError