iOS Question B4I Webview PageFinished

touchsquid

Active Member
Licensed User
Longtime User
I am porting a B4A app to B4I. One thing that is causing me trouble is the Webview pageFinished event.

B4X:
Private Sub WebV_Map_PageFinished (Success As Boolean, Url As String)
    Log(Url)
End Sub

I have a scrolling webpage in the view, where the URL changes with scrolling. In B4A every time you move the page, the PageFinished event fires, and URL is updated. This is perfect for my purpose. In B4I, the event fires once when the page is first loaded, but not after that.

Is there a property I can check to get the currentURL?

Thanks!
 

touchsquid

Active Member
Licensed User
Longtime User
Solved it with this code. I found it in another post, but the signature differs:

<
WebV_Mapp.EvaluateJavaScript($"window.location.href"$)
Wait For WebV_Map_JSComplete (Success As Boolean, Result As String)/>
 
Upvote 0

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
Remember that for iOS you must use WKWebView
B4X:
#If B4i
Private Sub WebView_PageFinished (Url As String)
#Else
Private Sub WebView_PageFinished (Success As Boolean, Url As String)
#End If
'Code
End Sub
 
Upvote 0
Top