digao-dalpiaz / DzHTMLText

Delphi and Lazarus HTML Label component
MIT License
194 stars 53 forks source link

Need support for iOS (and Android) if not already - the current version crashes when used on iOS #53

Closed MyBuzzTechnologies closed 3 years ago

MyBuzzTechnologies commented 3 years ago

Using your component in an iOS FMX app raises an exception. I'm not sure if your component officially supports iOS and Android as it isn't mentioned, but if not, it would be really useful if it could.

For info, the exception raised is:

AV at address 000000000...0098 in FMX.DzHTMLText line 1841.

I'm running this on an iPhone XR, iOS 14.6. My project is built with Delphi 10.4.2. Screenshot 2021-06-14 at 18 23 21

It seems to be the assigning of C.Font.Assign(Lb.Font); which is raising an AV during the TBuilder.ProcessTokens() call.

digao-dalpiaz commented 3 years ago

Hello,

Yes, actually the component supports Android and iOS platforms. It's already tested and working on Android, but on iOS I haven't had the opportunity to test it yet.

I will borrow an iOS device to test and verify this issue.

digao-dalpiaz commented 3 years ago

Today I have tested the component in a macOS (OSX) device. It's compiling and working as expected.

As soon as possible I'll proceed with an iOS device.

digao-dalpiaz commented 3 years ago

mac

MyBuzzTechnologies commented 3 years ago

Hi, has there been any progress testing this on iOS? I’d really like to use your component in my app but it crashes on iOS still.

digao-dalpiaz commented 3 years ago

Hello,

I'm sorry, this is taking longer than I would like.

I'm planning to test it with an iOS device this Thursday. Please wait a little longer and I believe I will have an answer by then.

Thanks

digao-dalpiaz commented 3 years ago

Hello @MyBuzzTechnologies,

So, I was planning to test with Mac and iOS device today, but unfortunately I didn't get a device.

We could do a remote connection to see why you are getting this error, since you have Apple devices, if you want, what do you think? I will be happy to help you. :)

digao-dalpiaz commented 3 years ago

Yesterday I borrowed an iOS and Mac device, but unfortunately the Mac version is 10.13.6, and XCode 10.1 is incompatible with my Delphi 10.3.3 version.

The iOS app (a blank Delphi app) just flashes and closes immediately :(

So, today I purchased a Mac service on the Cloud. I'm proceeding with the tests. I'll keep you updated.

digao-dalpiaz commented 3 years ago

Tested and working on iOS 10.3

iphone6_test

digao-dalpiaz commented 3 years ago

I found the problem!

Apparently there is a quite different behavior when the component is being created on iOS in certain versions (14...)

I made a branch with a possible solution.

Could you please test this branch: https://github.com/digao-dalpiaz/DzHTMLText/tree/ios-canvas-instance

Thanks.

MyBuzzTechnologies commented 3 years ago

Thank you for persevering with this issue, it's great to hear you've found the problem. I'll download the branch later today and test it.

Thanks again!

MyBuzzTechnologies commented 3 years ago

I've tested the new branch and the rendering is working correctly on my iPhone XR (iOS 14.7) so thank you for fixing it. I have found a bug on iOS with URLs in the anchor tag and logged that as a separate issue. It looks like an easy fix - just a missing compiler condition in the Click procedure.

digao-dalpiaz commented 3 years ago

Hello @MyBuzzTechnologies ,

Great to hear it. I'll fix the new issue about links, and when it done, I'll create a new final release.