How to fetch code in callBack Url and send it to get token?

Hey, I’m facing an issue. When I send the redirect uri/ callback url in WebAuthProvider in Android to use universal login. I’m getting redirected to a callback url which is having a state and code in it . In your documentation it uses an API “oauth/token” in which I have to send the code and get the idToken. How can I get that code in Android because as far as I know we cannot fetch the browser’s url. Is there any code that you guys can share to fetch that code from the callback url in order to get the idToken?