Open flaming-toast opened 5 months ago
+1 needed please
We got the same message, hopefully it's a fairly easy fix
+1 needed
We got the same message, hopefully it's a fairly easy fix
I think depending on how much the API has changed, I will probably attempt it today to upgrade it and see if it explodes in my face.
I have no way of testing this at the moment since I am still working on my in-app purchases for my game, is anyone available to check:
@Veradictus I successfully built the .aar
file and compiled the app. So, so far so good! I've sent the app to Google for review, will let you know it how it goes once it's approved. Thanks for your the help on this!
It's been approved by Google, so that's a good sign, but it doesn't seem to be working 100% yet.
It seems the signal sku_details_query_completed
is now product_details_query_completed
and item.sku
is now item.productId
These aren't problems, but what is a problem is that payment.queryProductDetails(["name0", "name1], "inapp")
now only returns details for name0
instead of everything in that array.
I'll keep investigating.
That section there needs to be updated to not just get the first product only. This gets all the items in one call:
ArrayList<QueryProductDetailsParams.Product> productList = new ArrayList<QueryProductDetailsParams.Product>();
for (String productId : productIdList) {
QueryProductDetailsParams.Product product = QueryProductDetailsParams.Product.newBuilder()
.setProductId(productId)
.setProductType(type)
.build();
productList.add(product);
}
QueryProductDetailsParams params = QueryProductDetailsParams.newBuilder()
.setProductList(productList)
.build();
I'm not a Java developer (and I really don't like the language, don't @ me!) so there might be a better way of doing this, but so far it seems to be working.
Solid, will try to fix it. I'm starting in-app purchases for my game today so I will update further as needed, and once the game is published on the Play Store and transactions work as intended, I will create a PR into this repo.
I think this should fix your last problem... At least on my side, it fixes some issue I got. I have taken some code from the godot master branch.
check for the <<<<<<<<<<<<<<<<<<<<<<<<<
public static Dictionary convertPurchaseToDictionary(Purchase purchase) {
Dictionary dictionary = new Dictionary();
dictionary.put("original_json", purchase.getOriginalJson());
dictionary.put("order_id", purchase.getOrderId());
dictionary.put("package_name", purchase.getPackageName());
dictionary.put("purchase_state", purchase.getPurchaseState());
dictionary.put("purchase_time", purchase.getPurchaseTime());
dictionary.put("purchase_token", purchase.getPurchaseToken());
dictionary.put("quantity", purchase.getQuantity());
dictionary.put("signature", purchase.getSignature());
// PBL V4 replaced getSku with getSkus to support multi-sku purchases,
// use the first entry for "sku" and generate an array for "skus"
// BUG ArrayList<String> skus = purchase.getSkus(); <<<<<<<<<<<<<<<<<<<<<<
// BUG dictionary.put("sku", skus.get(0)); <<<<<<<<<<<<<<<<<<<<<<
// BUG String[] skusArray = skus.toArray(new String[0]); <<<<<<<<<<<<<<<<<<<<<<
// BUG dictionary.put("skus", skusArray);
String[] products = purchase.getProducts().toArray(new String[0]); // NEW <<<<<<<<<<<<<<<<<<<<<<
dictionary.put("products", products); // NEW<<<<<<<<<<<<<<<<<<<<<<
dictionary.put("is_acknowledged", purchase.isAcknowledged());
dictionary.put("is_auto_renewing", purchase.isAutoRenewing());
return dictionary;
}
I think this should fix your last problem... At least on my side, it fixes some issue I got. I have taken some code from the godot master branch.
check for the <<<<<<<<<<<<<<<<<<<<<<<<<
public static Dictionary convertPurchaseToDictionary(Purchase purchase) { Dictionary dictionary = new Dictionary(); dictionary.put("original_json", purchase.getOriginalJson()); dictionary.put("order_id", purchase.getOrderId()); dictionary.put("package_name", purchase.getPackageName()); dictionary.put("purchase_state", purchase.getPurchaseState()); dictionary.put("purchase_time", purchase.getPurchaseTime()); dictionary.put("purchase_token", purchase.getPurchaseToken()); dictionary.put("quantity", purchase.getQuantity()); dictionary.put("signature", purchase.getSignature()); // PBL V4 replaced getSku with getSkus to support multi-sku purchases, // use the first entry for "sku" and generate an array for "skus" // BUG ArrayList<String> skus = purchase.getSkus(); <<<<<<<<<<<<<<<<<<<<<< // BUG dictionary.put("sku", skus.get(0)); <<<<<<<<<<<<<<<<<<<<<< // BUG String[] skusArray = skus.toArray(new String[0]); <<<<<<<<<<<<<<<<<<<<<< // BUG dictionary.put("skus", skusArray); String[] products = purchase.getProducts().toArray(new String[0]); // NEW <<<<<<<<<<<<<<<<<<<<<< dictionary.put("products", products); // NEW<<<<<<<<<<<<<<<<<<<<<< dictionary.put("is_acknowledged", purchase.isAcknowledged()); dictionary.put("is_auto_renewing", purchase.isAutoRenewing()); return dictionary; }
Awesome, I haven't had any time to update my code, much appreciated!
Just found another issue in another file ( GodotGooglePlayBilling.java ) I'm not a java developper, so my code may not be optimal. But now, I can see my item prices.
@UsedByGodot
public void queryProductDetails(final String[] list, String type) {
List<String> productIdList = Arrays.asList(list);
List<QueryProductDetailsParams.Product> productList = new ArrayList<>();
for(String productId : productIdList )
{
productList.add( QueryProductDetailsParams.Product.newBuilder()
.setProductId(productId)
.setProductType(type)
.build());
}
//QueryProductDetailsParams.Product product = QueryProductDetailsParams.Product.newBuilder()
// .setProductId(productIdList.get(0))
// .setProductType(type)
// .build();
QueryProductDetailsParams params = QueryProductDetailsParams.newBuilder()
.setProductList(productList) // Arrays.asList(product))
.build();
...
If anyone is interested, here is the repository of the working plugin that I prepared for using Google Play Billing Library version 6.2.1 on Android for Godot 3.5.2 (https://github.com/201949/godot-google-play-billing-6)
@201949 You're amazing, thank you so much for this! 🚀 Would you consider making a pull request so that upstream may benefit from it as well? 😊
@akien-mga Hi Rémi! I'm so sorry for the ping, you must have a lot on your plate.. 😭 But I'm not entirely sure who the maintainer of this repository is, and l wanted to at least let someone know about the current situation with this plugin as the Aug 31st deadline will be coming up soon 🙇🏻♀️🙇🏻♀️ Thank you so much for your attention 🙏
@201949 You're amazing, thank you so much for this! 🚀 Would you consider making a pull request so that upstream may benefit from it as well? 😊
@flaming-toast I attempted to transition to Google Play Billing Library version 7 using the existing official upstream plugin, but I was unsuccessful, just as I was with the transition to version 6. Therefore, to address the need for organizing one-time purchases in my existing applications with the outdated library, I created my own solution, guided by official sources on the Google Play Billing Library. Additionally, I have now implemented support for subscriptions and made it publicly available. Here is the Release 6.2.1 with subs
@201949 This is awesome! Thank you so much for updating and even improving on the plugin! Since this official repository seems unmaintained now, I'll try migrating to your plugin, will let you know if I run into any issues 🙇🏻♀️ Thank you!
https://github.com/dgsdestinygamestudios/godot-google-play-billing/tree/main v2 plugin structure, tested on Godot 4.2. Just for android though. If you use, please let me know.
https://github.com/dgsdestinygamestudios/godot-google-play-billing/tree/main v2 plugin structure, tested on Godot 4.2. Just for android though. If you use, please let me know.
@dgsdestinygamestudios I'm very happy for you that you managed to build the plugin for the new v2 structure. I hope you will share the source code soon so that we can see your implementation of the methods for working with the Google Play Billing Library. I hope that my solutions have also helped you in your implementation.
@201949 thank you. Given that Billing library 6 won't be a long-term fix, I figured I should try to go for 7. I've shared java part of the things. If you see anything wrong, feel free to help. Also yes, I've extensively read your code, Remi's code and the documentation to understand what is going on, so thank you.
I've created an new addon for the Godot 4.2 that integrates with Google Play Billing Library version 7. This module supports all the public functions provided by the library, handles all error codes, and can work with different pricing plans within subscriptions.
You can check it out here: https://github.com/code-with-max/godot-google-play-iapp
I hope this addon helps you with your projects. Feedback and contributions are welcome!
Happy coding!
@code-with-max Do you plan to create a PR and merge it back with the offical plugin?
@code-with-max Do you plan to create a PR and merge it back with the offical plugin?
I'm not sure I can do this for several reasons:
@code-with-max Thanks for the update, but when I try to use the new version it gives me an error: Please ensure the app is signed correctly.", "response_code": 5
(the old version works for me)
And according to a Google search it says: code 5: BILLING_RESPONSE_RESULT_DEVELOPER_ERROR: Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest
I see that it gets the product names but when you click on purchase it gives this error.
@Shay-M Write an example of your request.
@code-with-max Thanks for the update, but when I try to use the new version it gives me an error: Please ensure the app is signed correctly.", "response_code": 5
(the old version works for me)
And according to a Google search it says: code 5: BILLING_RESPONSE_RESULT_DEVELOPER_ERROR: Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest
I see that it gets the product names but when you click on purchase it gives this error.
Check your debug and release keystores.
Project > Export > select Android > scroll down until you see keystores > assign
Thank you for the quick reply:
@dgsdestinygamestudios In the old version I only had Release and it worked. Now I also added it to Debug and it still doesn't work.
@code-with-max I used the code of the example :
GooglePlayBilling.do_purchase("remove_ads")
func do_purchase(id: String, is_personalized: bool = false): billing.purchase([id], is_personalized)
And of course I changed it:
const ITEM_ACKNOWLEDGED: Array = [ "remove_ads" ]
AndroidIAPP singleton loaded Billing: start connection Billing successfully connected "remove_ads" "remove_ads" { "debug_message": "Please ensure the app is signed correctly.", "response_code": 5 }
Thank you for the quick reply:
@dgsdestinygamestudios In the old version I only had Release and it worked. Now I also added it to Debug and it still doesn't work.
@code-with-max I used the code of the example :
GooglePlayBilling.do_purchase("remove_ads")
func do_purchase(id: String, is_personalized: bool = false): billing.purchase([id], is_personalized)
And of course I changed it:
const ITEM_ACKNOWLEDGED: Array = [ "remove_ads" ]
AndroidIAPP singleton loaded Billing: start connection Billing successfully connected "remove_ads" "remove_ads" { "debug_message": "Please ensure the app is signed correctly.", "response_code": 5 }
Then check your AndroidManifest file and unique name. Make sure you enter the unique name of your game. example: com.example.$genname
Yes, I have in the settings:
Did you publish an internal testing with this build? Billing library needs latest aab to work.
Yes, I have in the settings:
@dgsdestinygamestudios @Shay-M I make new versions of plug-in achieve with separated "release" and "debug" versions. In fact, the differences between them are minimal, but I want to eliminate all errors.
https://github.com/code-with-max/godot-google-play-iapp/releases/tag/v1.2
@dgsdestinygamestudios @code-with-max Ok, I will try and update with the new version + through internal testing
In the previous version, I did the run through godot and a physical connection of my device (this is how it worked)
Nice it works :) But It only works for me only from the google store. The question is what can be done that will also work in lectures with the physical connection of the device? while debugging
@Shay-M I'm sorry, I don't really understand. Do you want to use this plugin for an application that does not use the Google Store?
@code-with-max Ah sorry I didn't explain myself. When I upload the app to the store and run it from there it works. But when I run it from godot (when I connect the device physically so I can check that everything works - debug locally) it still gives the error response_code": 5
As I understand your conversation, you need to register the payment tester in the Google Developer Console. Settings -> License testing. Otherwise, payment testing will have to be carried out in a published application with a real payment method. Or did I misunderstand the conversation? I will add that essentially, in-app payments can only be tested using the release-signed APK file (the one we upload to the Google Play console). https://developer.android.com/google/play/billing/test
@201949 @Shay-M Don`t forget put license key in special field on Godot export options
Hi, thank you for your help! I found a solution to the problem: "Clear you cache from the google play store account. 😶
I believe that now everything will work
@201949 I'm trying to use your Google Play Billing Library 6.2.1, but when I export my game and test it on device through an internal test, the app crashes after 2 seconds. In your code, the _on_connected() function first starts a 2s timer, so my guess is that whatever happens after crashes the app, I just don't know what.. Have you got any idea? I just copied your code without changes. The app seems to work fine for the first 2 seconds.
EDIT: I think I just fixed my own issue. I noticed in Google Play Console that the app needed permission for internet. In the Godot export dialog I checked internet and now it seems to work. For if anyone stumbles on the same problem.
@201949 First of all, thank you for making the Google Play Billing 6.2.1 plugin! It was really needed.
Would it be possible to add more documentation/notes it? I'm trying to work with it now but there is a lot of code that I don't know the purpose/workings of. It would be helpful to me and other people who use your code to have some sort of helping hand.
@dalvaren what Godot version are you using? You should give this pr a try. Although it's still not complete but it work for me with basic using. Of course if you're upgrade from a very old version you have to update something.
These signal changed:
payment.connect("sku_details_query_completed", self, "_on_product_details_query_completed") # SKUs (Dictionary[])
payment.connect("sku_details_query_error", self, "_on_product_details_query_error") # Response ID (int), Debug message (string), Queried SKUs (string[]
Also replace all .id
to .sku
It should work for now.
@kyoz DO you know if that PR also works for Godot 3.5.3?
I'm using it for all of my games now, yes of course that pr is still not completely complete, but if your usecase is simple like me, just allow user to purchase an item, it should work fine.
Here is the build for 3.5.3 which i've built and used:
GodotGooglePlayBilling-v7-3.5.3.zip
You can give it a try.
@201949 Just wanted to let you know that I got everything working thanks to your plugin! Thank you so much for your effort.
I do have 1 question. Does Android/Google have something like a "Restore purchases" feature like in iOS? And if so, does your plugin support that?
EDIT: Asked if I could donate but I found the button in GitHub.
I have projects using at 4.2.1 and 4.3,
How I am going to update to version Google Play Billing Library version 6.0.1 ?
Thanks
Starting tomorrow, our game updates will be rejected unless we update the billing plugin. Do we have any updates on when the plugin will be compatible with the new requirements?
Starting tomorrow, our game updates will be rejected unless we update the billing plugin. Do we have any updates on when the plugin will be compatible with the new requirements?
I used the plugin made by @201949 and solved this problem for my game. Good luck!
Starting tomorrow, our game updates will be rejected unless we update the billing plugin. Do we have any updates on when the plugin will be compatible with the new requirements?
I used the plugin made by @201949 and solved this problem for my game. Good luck!
Hi Is this compatible with godot 4.3?
Hi @wargaming0009,
Yes, my plugin also works in Godot 4.3, but at the moment I have not prepared a corresponding release. However, you can rebuild my plugin for the Godot 4.3 library. In this case, you will need to make some changes to your gdscript
singleton to match the correct syntax of the new Godot 4.3 version.
If you need a working plugin for the Godot 4.X branch, try using the following plugin: AndroidIAPP Godot Plugin by @code-with-max
Hope this helps you.
Hello!
Got this message just today on Google Play Console, it looks like this plugin will need to be upgraded to a newer version of the Google Play Billing library by August 24th if I'm not mistaken?