TWebBrowser on IOS

Hi,

RAD Studio 13.1

My first IOS app using shared code from the desktop Windows App. All good until I wanted to view a PDF in TWebBrowser.

I download the file from my server to the IOS device (simulator and iPhone do the same). The file gets written to the TPath.Combine (TPath.GetHomePath, ‘Documents’, LocalFileName).

I create an instance of TWebBrowser in wb and call wb.Navigate (wb.FilesPref + FullFileName);

It gets to FMX.WebBrowser.Cocoa.TCommonWebBrowserService.DoNavigate.TryGetFileNSUrl.

It fails on the line…

Path := TNSBundle.Wrap(Bundle).pathForResource(StrToNSStr(FileName), nil);

with exception class 6 which seems to suggest permissions issue, however, apparently I don’t need any permission to view a file in my bundle. And given that I just wrote the file, I must have some right to access it.

Any suggestions?

It’s not a permissions issue. See this report.

The line of code you refer to should be:

Path := TNSBundle.OCClass.mainBundle.pathForResource(StrToNSStr(FileName), nil);

Thanks Dave.

I am now viewing PDFs!

Cheers