-
Content Count
12 -
Joined
-
Last visited
Community Reputation
1 NeutralTechnical Information
-
Delphi-Version
Delphi Community Edition
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
You're absolutely right - my bad. -
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
Yes, at first I tried calling InAppPurchase.RestorePurchasedProducts instead of InAppPurchase.QueryProducts, but the event InAppPurchasePurchaseRestored(Sender: TObject; const ProductID: string; const Receipt: string) on Android never fires. Here’s its implementation in FMX.InAppPurchase.Android.pas: procedure TAndroidInAppPurchaseService.RestorePurchasedProducts; begin CheckApplicationLicenseKey; // On Android the restore functionality is irrelevant thanks to the inventory // system automatically identifying which products have been purchased end; As for InAppPurchase.QueryPurchases — this method is not available for direct use in TInAppPurchase. -
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
Hi. I just tried your solution, but it seems it's not working. After successfully completing a subscription, every attempt to call InAppPurchase.QueryProducts fails to return my subscription in the Products list within the event InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings). This condition never evaluates to true: for Product in Products do begin if (Product.ProductID = PlayMarketProductID) and (InAppSubscription.IsProductPurchased(PlayMarketProductID)) then SUBSCRIPTION := true; end; If I revert back to the original FMX.InAppPurchase.Android.pas, everything works as before. -
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
Just in case, this limitation of the TInAppPurchase component has already been reported in a ticket on the Embarcadero Quality Portal - https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3516. Who knows - maybe the developers will eventually do something about it. -
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
This method doesn’t work for Delphi 12.1. But the good news is that subscriptions will still work without the need to edit any files, as suggested in that tutorial. The bad news, however, is that TInAppPurchase does not support the current version of the Google Billing API. It doesn’t understand multiple base plans (e.g., monthly and yearly) under the same subscription, nor does it recognize offers (such as discounts or trial periods) associated with those base plans. The component only detects the first base plan of a subscription marked as "Backwards Compatible" in Google Play. Now I understand why Delphi is rarely used for mobile app development - the delay in supporting newer Android versions and essential third-party APIs is unacceptable for business use. -
apachx changed their profile photo
-
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
Hi everyone, I’m implementing subscription functionality in my mobile app using Google Play Billing and TInAppPurchase in Delphi. I’ve encountered an issue that I hope someone here might have already faced and solved. When a user cancels a subscription, and the previously paid period fully expires, I expect that the app would stop recognizing the subscription as active. However, even after calling: InAppPurchase.SetupInAppPurchase; InAppPurchase.QueryProducts; …the subscription still appears active in the app — InAppPurchase.IsProductPurchased(PlayMarketProductID) continues to return true. But if I restart the app, the same method correctly returns false, and the subscription is no longer shown as active. This leads me to believe that either the TInAppPurchase component or the underlying Google Billing client caches the subscription status, and that cache isn't invalidated until app restart. 👉 Is there a way to force-refresh the current subscription state without restarting the app, after the subscription has been cancelled and fully expired? Thanks in advance! -
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
And what? The same article for RAD Studio Athens: https://docwiki.embarcadero.com/RADStudio/Athens/en/Using_the_Google_Play_In-app_Billing_Service This page was last edited on 28 September 2015, at 14:19. Using the iOS In-App Purchase Service: https://docwiki.embarcadero.com/RADStudio/Athens/en/Using_the_iOS_In-App_Purchase_Service Note: Subscription-based types are not currently supported. This page was last edited on 21 January 2022, at 07:52. Is there any new tutorial about subscriptions? Where can I read more about it? -
In App Purchase (consumable and subscription)
apachx replied to Joe Sansalone's topic in Cross-platform
Hello! Could you please tell me if there have been any changes regarding support for subscriptions in mobile applications created with the latest versions of Delphi? I developed a mobile app for Android, published it on the Play Store, and now I want to add a subscription to this app — so users can pay, for example, $7 per month to use my app. That’s it. I am not selling any other digital content within the app. I am using Delphi 12 Version 29.0.52631.8427. Is it possible to implement such a subscription in my app? Because here: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Using_the_Google_Play_In-app_Billing_Service, it says: Note: Subscriptions are not currently supported. -
Hello. I encountered a similar issue, although the error code is slightly different. My mobile application works well on most devices, but today I installed it on a Motorola G54 smartphone, and upon launching, I saw a strange error: Cannot create EGL PBuffer Surface: error code 12291. It sometimes occurs on the splash screen, and sometimes when a MultiView menu appears. I was only able to get rid of the error after I stopped using third-party styles (in my case, it was the Android Sterling Style). This solution worked for me since I couldn't find much information about this error online.
-
Delphi 11, Android, deploy .db file, will not overwrite previous
apachx replied to Fudley's topic in FMX
Try this (don't forget to include the database file in the Deploy) : procedure TForm1.RefreshBD; var PackageName: JString; zip: TZipFile; begin PackageName := SharedActivityContext.getPackageResourcePath; if TFile.Exists(JStringToString(PackageName)) then begin TFile.Delete(TPath.GetHomePath + PathDelim + 'myDatabase.s3db'); zip := TZipFile.Create; zip.Open(JStringToString(PackageName), TZipMode.zmRead); zip.Extract('assets/internal/myDatabase.s3db', TPath.GetDocumentsPath, False); zip.Close; zip.free; end; end; -
Can you share a working sample of code? I get an access violation error when I try to do something like this (OnEnter event) => edit1.Visible := false; edit1.BeginUpdate; edit1.ControlType := TPresentedControl.TControlType.Platform; edit1.EndUpdate; edit1.Visible := true; The error occurs on line 997 of the FMX.Edit.Style.New unit: As a temporary working solution, for edit1 in the Object Inspector, I set ControlType = Styled, activated Touch => Gestures => Standard = [Left, Right], and wrote the following OnGesture event handler: if EventInfo.GestureID = sgiLeft then (Sender as TEdit).SelStart := (Sender as TEdit).SelStart + 3 else if EventInfo.GestureID = sgiRight then (Sender as TEdit).SelStart := (Sender as TEdit).SelStart - 3; Handled := True;
-
Delphi 11, Android, deploy .db file, will not overwrite previous
apachx replied to Fudley's topic in FMX
You can configure RAD Studio so that the Run Without Debugging and Run actions completely uninstall any previously-installed version of your application, including the data and cache folders. To do this, before installing the newer version, use the following steps: Select Run > Parameters. Enter -cleaninstall in the Parameters field.