6

In my ecommerce app for making order payment i am redirecting user to webview. In my webview it asks user for login using Google Plus. When user clicks on Google+ button then child window opens and after successful authentication it sends result back to parent window and in parent window redirection takes place from login screen to the page from where user have came from. [Ex- Product Details Page,Cart Page,etc].

So then problem here is when i open link in android Webview

webview.loadUrl(url);

It opens fine as soon as user clicks on G+ redirection takes place and parent page get removed and g+ Authentication gets started. After successful authentication control is given to parent window but at this time parent is not present and all parents Javascript objects were replaced by child window previously.

I here my redirection is taking at wrong place.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Nikhilesh Patve
  • 1,760
  • 3
  • 13
  • 31

1 Answers1

-1

getOriginalUrl ()

It returns the URL that was originally requested for the current page

getUrl () is not always the same as the URL passed toWebViewClient.onPageStarted because although the load for that URL has begun, the current page may not have changed.

getOriginalUrl () gets the original URL for the current page. This is not always the same as the URL passed toWebViewClient.onPageStarted because although the load for that URL has begun, the current page may not have changed. Also, there may have been redirects resulting in a different URL to that originally requested.

Rahul Kishan
  • 314
  • 4
  • 18
  • I dont want url i want communication between webview as of when child window gets closed then i want to send his reply as like after successful authentication with google shares user id which is received in javascript object that communication in parent webview.As my parent webview redirects on receiving information. – Nikhilesh Patve Nov 17 '16 at 12:06