

Chris Pim
-
Content Count
74 -
Joined
-
Last visited
-
Days Won
2
Posts posted by Chris Pim
-
-
Oh this is cool. I didnât realise there were built-in command line parameters. Is there a docwiki page with all these documented?
I searched but couldnât find one
-
Fair enough. I did say it wasn't tested đ Thanks for the feedback though.
Â
I may have enough run through this when I have time and see if I can provide a better workaround, but won't be until next week.
I'll post here if I come up with anything that works.
-
1
-
-
I believe the following should do what you need, but I've been unable to test this at the moment so can you please try and let me know if it works.
Â
Note: I've checked and it's only the Android version of the iAP components that cache the purchases, so the iOS version shouldn't be affected.
Â
FMX.InAppPurchase.Android.pas:
Â
1. In TInventory, add:
procedure ClearPurchases;
Â
And the implementation:
procedure TInventory.ClearPurchases; begin  FPurchaseMap.Clear; end;
Â
2. In TAndroidInAppPurchaseService.QueryProducts, replace:
procedure TAndroidInAppPurchaseService.QueryProducts(const ProductIDs: TStrings); begin  FInventory.ClearPurchases;  FProductDetailsResponseListener.QueryProducts(TProductKind.InApp, ProductIds.ToStringArray); end;
3. The component won't automatically re-query the products when a purchase changes (the billing API doesn't have this facility as far as I can tell) so you'll need to call iAP.QueryProducts() with your productIDs whenever you feel you need to, and it *should* now reflect the correct purchase status once it returns.
Â
Please try this and reply if it works. If so, I'll copy this into the QP ticket for Embarcadero's info.
-
On 5/19/2025 at 7:47 AM, apachx said: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.Thanks for reporting this.
Iâll take a look at the Delphi sources and see if I can find the bug to offer a workaround.
-
I understand your frustrations. As the author of that article I really shouldnât have had to write it at all as they shouldâve implemented subscriptions by now. They havenât changed that code for at least 5 years and so basically abandoned within their own code base at the is point.
I aim to update the article for the latest Android subscriptions (there are a few small changes you can make to support multiple base subscriptions). I hope that helps once I have.
I hadnât noticed the caching issue but suspect youâre correct. Itâs worth checking the Delphi code first as thatâs the easiest fix if so. Itâs recommended that you use server side callbacks from the stores to capture subscription changes directly from Apple and Google and store them in a server of your own. Thatâs what I do as you canât easily get the subscription expiry details from Google or Apple using their APIs.
The only way is to decode the receipt file on Apple (which is difficult) or use their receipt validation APIs (which theyâve now deprecated). For Google you use their developer API to get details about the purchase but itâs only valid for 60 days then wonât return anything.
Â
I agree that this side of the Delphi mobile support is pretty poor and it would be better if a third party picked this up and released supported modern components for iAP instead, who knows, maybe someone will as we have a great community here.
-
Thanks Dave. Interesting to figure out what's conflicting on this...
-
Thatâs an interesting solution, thanks!
By default a Delphi app will apply the font scale from the phone to text set to size 12, but not others, which is a shame.
-
This is a known bug in Delphi 12.2 and above. Itâs caused by the new iOS linker and has been logged with EMB.
Itâs caused by increasing the min iOS version from 11 to 13 or higher. This breaks the linker and doesnât matter what other dependencies you have in the app. A blank app will also fail to link.
Â
Iâve been seriously impacted by this too and have been assured theyâll be fixing in the next update (12.4? 13? Who knows).
Â
For now, the only workaround I found is to either keep the min iOS version as 11, or if you have a copy of Delphi 12.1 Pro or above you can copy the ld.exe file from the bin folder of the installation to replace the one in the version youâre using. I.e. downgrade the linker to a version that works.
If youâre using community or donât have an older version of Delphi, this obviously wonât help.Â
I hope that helps.
-
Iâve noticed a weird bug in all Delphi versions since 12.0 when building an iOS app against SDK 18 (running on an iOS 18 device).
If you have a TMemo set to ControlType=Platform, it canât be scrolled!
Â
Weâve just updated our app for D12.2 built against SDK 18.2 and had users complaining.
If we build against SDK 17 (as our app used to be) it scrolls fine.
Unfortunately, Apple are mandating all apps must be built against SDK 18 from 24th April so we need to find a solution.
Â
Ive checked Delphi 12.3 and itâs still broken in there too.
Â
The memo has to use platform control type to support Arabic users and their existing notes data (R2L isnât supported in the styled memo).
Â
Iâve logged a QP issue for this but wonder if anyone could suggest any other workarounds or options? We need a fix pretty quickly!
Â
https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3318
Â
ThanksÂ
-
1
-
-
We've had a few of our users on Samsung devices report that when typing into a TMemo control in our FMX app, after a random number of characters, the keyboard switches caps lock on and it can't be turned off again.
The app is using Delphi 12.1 (latest patch) and Skia.
Â
We can't reproduce this issue on any of our test Samsung devices but seems to be happening on a range of Android versions and Samsung devices from A12, 13 and 14.
There's nothing logged in the Logcat on those devices nor errors raised within the app.
Â
Has anyone else seen this behaviour? I'm trying to put a case together to report it to EMB but need something they can work from.
Â
Thanks in advance
-
Looks very serious. Can you please log it with Embarcadero in their quality portal so they can start investigating? We might get a quick patch from them with any luck.
https://embt.atlassian.net/servicedesk/customer/portals -
Thanks Kryvich, very helpful. I'll take a look through those.
-
I've been using Markdown in my other non-Delphi projects as a way to provide formatted docs in my apps. E.g. T&CÂ documents, in-line help content etc.
Seems like this is pretty standard in other platforms (Flutter, Swift, C# etc)
Â
I've tried a few alternative approaches such as using the web browser (too heavy-weight for in-line content), TDzHTMLLabel (excellent but HTML based an doesn't handle images well. Also not great for longer content as it's just a formatted label control).
I found the HTML Component Library but it's very expensive for the small part of it that IÂ need.
I found an open source project to convert markdown to HTML which is an option I'm looking into but still falls back onto another component to actually display the content.
Â
Embarcadero referred to Markdown support in Delphi 12 but from what I can see it's only for use in the IDE itself, not in your own apps.
Â
It just feels like I'm missing something here. Does anyone know of a good solution I haven't found? Maybe it's just a great opportunity for someone to create one!
-
Hi Stanislav
Â
Did you find out what was causing this issue?
We had the same problem recently after upgrading our project to Delphi 12. When running on devices (particularly older than Android 14) it crashed with the same Resource not found for drawable/splash_image_def.
Â
In our case, the problem was the colors.xml file not containing an entry for:
<color name="splash_background">#FFFFFF</color>
Â
We replace the standard colors.xml file in our project deployment with a custom one to support a custom Android widget library.
Our xml file was from D11.3, but from D12 it now needs to include the extra color entry for splash_background.
Â
I hope this helps if you're still having problems.
Â
Chris
-
1
-
1
-
-
The only solution we came up with for this was:
1. Copy the fully signed extension from XCode into the Delphi project (in our case deployed to the PlugIns folder).
2. Do a full build and deploy with Delphi (which damages the appex by re-signing with the wrong entitlements file)
3. Manually run a script which copies the original binary of the appex over the top of the one Delphi re-signs in the .app generated in the scratch-dir so itâs correct again.
4. The script then also has to re-run the iosinstall command to deploy the fixed app to the device.
Â
To help with step 3, I have the original binary from inside the .appex included in the deployment twice. Once into the PlugIns folder as expected and a second to ../ which puts a copy into the scratch-dir folder. By doing this, my script for stage 3 knows where to get the original file from and itâs always the pre-broken version.
Â
This works fine but has the manual step at the end which is a pain. Delphi doesnât have a post-deploy stage in the project build options (like it does for post-build) which is a shame as the âcopy-backâ step could just be included there if it did.
Â
With any luck, EMB will undo the âfixâ that broke this in 11.3 so it isnât needed anymore.
Maybe we should all vote for the issue to push it up their priority list.
-
1
-
1
-
-
12 hours ago, Dave Nottage said:No official fix as yet, however I have come up with the following workaround - Note: this has had no testing beyond a blank app:
Â
1. Copy FMX.Platform.iOS from source\fmx into your project folder.
Â
2. In the TApplicationDelegate.applicationDidFinishLaunchingWithOptions method towards the end, make the following change (i.e. add the one line of code indicatedđ
  // Creating window   WindowManager := PlatformCocoaTouch.WindowManager;   WindowManager.Window := TFMXWindow.Create(MainScreen.bounds);   WindowManager.RootViewController := TFMXViewController.Create;   // *** iOS17 SDK crash issue - Add the following line: ***   WindowManager.RootViewController.Super.init;   WindowManager.NativeWindow.makeKeyAndVisible;
Note also that this measure is needed only if you are building against the iOS 17 SDK - it is not required when building against earlier SDKs.
I've tested this fix on a more complex app too and it also stops the crashing issue on iOS 17, so thank you as always Dave!
-
3
-
-
Delphi 11.x doesn't support building to an iOS 17 device from the IDE but apps built against iOS 17,
which are deployed to the device via TestFlight seem to run ok from my testing.Â
iOS 17 development is problematic with Delphi 11.x (full or CE) so you may need to wait for the next version to get full support, but your users shouldn't be having problems from what I've seen so far if you build against iOS 16.4 SDK and run on iOS 17
Â
UPDATE: Scratch this - TestFlight builds also crash when built with iOS 17. I'm not sure why it appeared to work but I may have been testing an iOS 16 SDK build accidentally.
You need Dave Nottage's fix regardless, but I'm doing a lot more thorough testing to make sure it doesn't have unexpected consequences!
-
They appear to be auto released which his why releasing again manually causes the crash.
-
1
-
-
We've almost completed our app transition from 11.2 to 11.3 but have one remaining strange issue.
Â
We include a Today Extension widget with our iOS app, which works perfectly with Delphi 11.2.
When I take the exact same code (fresh clone from Github) and run it from Delphi 11.3, the extension no longer works (I explain what this means below).
Â
I created a simple test app to reproduce the issue, which is what this post refers to but it's the same for our main app on the App Store too.
Â
- I run 11.2 and 11.3 in separate VMs but both are running the same versions of Windows 11, same component versions etc. The test app doesn't use any third party components.
- All latest patches for 11.2 and 11.3 applied to the IDEs.
- All generated files (e.g. generated entitlements file) identical on both 11.2 and 11.3
- Provisioning profile used to build the app is identical across 11.2 and 11.3.
- SDK Manager in the IDE imports iPhoneOS 16.4 on both.
- I created a new test app to produce a simplified version of the setup and reproduce the problem.
Â
The app is an FMX Delphi app.It pushes an integer via NSUserDefaults to the widget. The widget reads the same value (using app groups) and displays that number. The Delphi app also reads back the same key on load to display the last value to test the app is reading to the correct key (which it is).
Â
- On the 11.2 build it works correctly as shown below.
- On 11.3, the Delphi app is writing to the NSUserDefault key correctly but the widget always shows 0.
- From debugging the widget, I've seen that it can access the NSUserDefault key no problem but it's always reading 0 when deployed with 11.3 - as though the app didn't write any values (which I've proven it has).
Â
My thoughts are that this is an issue with how Delphi is building the app differently in 11.3. I wonder if it's injecting something into the entitlements or changing a permission somehow between generating the files in the Debug folder and deploying to the bundle to the phone. Or maybe I'm missing something obvious.
Â
For those who are interested, the Today Extension was created with Xcode natively in Objective-C. The built files are then copied into the Delphi project and set to deploy into the ./PlugIns/<extension name> folder in the bundle. Both the extension and the app bundle ID need to have the same App Group associated with them in the Apple Developer portal, so they can both share data through NSUserDefaults, which is how the widget is passed data.
Â
Our app has included this for years and worked perfectly until Delphi 11.3 which is why I doubt it's anything we're doing at code level (or in the widget)Â that's caused this.
Â
We've run out of things to try, so wonder if anyone has any suggestions? I'm going to log this with Embarcadero as a bug, but suspect they have bigger things to look into than something this specific outside their normal use-cases. This is why I'm reaching out to the community for ideas đ .
Â
Thank you!
Â
-
The app isn't a monolithic app (it's a large app but written to be modular) so that's not a problem we face. We always write apps properly - glad to head you do too Rollo đÂ
It's just the sporadic nature of the exceptions on specific devices we can't figure out. We've had to order a few more Samsung test devices to see if we can reproduce it, as the users are in a different country so no way we could get access to their devices. They respond for a while to help but don't tend to like us sending test apps and debug versions, as we're a relative unknown to them so don't fully trust we won't steal their data or hack their devices I suspect.
Â
We'll figure this out I'm sure, but appreciate everyone's help and suggestions. I'll report back once we had a solution just in case anyone else has something similar in future.
-
Thanks Martifan, those are very helpful.
Iâm in the middle of working through these so I hope to figure it out soon.
-
We've been having a strange issue using the TRESTRequest component with some of our users.
When we call the request.execute on those devices, it always raises an exception with the message of "External Exception 0". Weirdly it only seems to happen on Samsung devices, particularly newer models such as the S22 Ultra (but not exclusively that device).
Â
It happens for every API call we make, but only affects our app. The user reports that all their other apps can talk to the internet fine, so not sure what this could be.
Â
We have a number of newer Samsung test devices but can't reproduce this issue. The error seems to be coming from the OS rather than Delphi, but I can't see any reason for it.
We've been exploring device config-specific factors such as firewall apps, disabling data access to the app etc but there doesn't seem to be anything special. Most affected users keep their devices as factory default for these settings.
I've extract a logcat from those devices (I don't have physical access to the device though), and it doesn't show any errors, warnings or messages related to network access, security or things I would expect if the OS was the cause.
Â
We're running out of ideas, and the users are becoming frustrated as they can't use the cloud features of our app.
Â
I'd really appreciate any thoughts, suggestions or even just troubleshooting theories that could help to figure this out.
Â
Thanks!
-
A huge thanks to David Nottage! A fix has been found and I've included below for those that need it. The changes need to be made in FMX.inAppPurchase.iOS.pas (copied into your own project first as usual).
I've confirmed that this fixes the crash in iOS 17 and also still works in iOS 16. Not sure why we didn't see the crashes in iOS 16 but may be random luck given the nature of bugs like this.
Â
The same fix has been sent to EMB in the Quality Portal to hopefully include in the next update.
procedure TiOSInAppPurchaseService.QueryProducts(const ProductIDs: TStrings); var  ProductIDsArray: NSMutableArray;  ProductIDsSet: NSSet;  ProductID: string; begin  //Check FProductsRequest isn't already in use  if FProductsRequest <> nil then   raise EIAPException.Create(SProductsRequestInProgress);  ProductIDsArray := TNSMutableArray.Create;  for ProductID in ProductIDs do   ProductIDsArray.addObject(StringToID(ProductID)); // changed from the very poorly named PStrToNSStr to StringToID  ProductIDsSet := TNSSet.Wrap(TNSSet.OCClass.setWithArray(ProductIDsArray));  FProductsRequest := TSKProductsRequest.Wrap(TSKProductsRequest.Alloc.initWithProductIdentifiers(ProductIDsSet));  // ProductIDsArray.release; -- comment these out to fix the issue  // ProductIDsSet.release;  -- comment these out to fix the issue  FProductsRequest.setDelegate(FProductsRequestDelegate.GetObjectID); // calling GetObjectID without the redundant cast  //Set off network activity indicator  SetNetTrafficIndicator(True);  //Now initiate the products request  FProductsRequest.start; end;
-
3
-
-
After more investigation, it looks like it's related to InAppPurchase (StoreKit specifically).
Simple apps were crashing under iOS 17 beta 1 but seems to be ok now in beta 2 unless you have TInAppPurchase in your app. This is an improvement but still the same headache for my users unfortunately.
Â
I've raised a new QP issue with Embarcadero with all the crash details, logs etc as it feels like a separate issue to the original QP entry.
Â
https://quality.embarcadero.com/browse/RSP-41948
Â
Hopefully Apple will fix the underlying issue in a future beta but it's logged just in case it's an Embarcadero issue.
Updating files in assets\internal\ (12, FMX, Android)
in FMX
Posted
Fair enough! I was searching for âapplication run parametersâ and other more general things - I shouldâve just searched for cleaninstall!
Â
Curiously, if you type cleaninstall into the search box in the docwiki, it initially says âNothing matches the searchâ until you actually press return, which also caught me out.
Â
Thatâs my excuse anyway đ