简体   繁体   English

无法使用Fovea购买插件从Google Play商店中检索产品

[英]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: 这是我已经仔细检查的内容:

  • "unlockgame" is the correct product ID “unlockgame”是正确的产品ID
  • The product is defined in the Play console and is Active 该产品在Play控制台中定义并处于活动状态
  • The app is published and active 该应用程序已发布并处于活动状
  • The app is built in release mode and running on a real device 该应用程序内置于发布模式并在真实设备上运行
  • The device can reach the Play store okay 该设备可以访问Play商店
  • My app's license key is stored in res/values/billing_key.xml 我的应用程序许可证密钥存储在res / values / billing_key.xml中

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.

相关问题 如何从Google Play商店中检索所有应用内购买商品 - how to retrieve all the in app purchase items from the Google Play store 从Google Play商店和Apple App Store获取购买日期 - Get purchase date from Google Play Store and Apple App Store 从 Play 商店获取产品数据,但我无法购买 - Fetch product data from Play Store but I cannot make a purchase 在 Flutter 中从 Play 商店获取产品时应用内购买崩溃 - in-app purchase crashes when fetching products from the Play Store in Flutter 这可以从 Google Play 商店获得付费应用购买收据吗? - Is this possible to get Paid app purchase receipt from Google Play store? 使用谷歌播放服务器上的Android应用程序进行应用程序内购买(测试产品)时出错 - Error during In-app Purchase(Test Products) with my Android app from google play server 使用计费客户端从 google play 检索特定用户的 Inapp 购买 - Retrieve the Inapp purchase of particular user from google play using billing client 从Java Server检查Google Play购买 - Check a Google Play Purchase from Java Server 如何从Google Play商店中检索“我的应用”列表 - How to retrieve list of “My App” from Google Play Store 我如何在Google Play商店中获得购买游戏的时间 - How can I get the time of game purchase on Google Play store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM