问题描述
这是我第一次在 android 中处理 In-App Billing1) 我正在使用 API v32)我已经上传了我的应用程序的 alpha 版本以便能够测试
This is my first time to deal with In-App Billing in android1) I am using API v32) 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返回身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!