I’m working on an iOS app that sends requests to a site’s API to return an image and display it in an iOSHTMLViewer. This is a port of an old Mac app that worked fine using HTMLViewer.
Everything works great in the simulator, but testing on an iPad doesn’t display anything. I’m using multiple views with different iOSHTMLViewers and its the same problem with all of them.
Here’s a sample of a file that I’m using with the LoadURL method:
[code]
Hex Name UWP Remarks {Ix} (Ex) [Cx] N B Z PBG W A Stellar
---- -------------------- --------- --------------------------- ------ ------- ------ ----- -- - --- -- -- --------------
<?xml version="1.0"?>
Unnamed
[/code]
I’m using https so I don’t think it’s an NSAppTransportSecurity issue that requires a plist.
If that’s the full HTML, there’s nothing there to display an image. Do you have an example URL you can share?
The base website uses a lot of Javascript to display the map, so it could be any number of hiccups along the way.
[code] Dim htmlFile As Xojo.IO.FolderItem = Xojo.IO.SpecialFolder.Documents.Child(“sector.html”)
Dim output As TextOutputStream
output = TextOutputStream.Create(htmlFile, TextEncoding.UTF8)
output.Write(t)
output.Close
[code]Public Function urlencode(url As Text) as Text
// Remove newline characters.
url = url.ReplaceAll ( &u0A, “” )
Declare Function CFURLCreateStringByAddingPercentEscapes lib “Foundation” (allocator as Ptr, origString as CFStringRef , charactersToLeaveUnescaped as CFStringRef , legalURLCharactersToBeEscaped as cfStringRef,encoding as uint32) as CFStringRef
Declare Sub loadHTML Lib "UIKit.framework" selector "loadHTMLString:baseURL:" (obj_id As ptr, html As CFStringRef, url As ptr)
loadHTML(HTMLviewer.handle, htmlString, Nil)
So I’m thinking it must have to do with something that’s different between the simulator and the development app on the iPad. Like an entitlement or something. Hmmmm.
Possibly security settings? That’s why I’d asked for a URL to look at, so we can check into the Safari debugger to see what dependencies they may be needing. Frequently a local file is unable to access remote resources as a measure of security.
I wasn’t sure how to give you a URL for this API call, but when I open files in Safari, I do get a URL. Reopening that URL in a new tab doesn’t give me my own custom data image back, but something from the site’s data.