Is there a way to redeem a promo code from within the app?(有没有办法从应用程序内兑换促销代码?)
问题描述
自今年年初以来,可以为应用使用促销代码:创建促销活动
Since beginning of this year, it's possible to use promo codes for apps: Create promotions
如页面应用内促销所述,促销代码也可以在应用内兑换.
As described on the page In-app Promotions, promo codes can also be redeemed from within the app.
它还说您也可以在 Play 商店中保留 SKU,因此获取该商品的唯一方法是输入该 SKU 的促销代码.".
It also says "You can also keep a SKU off the Play Store, so the only way to get that item is by entering that SKU's promo code.".
这就是我想要的应用内产品:只让用户通过在应用内输入促销代码来获得应用内产品,不允许用钱购买.
That's what I want for an in app product: Only let a user get an in app product by entering the promo code within the app and do not allow to buy it with money.
如何做到这一点?
推荐答案
通过分析 Play Store 应用,我发现当前版本打开Redeem your code"对话框,意图如下:
By analyzing the Play Store app I found out that the current version opens the "Redeem your code" dialog with the following intent:
try {
final Uri redeemUri = Uri.parse("https://play.google.com/redeem");
final Intent redeemIntent = new Intent(Intent.ACTION_VIEW, redeemUri);
startActivity(redeemIntent);
} catch (android.content.ActivityNotFoundException e) {
// Play Store app is not installed
}
请注意,这可能会在任何新版本的 Play 商店中发生变化.
Please note that this may change in any new version of Play Store.
这篇关于有没有办法从应用程序内兑换促销代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法从应用程序内兑换促销代码?
基础教程推荐
- Play 商店的设备兼容性问题 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- Android Volley - 如何动画图像加载? 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
