Jump to content
ToddFrankson

Weird new IOS Issue-

Recommended Posts

So, I have been working on a multi platform project, that has worked fine on Windows Android and IOS.

IOS just updated to 17.5.1

The code works fine Prior to the update, but not after.

 

I use TNetHttpClient to do a get of a web page.  Prior to the Get, a Head returns just fine, to ensure internet access.

I made a simple sample of the code.  

tap a button to initiate the Get and load the same page in a Twebbrowser.

 

Can anyone text the attached code and tell me why the Get doesn't "get"? And why it works fine Prior to 17.5.1, and on all other platforms??

 

When the button is clicked, the Webbrowser browses the page, and the memo never gets filled.

 

AndroidManifest.template.xml

Entitlement.TemplateiOS.xml

info.plist.TemplateiOS.xml

Project1.deployproj

Project1.dpr

Project1.dproj

Project1.dproj.local

Project1.dsk

Project1.identcache

Project1.res

Unit1.fmx

Unit1.pas

Share this post


Link to post

Have you set the NSAppTransportSecurity and other Flags in the info.plist, according to your needs?
Here is a sample, for various settings:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <!-- Example for >= iOS 9  -->
    <key>NSExceptionDomains</key>
    <dict>
        <key>example.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

 

Share this post


Link to post
53 minutes ago, Rollo62 said:

Have you set the NSAppTransportSecurity and other Flags in the info.plist, according to your needs?
Here is a sample, for various settings:


<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <!-- Example for >= iOS 9  -->
    <key>NSExceptionDomains</key>
    <dict>
        <key>example.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

 

I never had to set anything before.  Especially in the sandbox.

Share this post


Link to post
8 hours ago, ToddFrankson said:

Can anyone text the attached code and tell me why the Get doesn't "get"?

I'm unable to reach that URL at all.

Share this post


Link to post
11 minutes ago, Dave Nottage said:

I'm unable to reach that URL at all.

Interesting.  It's a local county government page.

Share this post


Link to post
Posted (edited)
7 hours ago, ToddFrankson said:

Can Anyone else get to this website https://gis.cravencountync.gov/images/activebookings.html ?

 

Nope.

This link works
https://www.cravencountync.gov/263/GIS-Mapping


but clicking from there into
https://gis.cravencountync.gov/
doesn't work on Windows 11.

Ok, I'm not living in USA, so maybe some kind of IP-blocking?

 

Edit:

Yes, after VPN I can reach this from Windows.
https://gis.cravencountync.gov/images/activebookings.html

image.thumb.png.4e37510ac4e5962f4a471f6087f7672c.png

 

Edited by Rollo62

Share this post


Link to post

So, I have figured out my problem.  Please alter the code with a web page you can hit.

 

It seems that IOS No longer likes Getdocumentspath....A Stringlist failed to write to it, using Assign and reset failed to open or read the file....

 

All in development mode.

 

Can anyone check this?

 

 

Share this post


Link to post
2 minutes ago, ToddFrankson said:

It seems that IOS No longer likes Getdocumentspath....A Stringlist failed to write to it, using Assign and reset failed to open or read the file...

Your example code does not have any calls to Assign or Reset. Having said that, why are you using long deprecated file access methods? TStringList has LoadFromFile and SaveToFile methods.

 

It might help to show an example that focuses just on GetDocumentsPath and the file access parts, if that's what is failing

Share this post


Link to post
Posted (edited)
14 minutes ago, Dave Nottage said:

Your example code does not have any calls to Assign or Reset. Having said that, why are you using long deprecated file access methods? TStringList has LoadFromFile and SaveToFile methods.

 

It might help to show an example that focuses just on GetDocumentsPath and the file access parts, if that's what is failing

The failure Occurs in the code i posted with the Stringlist.SavetoFile.  No ERROR PRESENTED. I had to wrap almost everything with message Dialogs to find the failure.  

 

I tried Assign /reset just on a whim .

 

I have attached a new unit.pas.  On line 92 & 93 put a URL you know you can get too.

 

Unit1.pas

Edited by ToddFrankson

Share this post


Link to post
24 minutes ago, ToddFrankson said:

The failure Occurs in the code i posted with the Stringlist.SavetoFile.

Using a URL I can reach, the code works fine for me

Share this post


Link to post
15 minutes ago, Dave Nottage said:

Using a URL I can reach, the code works fine for me

Ios 17.5.1? 17.5 sdk?

Share this post


Link to post
Posted (edited)
1 minute ago, ToddFrankson said:

Ios 17.5.1? 17.5 sdk?

Yes, to both. Have you tried another URL?

Edited by Dave Nottage

Share this post


Link to post
1 minute ago, Dave Nottage said:

Yes, to both. Have you tried another URL?

Yes, several files. Everytime I get a cannot write..... user doesn't have sufficient rights error, only displaying when I specifically show the error in a message. When I remove the try except, the file doesn't exist to open. 

 

I just spent the day on the main project, using message dialogs to find this out. I am now using temppath.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×