Application.Navigate to show PDF gives problems on iOS on first call

Our client app sends a request to the server to have the server load a PDF from database and put it in a file in some directory for download by the client. On iOS, we already learned the hard way that the PDF cannot be shown on a form but needs an Application.Navigate to be shown.

Now the strange problem is, that whenever the server provides a NEW file, the first call to Application.Navigate always fails. It just does nothing. Then, when executing Application.Navigate a 2nd, 3rd or 4th time, the PDF gets shown. Seems it has something to do with the fact that the file is "fresh".

This behaviour we only see on iOS! Running the app from any PC browser works flawless.

Our first idea was some sort of timing issue. So we put a significant delay between the response from the server saying "Yep, file is ready" and the actual Application.Navigate. But to no avail.

So the finding is: Doing Application.Navigate on a NEW pdf file fails on first call under iOS. Why is that?

I would expect that when you give the command to the server to produce a PDF, this will be delivered asynchronously. So, the only reason I can see is the navigate is happening before the actual delivery of the server. Other than this, I cannot think of a reason. Inspecting the browser console to see possible errors might reveal something.

Thank you Bruno for your input!

We already took the async aspect and therefore timing issue into consideration and put a significant delay of say 5 seconds before the navigate. That did not help either. And as said, on "real" PC browsers, this issue does not exist.

It would be awesome if there was a way to open the console. But at least I didn't come across any way to open the console on an iPhone (without wiring it up to a Mac). In order to at least have some sort of logging on a smartphone, we send all logging output of the app to the server DB so we can watch the logs in the DB. But of course that does not fully replace the console.

Do you maybe know a way to look into the iPhone console?

You could try with Sentry logging
We have a component to do this Sentry logging.

The alternative is indeed to inspect from a mac computer.