Server-side Redirects

When using server-side redirects you provide the URL of the API endpoint that will receive the token and other login session details as parameters. The native app will redirect the webview to this URL after a successful login. If the user has cancelled the login process, the error parameter will contain an error message.

GoNative JavaScript Bridge Methods and Parameters:

gonative.socialLogin.facebook.login({ 'redirectUri' : '<endpoint>', 'scope' : '<text>' });{ 'redirectUri' : '<endpoint>' });{ 'redirectUri' : '<endpoint>', 'scope' : '<text>' });

redirectUri - the GET endpoint that will be called after using the Social Login. The tokens will be added as GET parameters.
scope - determines what data your app would like access to. Check the official documentation for each of the social logins for more information.

Redirect URL API Endpoint parameters:

Identity ProviderStatusParametersExample
Facebook LoginSuccessaccessToken=STRING
Facebook LoginErrorerror=STRING
Google Sign-inSuccessidToken=STRING
Google Sign-inErrorerror=STRING
Sign in with AppleSuccessidToken=STRING
Sign in with AppleErrorerror=STRING

1 Apple only returns the user's information the first time the user authorizes the app. Persist this information from your app; subsequent authorization requests will only contain an identity token in the form of JSON Web Token (JWT), authorization code, and user identifier to your app. Parsing this JWT will return many fields such as email, email_verified, etc. Refer to this documentation for more info.


<button class="google-login native-only" 
  onclick="{ 'redirectUri' : '' });">
    Log in With Google

In this example, the GoNative JavaScript Bridge endpoint is activated when the anchor tag is clicked. After the user has logged in within the native app, the webview will be redirected to