我已经在我的应用程序中实现了InApp购买,并且可以正常工作。现在想使用促销代码自由获取物品。
在文档中说:您的应用程序应允许用户在应用程序内部兑换促销代码。如果您的应用支持应用内购买工作流程(如发出应用内结算请求所述),则您的应用会自动支持促销代码在应用内的兑换。当您启动应用内购买界面时,用户可以选择使用促销代码来支付购买费用。 https://developer.android.com/google/play/billing/billing_promotions.htmlBut in my application there is not any option to select for promo code. There is only buy option. How can user insert promo code inside app?
这些图片来自PlayStore应用。有Redeem
对话框,看起来像peyment对话框。可以按照本文和以下图片中所述从play store应用程序中打开它。我可以按照以下流程插入我的促销代码,它可以正常工作。 http://www.greenbot.com/article/3043048/android/how-to-redeem-a-google-play-store-promo-code.html。
最佳答案
在此SO中,您找到的解决方案
修改代码
String code = "request code with dialog"
try {
String url = "https://play.google.com/redeem?code=" + URLEncoder.encode(code, "UTF-8");
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
} catch (android.content.ActivityNotFoundException e) {
// Play Store app is not installed
}
关于android - 如何在我的android应用程序中插入促销代码以购买商品?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40342249/