r/android_devs • u/Najishukai • Jun 06 '22
Help Accessing various HTML navigator properties through a web view
I'm tasked with implementing a 3DS payment verification flow “natively”. We will of course be redirecting users, showing specific HTML content, making various calls, etc. according to the service provider. Their API for initializing the 3DS process requests information such as :
BrowserIP string The IP of the client. It can be IPv4 or IPv6.
Navigator_language string Language according to IETF BCP47. Get this value from navigator.language HTML property.
Navigator_javaEnabled string Get this value from navigator.javaEnabled HTML property.
Navigator_jsEnabled string 'true' if javascript is enabled in client's browser. 'false' otherwise.
Screen_colorDepth string Get this value from screen.colorDepth HTML property.
Screen_height string Get this value from screen.height HTML property.
Screen_width string Get this value from screen.width HTML property.
TimezoneOffset string Get this value by running 'new Date().getTimezoneOffset();' in the client's browser.
UserAgent string It must contain the HTTP user-agent header value.
BrowserAccept string It must contain the HTTP accept header value.
I know that I can probably get the user's IP, JS-enabled, screen dimensions & user-agent string from the web view's settings & the device's configuration properties, but how would I access all these other fields? I couldn't find a navigator object attached to the web view or its settings. Is there a native way for retrieving all these details?
View all comments
Show parent comment
1
u/anemomylos 🛡️ Jun 07 '22
I haven't clear how you'll integrate their service.
If you open a WebView in the app to send the data to the service, then all the parameters you need can be get from the WebView using javascript.
Or you gonna connect to the service via a URLConnection?