@@ -393,19 +393,19 @@ The Authentication request to our Chat Server is similar to Twitter's except we
393393AccessToken to Authenticate with the Server and we don't need to explicitly save the User's Access Token
394394as Facebook's SDK does this for us behind the scenes.
395395
396- ### Signing in with Google SignIn Button
396+ ### Login with Google SignIn Button
397397
398- Whilst the sign-in process is similar, Google SignIn requires a lot more effort to setup and leaves you
399- to implement a lot of the mechanics yourself starting with having to choose an arbitrary Request Code
400- which you'll need to use to manually check whether the Google SignIn Activity has completed, this can
398+ Whilst the sign-in process is similar, Google SignIn requires more effort to setup as you're left with
399+ implementing a lot of the mechanics yourself starting with having to choose an arbitrary Request Code
400+ which you'll need to use to manually check when the Google SignIn Activity has completed, this can
401401be any number, e.g:
402402
403403``` java
404404private static final int RC_SIGN_IN = 9001 ; // Arbitrary Request Code
405405```
406406
407- Then you 'll need to configure your preferred ` GoogleSignInOptions ` , as we want to be able to retrieve the
408- AccessToken we need to popoulate ` requestServerAuthCode() ` with our Google OAuth App Id:
407+ We 'll then need to configure your preferred ` GoogleSignInOptions ` , as we want to be able to retrieve the
408+ User's AccessToken we need to popoulate ` requestServerAuthCode() ` with our Google OAuth App Id:
409409
410410> If you don't have a Google App, one can be created at [ console.developers.google.com/apis/credentials] ( https://console.developers.google.com/apis/credentials )
411411
@@ -425,8 +425,8 @@ btnGoogleSignIn.setOnClickListener(v -> {
425425});
426426```
427427
428- You'll then need to configure a ` GoogleApiClient ` with your SignIn Options and then manually bind
429- Google's ` SignInButton ` to launch a new SignIn Intent with our custom ` RC_SIGN_IN ` .
428+ We use that to configure a ` GoogleApiClient ` and then manually bind Google's ` SignInButton ` click handler
429+ to launch a new SignIn Intent with our custom ` RC_SIGN_IN ` .
430430
431431Once the User has authorized with Google we're notified in ` onActivityResult() ` which gets called back
432432with our custom ` RC_SIGN_IN ` to let us know we can process the Google SignIn Result:
@@ -442,7 +442,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
442442```
443443
444444If the ` GoogleSignInResult ` was successful the User has Signed in locally to our App at that point but
445- as we need to Authenticate the User with the Chat Server we need to retrieve their AccessToken.
445+ as we need to Authenticate the User with the Chat Server we also need to retrieve their AccessToken.
446446Unfortunately Google only returns us a Server Auth Code which we need to use to call another Google API,
447447passing in our OAuth App Secret to get the User's AccessToken for our App:
448448
@@ -497,9 +497,9 @@ private void handleGoogleSignInResult(GoogleSignInResult result) {
497497}
498498```
499499
500- Once we retrieve the ` accessToken ` the process is similar to our Twitter login where we save the AccessToken
501- to allow auto-SignIn's on App Restarts , we then use the ` accessToken ` to Authenticate with the Chat Server
502- then load the ` MainActivity ` to establish our Authenticated Server Events connection.
500+ Once we retrieve the ` accessToken ` the process is similar to Twitter's where we save the ` AccessToken `
501+ to allow auto-SignIn's on restarts of our App , we then use the ` accessToken ` to Authenticate with the
502+ Chat Server before loading the ` MainActivity ` to establish our Authenticated Server Events connection.
503503
504504### Anonymous Sign In
505505
0 commit comments