We want to use Application.Navigate
on our Local Webserver to switch to our Remote Webserver. After the Remote Webserver finishes its task, it will call Application.Navigate
to return control back to the Local Webserver.
However, the issue we are facing is that Application.Navigate
from the Local Webserver does not wait for the Remote Webserver to navigate back. If we attempt to wait for the onclose
callback by putting the current thread to sleep, the application freezes completely, and the previously called Application.Navigate
does not get executed.
Hello Levie,
I’ve attached a sample project to this Link. I could not use the upload from this Forum because of the Limit 3,9 MB.
In the sample, I’ve implemented the behavior I mentioned in the OnClick
method of LocalWebserver.Page1
.
In the Program.cs
file of RemoteWebserver
, I’ve registered the corresponding endpoint where the request is handled. However, as I mentioned earlier, Application.Navigate
does not wait until RemoteWebserver
navigates back to the local webserver. As a result, when I try to read the response from that request, I receive an empty response because the request has not yet been executed.
If you’d like to test it yourself, you can set the URL of the RemoteWebserver
in Shared.Navigation.Funktionen.Navigation.cs
.
I hope you get what we are trying to accomplish with this architecture and can help us.
Best regards,
Konstantin
Hey Konstantin,
There is no popup window in a Hybrid app – only application redirects. So the onclose handler will not work. There shouldn’t be any reason to put the current thread to sleep while waiting.
You might want to look at the Application.ApplicationRefresh event handler to manage a redirect.
If you attach a small runnable sample we can try to provide more help!
Best regards,
Levie
Please login first to submit.