iOS Question WebView not working for me

johnc_nz

Member
Licensed User
Hi,

I have used WebView in my B4A application without issue.

I am now trying it in my B4i application.

I have the WebView component in a view as wvWeather

then

Private wvWeather as WebView
...

wvWeather.Initialize("webview")
wvWeather.LoadURL("https://google.com")

...
Sub webview_PageFinished(Url as String)
Url = Url
End Sub

I have included iUI8 library

My iPad has IpadOS 16.3

The webview window shows nothing, and the PageFinsihed event is not called.

What am I missing or doing wrong?

Thanks,
John
 

johnc_nz

Member
Licensed User
Please use [code]code here...[/code] tags when posting code.


Not needed.


Mistake.
Add the view with the designer.
Just a couple more questions in relation to this

1. The page loads, but my wvWeather_PageFinished event handler is not called. The designed has wvWeather as the event name.

2. I load the google page ok (and PageFinished not called) but when I try a site that I have via nginx-proxy, it doesn't show. I suspect that it may have something to do with the https? If I load the link in my browser it shows the site as secured, and I have nginx-proxy forcing HTTPS. (also supporting HTTP/2, HSTS and HSTS Sub Domains).

Thanks
John
 
Upvote 0

johnc_nz

Member
Licensed User
1. Sub WebView1_PageFinished (Success As Boolean, Url As String)

2. If it is not a https link then you need to disable ATS: #ATSEnabled: false
Thank you Erel, most appreciated.

It is an https link, and in a web browser like edge, edge is reporting the site as secured. (See below, sorry about the large size, my hi-res screen
does with windows capture).


 
Upvote 0

johnc_nz

Member
Licensed User
1. Sub WebView1_PageFinished (Success As Boolean, Url As String)

2. If it is not a https link then you need to disable ATS: #ATSEnabled: false
Ok, now I have the event handler working, I see that even though I call the https link, the Url in the handler is showing as http.
Must be something to do with the proxy in the middle of all this. I'll have to go the ATS disabled way until I figure it out.
 
Upvote 0

johnc_nz

Member
Licensed User
Ok, found how to fix the issue. Just posting here in case anyone else has the same issue.
Seems that after ios 13, nginx proxy https addresses keep resolving to http instead of https due to something they are doing in ios.
Adding 'proxy_hide_header Upgrade;' to the nginx proxy manager custom configuration does the trick.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…