WebView OverrideUrl and PageFinished?

DevBaby

Active Member
Licensed User
Longtime User
In my webview app, not every PageFinished event is preceded with an OverrideUrl event.

My procedure sends an url to check user’s login credentials for facebook, if a token exists, then the webview automatically loads my RedirectUri along with the token id, however, the OverrideUrl event is not raise, but the PageFinished event is raised when the url finishes loading.

I am trying to keep the page from actually loading, but still get the token id, but the OverrideUrl event does not fire off.
 

DevBaby

Active Member
Licensed User
Longtime User
Thanks for your reply...

The scenario is when a token is still valid for facebook. Facebook sends my RedirectUri with the token_id, this automatically loads my webview with the site contained in the RedirectUri without the OverrideUrl event.

If there is no valid token, facebook loads the login page, once the login is successful, faceook will send back the same RedirectUri with the token ID above, but this time the OverrideUrl event is raised.

I am using the FaceBookWall.zip ( code from steve05/vb1992/njdude)

In this code, the method of getting the token id is in the PageFinished event, maybe they ran into the same problem which is why the OverrideUrl event is not used.

It just seems strange that the user will see the RedirectUri site load first (for a moment) before the actual facebook post is sent after the token is acquired.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
I think you'll find that if a WebView page is changed using javascript then the OverrideUrl Event is NOT called.

You could be loading a web page that once loaded, loads another webpage using javascript...

OverrideUrl not called,but when the new page loads you'll see that the PageFinished event fires.

Martin.
 
Upvote 0

airblaster

Active Member
Licensed User
Longtime User
Hi DevBaby,

in case you are still reading this: what kind of alternative did you find?
I'm currently facing the same problem.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
airblaster, devbaby; what did you find? I'm working through one of these cases now. Thanks.
Why are you pulling out years old threads? This is another two years old one...
 
Upvote 0

mr23

Active Member
Licensed User
Longtime User
airblaster, devbaby; what did you find? I'm working through one of these cases now. Thanks.

I figured out why

> In my webview app, not every PageFinished event is preceded with an OverrideUrl event.

for my app. Apparently the addJavascriptInterface wasn't set up soon enough. The symptom I was having was either "interface" (ie "B4A") wasn't found or no message/action at all for the expected call/event. I moved the addJavascriptInterface to ActivityCreate and then it functioned as expected. I am using javascript to change the webview, it is a Login page, and both the first Login page and the subsequent page load (now) effect a B4A.CallSub.

DMf: Awakened from the deep, as some of these 'old' threads are what comes up for related search terms. It would be nice to actually find some helpful information at the end. Sorry I didn't add this post before knocking off for the night.
 
Upvote 0
Top