Open TheMadProf opened 2 months ago
As far as I can tell it is only the Google Billing dependency that affects the IAP. As a test I will build the IDE with Google Billing v6.0.1 later today and upload to my fork for you to try. I'll provide a link later.
@TheMadProf please try replacing the IDE with the one in the link (back up old IDE first)
https://github.com/ZaxxanStudios/AGKRepoAPI35/blob/main/AGK/AgkIde/Final/Ide.exe
Select RAW to download
This IDE is using billing v6.0.1, the IDE is dated v2024.08.15a
I have tested using the ide file, but it does not fix the problem. The app still crashes when I try to purchase a product.
Ok thanks for the update. It doesn't look like it is because of the Google Billing v7.0 then. If you see a crash report summary then please post on here. The latest update has fixed a lot of issues for other users so the IAP issue will need some investigation. None of my apps use IAP purchasing so I am unable to replicate.
If you could try and isolate if its a particular AGK command that causes the crash that would be useful.
I don't get a crash report. It just exits back to the store page or desktop depending on where the app was launched from.
The above video demonstrates the problem.
I determined by commenting out the code for the IAP stuff, that it's the InAppPurchaseActivate() which seems to cause the crash.
The last build seems to have resolved the App crashing on startup issue I had whenever I included the firebase config file. But this new issue is also problematic.
I've just checked with Lee if it's OK for me to share a API 34 build via a link to my Google Drive to try and determine if it's a API 35 issue and he said it's OK to do this. If you are ok with this I will send you a PM on the forums tomorrow with a link. I'll try using billing v6.0.1 and API 34 first. Your forum name is =Prof= isn't it?
Yes, that's me.
I'll be sure to check the forum tomorrow for your message.
Thanks.
@TheMadProf I've just sent you the link to the API34 build
@ZaxxanStudios I have compiled and built an app using the AGK build from the GoogleDrive you shared earlier (API 34 with billing 6.0.1 I think)
This version does not crash when using the IAP feature, but does suffer from the issue I reported previously about consumable products not resetting properly after purchasing.
As far as I know the Billing version 6 is backward compatible with v5. I'll do a bit of research but I don't have any experience with IAP. This might be one for Lee to have a look at.
On Sat, 21 Sept 2024, 13:35 TheMadProf, @.***> wrote:
@ZaxxanStudios https://github.com/ZaxxanStudios I have compiled and built an app using the AGK build from the GoogleDrive you shared earlier (API 34 with billing 6.0.1 I think)
This version does not crash when using the IAP feature, but does suffer from the issue I reported previously about consumable products not resetting properly after purchasing.
— Reply to this email directly, view it on GitHub https://github.com/TheGameCreators/AGKRepo/issues/24#issuecomment-2365170955, or unsubscribe https://github.com/notifications/unsubscribe-auth/BK346VHF7QQJGMVANPXWHULZXVRY7AVCNFSM6AAAAABOQXRWASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRVGE3TAOJVGU . You are receiving this because you were mentioned.Message ID: @.***>
@ZaxxanStudios That's fair enough. I know Google changed the way consumables worked a while back, and the InAppPurchaseResetPurchase() command introduced into AGK to facilitate it. (https://www.appgamekit.com/documentation/Reference/Extras/InAppPurchaseResetPurchase.htm)
This is the command which doesn't seem to work properly.
My game allows me to purchase a coin pack fine the first time.
A second attempt tells me I already own the purchase, despite it being reset in the code.
A third attempt is successful.
A fourth tells me I already own the purchase
etc.
The issue persists even if the purchases are days apart.
Hi Guys, Can you please help me with this too, I have to submit a play store update for my App by Nov 1st 2024 as my App must target Android 14 (API level 34) or higher and must use Billing Library version 6.0.1 or later. I already requested an extension to this deadline in Aug. But I'm getting the same problem as TheMadProf my App has subscriptions and I have several subscribers. every time I click on the In App Purchase the app crashes with the same code that was working when I compiled it with an old build of AGK Studio V2023 08 23 but on the 2024.09.18 update the products are not recognised by the Google Billing Library. Can i Please also have the link to the API34 build. and if ZaxxanStudios or TheMadProf could help me to get the In app purchases to work I would be so grateful as I'm right down to the line when it comes to time to get this sorted with the play store deadline. My username on the AGK Studio forum is mattyjy2k
Check your PM
Would one of your be able to send me source code that I can use to create a AAB file that uses the IAP so that I can try and replicate the error to fix the API 35 version? Obviously I don't want the full source code to a game but I was thinking a stripped down version that will still compile and can be uploaded to Google Play for testing.
I realise this would take some effort on your part but we really need to try and fix this issue as it is the only real major issue with the latest version.
@Goldfishapps, I've just sent you another pm
Thanks for getting back to me so quickly ZaxxanStudios I really appreciate it Just incase it helps anybody else I will share part of my message to you here as TheMadProf messages really helped me work out what was causing the crashes. My app uses Firebase integration for analytics, notifications, and subscriptions for IAP. The last fully working AGK Studio version for me was ver2024 05 20; I’ve tried every Steam beta version with the same code since then. Versions up to ver2024 07 07 crash after exporting when i click on the App icon if I include the Firebase config file, but the App and the IAP works if I delete the Firebase config. However, ver2024 09 18 works with the Firebase config, but the IAP doesn't work and crashes the app. It seems like the product IDs aren’t recognized by the Billing Library.
I was planning to upload my app to the Play Store using ver2024 07 07, as it has API level 34 and Google Billing API 6.0.1, but internal testing in the Play Store shows a lot of stability issues, likely due to the many Firebase references in my code. Firebase is an important integration for me. It seems that developers who don’t incorporate IAPs or Firebase might not encounter these issues, which is why these bugs may not always appear.
I was testing the IAP with my own Apps spaghetti code but I was also testing with a basic stripped down version of a basic In App Purchase demo so I will try to send you the code in another message here and how to replicate the crashes. By the way, thank you so, so much for your work in keeping AGK Studio alive! I’ve been using TGC products since DarkBasic, and I still love AGK, though it never seems to gain the widespread adoption it deserves. What you’re doing for AGK and the community is amazing. Thanks again, Matt (mattyjjy2k) Gold Fish Apps
@matt, Lee has approved sharing the API 34 build.
If you could sort a test app out for me I will try my best to find a fix
@ZaxxanStudios It's not just the source code you need to test it.
You also need a Google Play developer account (A one off cost of around £20 if memory serves) and have configured the App and In App Purchase items in the developer console.
I have a google play account and a few apps on there (closed loop)
Ok. That will make testing this easier.
I will try and create a test app to demonstrate the problem. But I probably won't have time to do it until the weekend.
Ok 👌
@ZaxxanStudios` I've been trying to do some more testing on the Steam Bata builds with some very simple in app purchase test code IAP's are tricky to test as you need the package name to match to your play console app for the IAP to work and the App needs to be exported. I think the easiest way to test with a real product ID is to just export the code as an APK and side load it for testing as as long the package name matches and the products are set up the IAP process should work on any other build then 2024.09.18 and is much quicker then uploading an AAB file to the play store Internal testing or closed testing however I have tested it that way too. When you click the button on the earlier versions it should start to display the check out process but on build 2024.09.18 it will just crash.
not sure if it's relevant but build 2024.09.18 shows up as 2024.08.15 in About in the IDE.
The code is very stripped back so not sure how much it will help but thought it would keep testing simple and I can confirm it crashes on 2024.09.18 but works on earlier versions
// Project: Added - In App Purchase sub Basic
// Created: 24-10-27
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Added - In App Purchase sub Basic" )
SetWindowSize( 768, 1024, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 768, 1024 ) // doesn't have to match the window
SetOrientationAllowed( 1, 0, 0, 0 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 )
SetPrintSize( 32 )
// Please add your real google Product ID
InAppPurchaseAddProductID( "inputyourproductid.subscription", 2 ) // I only have subscriptions
// InAppPurchaseAddProductID( "test_sub", 2 ) // test products act like they work but real products id don't work on 2024 09 18
InAppPurchaseSetup()
AddVirtualButton( 1, 384, 350, 350 )
SetVirtualButtonSize( 1, 400, 100 )
SetVirtualButtonText( 1, "Start Purchase" )
do
Print( "FPS: " + str(ScreenFPS()) )
Print( GetInAppPurchaseToken(0) )
Print( "Item: " + GetInAppPurchaseDescription(0) + ", " + GetInAppPurchaseLocalPrice(0) + ", State: " + str(GetInAppPurchaseAvailable2(0)) )
if ( GetVirtualButtonReleased(1) ) then InAppPurchaseActivate(0) // purchase item
Sync()
loop
Here are my export settings tried to use just the bare minimum
Hope we can find a fix for the API 35 version as that seems to work with firebase integration and the last build that seemed to be working with firebase and IAP's was version 2024.05.08 Thanks ZaxxanStudios
The IDE build date 2024.08.15 was the date I entered when I did a pull request. Lee merged it with the Repo a few days later. Did you try the link to API 34? The reason the Firebase integration didn't work with the Steam releases after 2024.05.08 was because there were some files missing from the Steam builds. That's the reason I built the API 34 version and made it available on my Google Drive. It should fix the firebase integration and the IAP should not crash the app. I'll try the code you posted in a few days. We may have to revert back to the API 34 build until myself or Lee can work out why apps are crashing. If I can replicate it then it should make it easier to debug.
I have exported an aab using the API 34 from your link and all seems good at the moment firebase integration and the IAP purchases seem to be working fine and I have uploaded it to the play console for internal testing with no issues found at the moment. I will upload the production update tomorrow so fingers crossed that will go well, just in the nick of time before the google deadline. Thanks so much again ZaxxanStudios you are a star and Lee for sharing ;-) Hopefully the API 35 will be fixed and running smoothly soon.
@Goldfishapps did your production update go OK?
I'm not sure I've mentioned it anywhere else on here but the API 34 build with Firebase and Billing 6.0.1 has allowed me to update four existing Android projects so far. It seems to work 100% as expected.
Except for the issue I have with consumables...
That's good to hear. Lee is going to add the API 34 build to Steam I think.
On Wed, 30 Oct 2024, 16:36 TheMadProf, @.***> wrote:
I'm not sure I've mentioned it anywhere else on here but the API 34 build with Firebase and Billing 6.0.1 has allowed me to update four existing Android projects so far. It seems to work 100% as expected.
— Reply to this email directly, view it on GitHub https://github.com/TheGameCreators/AGKRepo/issues/24#issuecomment-2447750836, or unsubscribe https://github.com/notifications/unsubscribe-auth/BK346VHGKCMNDHTWDPWDHCDZ6EDKHAVCNFSM6AAAAABOQXRWASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBXG42TAOBTGY . You are receiving this because you were mentioned.Message ID: @.***>
@TheMadProf @Goldfishapps Lee has added the API34Build in the Beta section on Steam. Can you try it to see if it works ok? It's based one the version you downloaded from my Google Drive
Hi David (ZaxxanStudios) Sorry about the slow reply. I'd been busy with some other work over the past few days and hadn't been checking this email account or the github, I will download the API34Build Bata build on steam today and give it a test. By the way my Play store update from your build in your link worked perfectly for the production upload So thanks so much again for that as it cleared all the policy violations on my play account. I will get back to you as soon as possible with an update on how I get on with the API34Build. Thanks Matt (mattyjjy2k) Gold Fish Apps
On Thu, 31 Oct 2024 at 11:05, David @.***> wrote:
@TheMadProf https://github.com/TheMadProf @Goldfishapps https://github.com/Goldfishapps Lee has added the API34Build in the Beta section on Steam. Can you try it to see if it works ok? It's based one the version you downloaded from my Google Drive
— Reply to this email directly, view it on GitHub https://github.com/TheGameCreators/AGKRepo/issues/24#issuecomment-2449589400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL7RLCSRUWCWPN4UIBCN6DTZ6IFF5AVCNFSM6AAAAABOQXRWASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBZGU4DSNBQGA . You are receiving this because you were mentioned.Message ID: @.***>
Hi David (ZaxxanStudios) I have just tested the API34Build in the Beta section on Steam and exported an APK file to test locally and the the IAP and Firebase integration problems seemed to be all solved in that version which makes sense if its based on the version from your from your Google Drive.
Which version of google billing is in that build is it 6.0.1 ?
Hopefully we can get an API 35 version with working IAP soon but at least the google play store is happy with the APi level and the version of google billing for now.
I'm not sure how many of the current AGK studio users have purchases or subscriptions in their Apps but I'm wondering if Lee might consider making that API 34 build the main production build on steam for now as it seems to be the best working at the moment especially for IAP.
If you need any help bug testing In App Purchases in any future builds please just let me know.
Thanks again for keeping AGK Studio alive. ;-)
Matt (mattyjy2k)
Hi Matt, thanks for the feedback. The API 35 build wasn't really meant to be released this early as it was just my development build but the API34 version released on Steam had issues so that is why the API 35 version was released. It turned out that Lee's builds had some missing files but my builds are ok, this is odd because we are using the same source code. I also think going back to the API34 build would be a good idea, it's a bit of a backward step but it would give me more time to resolve the API 35 IAP issue. The billing in the API 34 is indeed 6.0.1.
I do as much testing as I can but I've never used IAP so I missed that particular issue. I'll use the files that you posted to try and replicate the issue. I'm working on the Classic Repo at the moment though so it will be a few weeks before I get chance.
That's completely sounds like you've got a lot on your plate wish I was a better coder I would try to help more. it's really great your working on the Classic Repo I really liked AGK classic. I get the feeling it still had several hardcore users. I know AGK had a few lingering bugs but it's still a really great App development kit then it's just keeping up with the API and library updates that come along
I like Classic to, the repo is definitely more difficult to work with and I can understand why it was so difficult to update and to support multiple platforms. There hasn't really been much interest on the forums for the Classic Repo though so it may become a personal project for me as I hope to continue using it.
@Goldfishapps @TheMadProf I've released an update for Classic that supports API34 and Billing 6.0.1 if you want to give it a try
https://github.com/TheGameCreators/AGKClassic/releases/tag/API34
@ZaxxanStudios I stopped using Classic shortly after Studio came out. Good job on updating the repo though.
Do you still need code to demonstrate the issue with consumable purchases? Or are you happy to add the following code..
// Resets the purchase
token = GetInAppPurchaseToken(iapCoinPackID)
InAppPurchaseResetPurchase(token)
To the code provided by @Goldfishapps? (the iapCoinPackID is the iap product ID number.)
If you could provide the code it probably would make it easier for me to test
On Tue, 12 Nov 2024, 15:27 TheMadProf, @.***> wrote:
@ZaxxanStudios https://github.com/ZaxxanStudios I stopped using Classic shortly after Studio came out. Good job on updating the repo though.
Do you still need code to demonstrate the issue with consumable purchases? Or are you happy to add the following code..
// Resets the purchase token = GetInAppPurchaseToken(iapCoinPackID) InAppPurchaseResetPurchase(token)
To the code provided by @Goldfishapps https://github.com/Goldfishapps? (the iapCoinPackID is the iap product ID number.)
— Reply to this email directly, view it on GitHub https://github.com/TheGameCreators/AGKRepo/issues/24#issuecomment-2470838321, or unsubscribe https://github.com/notifications/unsubscribe-auth/BK346VH6TNUZXGN6GREIIVT2AIM7TAVCNFSM6AAAAABOQXRWASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZQHAZTQMZSGE . You are receiving this because you were mentioned.Message ID: @.***>
Ok, I have removed the IAP code from my game, and hopefully created a stand alone program which demonstrates the issue.
//********************************************************************************
// IAP Test Code
//********************************************************************************
// A quick snippet to demonstrate the problem with consumable products in IAP
//********************************************************************************
#Constant true 1
#Constant false 0
#Constant fail -1
//********************************************************************************
//
// System setup
//
//********************************************************************************
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "IAP test" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 )
//********************************************************************************
//
// Create UI elements
//
//********************************************************************************
// Creates a virtual button
AddVirtualButton( 1, 384, 350, 350 )
SetVirtualButtonSize( 1, 400, 100 )
SetVirtualButtonText( 1, "Start Purchase" )
//********************************************************************************
//
// Set up IAP stuff
//
//********************************************************************************
// Sets the App title for the receipt
InAppPurchaseSetTitle("IAP Test Program")
InAppPurchaseAddProductID("iap_product_name",0) : ` the name needs to match the product ID on the Play Console in-app-products page.
// Sets up the IAP products
InAppPurchaseSetup()
//********************************************************************************
//
// Main Loop
//
//********************************************************************************
do
// If button pressed
If GetVirtualButtonReleased(1) = true
InAppPurchaseActivate(0)
// A loop to process the IAP
Repeat
iapStatus = GetInAppPurchaseAvailable2(0)
Select iapStatus
// Cancelled? The IAP was cancelled by the user
Case 0:
// Break out of loop
finished = true
Endcase
// IAP Queued
Case 1:
Print("IAP in progress..")
Endcase
// IAP In progress
Case 2:
Print("IAP in progress..")
Endcase
// IAP Pending
Case 3:
Print("IAP in progress..")
Endcase
// IAP Completed
Case 4:
// Award the IAP
// Break out of loop
finished = true
// Resets the purchase
token$ = GetInAppPurchaseToken(0)
// This line does not appear to work properly
InAppPurchaseResetPurchase(token$)
Endcase
EndSelect
sync()
Until finished = true
Endif
// Debug
Print("Screen FPS: "+str(ScreenFPS(),0))
// Update screen
Sync()
loop
I have not had time to compile this as an apk and test it. But I am fairly sure this will demonstrate the issue I have reported in my other post here (https://github.com/TheGameCreators/AGKRepo/issues/22)
Thanks, I'll try and test it this week :)
Using the subscription test code I think I have replicated the issue so I'll try and work out what is going wrong.
Trying to purchase IAP product causes app to crash with build 2024.09.18.
I tested this with a build uploaded to the store.
The In App Purchase commands seem to work in the previous devtest version which only had Billing 6.0 and not the API update.