Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Step 1: Google Cloud Console Setup

  1. Go to Google Cloud Console.

  2. Create a project if you don’t already have one.

  3. In the search bar (top center), type “Credentials” and select Credentials under “Products & Pages”.

  4. Click the Create Credentials button.

  5. Select OAuth Client ID from the pop-up window.

  6. Choose the appropriate Application Type (iOS, Web, or Android).

We will now proceed with platform-specific setup instructions.

Step 2: iOS Setup

  1. Select iOS under the Application Type dropdown.

  2. Enter a name (e.g., “iOS OAuth”) and your app’s Bundle ID (found in ios/Runner/Info.plist under the CFBundleIdentifier tag).

  3. Click the Create button.

Add to Info.plist:
<array>
 <dict>
  <key>CFBundleTypeRole</key>
  <string>Editor</string>
  <key>CFBundleURLSchemes</key>
  <array>
   <string>com.googleusercontent.apps.***YOUR_CLIENT_ID***</string>
  </array>
 </dict>
</array>
  • Replace YOUR_CLIENT_ID with the generated Client ID.

  • Note: Adding GoogleService-Info.plist is not required.

Step 3: Web Setup

  1. Select Web application under the Application Type dropdown.

  2. Enter a name (e.g., “Web OAuth”).

  3. Add Authorized JavaScript origins and Authorized redirect URIs:

    • Use http://localhost for local debugging.

    • Use https://yourdomain.com for production.

  4. Click Create to generate your Client ID.

Step 4: Android Setup

  1. Select Android under the Application Type dropdown.

  2. Enter a name (e.g., “Android OAuth Debug” for debugging and “Android OAuth Release” for production).

Obtain SHA-1 Keys:
  1. Navigate to the android folder in your project:

    cd android
  2. Run the following command to generate SHA-1 keys:

    ./gradlew signInReport
  3. Use the appropriate SHA-1 key for both debug and release configurations.

Update build.gradle:
  • In android/build.gradle, add:

    classpath 'com.google.gms:google-services:4.3.15'
  • In android/app/build.gradle, add:

    implementation 'com.google.android.gms:play-services-auth:20.4.1'
Configure Signing Configurations:

In android/app/build.gradle, add the following signing configurations:

  • android {
        signingConfigs {
            debug {
                storeFile file('key.jks')
                storePassword 'android'
                keyAlias 'androiddebugkey'
                keyPassword 'android'
            }
            release {
                storeFile file('key.jks')
                storePassword 'android'
                keyAlias 'androiddebugkey'
                keyPassword 'android'
            }
        }
    
        buildTypes {
            debug {
                signingConfig = signingConfigs.debug
            }
            release {
                signingConfig = signingConfigs.release
            }
        }
    }

  • No labels