in-app billing android return authentication is required when try to subscribe to product(尝试订阅产品时需要应用内计费android返回身份验证)
问题描述
这是我第一次在 android 中处理 In-App Billing1) 我正在使用 API v32)我已经上传了我的应用程序的 alpha 版本以便能够测试
This is my first time to deal with In-App Billing in android 1) I am using API v3 2) I have upload alpha version of my app to be able to test then
3) 我创建了一个订阅产品
3) I have created a subscribe product
4) 这是我在产品中订阅的代码
4) This is my code to subscribe in the product
mSubscribeButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
Bundle subscribeIntentBundle = mService.getBuyIntent(3, getPackageName(), "my_product_id", "subs", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
PendingIntent pendingIntent = subscribeIntentBundle.getParcelable("BUY_INTENT");
if (subscribeIntentBundle.getInt("RESPONSE_CODE") == 0) {
startIntentSenderForResult(pendingIntent.getIntentSender(), 4002, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
} else {
Toast.makeText(MainActivity.this, "Error Code: " + subscribeIntentBundle.getInt("RESPONSE_CODE"), Toast.LENGTH_SHORT).show();
}
} catch (RemoteException e) {
e.printStackTrace();
} catch (SendIntentException e) {
e.printStackTrace();
}
}
});
5) 我收到以下错误
我尝试使用不同的设备,都出现同样的错误,我也用我的 Google 帐户登录,可以打开 Google Play 商店并查看我的应用程序
I have tried to use different devices and all have the same error, I am also logged in with my Google account and can open Google Play Store and view my apps
我也尝试从应用管理器中清除 Google Play 商店的数据
I have tried also to clear data of Google Play Store from app manager
有人可以帮忙吗??
推荐答案
我之前也有同样的问题.转到您的 google 开发者控制台并确保您的应用已发布到任何版本(alpha、beta 或 prod).然后,应用内购买将起作用:)
I have the same issue previously. Go to your google developer console and make sure your app is PUBLISHED to any version(alpha, beta or prod). Then, the In app purchase will work :)
这篇关于尝试订阅产品时需要应用内计费android返回身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:尝试订阅产品时需要应用内计费android返回身份验证
基础教程推荐
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- Android Volley - 如何动画图像加载? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
