Setting custom user agent string in WebView on iOS and Android

We are using a WebView to enable SSO login with Microsoft Active Directory within a Solar2D app.

This works fine with Apple Sign-In, but fails for ‘Sign in with Google’, because it doesn’t recognize the user agent string, which for a Solar2D project is something like the name of the app.

403 disallowed_useragent is the message from Google Sign In.

We need to be able to change the user agent string, something like this:

On Android:


On iOS:

If someone would look for it, https://github.com/coronalabs/corona/pull/253