[英]Cannot retrieve products from Google Play store with Fovea purchase plugin
I'm using the Fovea.cc purchase plugin for an Android Cordova app. 我正在为Android Cordova应用程序使用Fovea.cc购买插件 。 The plugin initializes, but cannot find my in-app purchase products - I get the same "Product could not be found" error I would if the product didn't exist or if the app was not published.
该插件初始化,但无法找到我的应用内购买产品 - 我得到相同的“产品无法找到”错误,如果产品不存在或应用程序未发布我会。 I'm looking for more troubleshooting steps.
我正在寻找更多的故障排除步骤。
Here's the relevant code, which is called on app launch: 这是相关代码,在应用程序启动时调用:
store.register({
id: "com.ineptech.wn.unlockgame",
alias: "unlockgame",
type: store.NON_CONSUMABLE
});
store.ready(function() {
console.log("\\o/ STORE READY \\o/"); // This does get called
});
store.when("unlockgame").approved(function (order) {
UnlockContent();
order.finish();
});
store.refresh();
var p = store.get("unlockgame");
popup("Title = " + p.title);
// this displays "Title = null"
And here's the code for the purchase button: 这是购买按钮的代码:
store.order("unlockgame");
// Results in "The item you were attempting to purchase
// could not be found" error from Play Store
Here's what a purchase attempt displays in logcat: 以下是购买尝试在logcat中显示的内容:
I/ActivityManager(424): Displayed com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity: +80ms
E/Volley(22062): [1009] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/preparePurchase
And here's what I've already double-checked: 这是我已经仔细检查的内容:
What else might be keeping the plugin from getting the products? 还有什么可能让插件无法获得产品?
The issue is most probably with your configuration, but first I see is that you're trying to access the product title right after doing store.refresh() 问题很可能与您的配置有关,但首先我看到您在执行store.refresh()后正试图访问产品标题。
store.refresh();
var p = store.get("unlockgame");
However, store.refresh()
method is asynchronous and will just trigger a request to the server. 但是,
store.refresh()
方法是异步的,只会触发对服务器的请求。 You can monitor changes to your product this way: 您可以通过以下方式监控产品的更改:
store.when("unlockgame").updated(function(p) {
alert("product is " + p.state + ", title is " + p.title);
});
Then call: 然后打电话:
store.refresh();
Also check that the product ID on the play console is com.ineptech.wn.unlockgame
, not just unlockgame
, and that it's of type Managed
. 还要检查播放控制台上的产品ID是
com.ineptech.wn.unlockgame
,而不仅仅是unlockgame
,它的类型是Managed
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.