有没有办法从应用程序内兑换促销代码? [英] Is there a way to redeem a promo code from within the app?

查看:20
本文介绍了有没有办法从应用程序内兑换促销代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自今年年初以来,可以为应用使用促销代码:创建促销活动

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.

这篇关于有没有办法从应用程序内兑换促销代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆