expo / config-plugins

Out-of-tree Expo config plugins for packages that haven't adopted the config plugin system yet.
427 stars 91 forks source link

feat(react-native-google-signin ): added to config-plugin #226

Open heryTz opened 4 months ago

heryTz commented 4 months ago

Why

react-native-google-signin is not compatible with Prebuild. This plugin allows you to configure react-native-google-signin using Prebuild.

How

I take a look at the other Expo Config Plugins in this repo and copying their implementation.

Test Plan

I tested it locally

  1. Install react-native-google-signin
  2. Add configuration
    {
    "expo": {
    "plugins": [
      [
        "@config-plugins/react-native-google-signin",
        {
          "serverClientId": "my_serverClientId",
          "iosClientId": "my_iosClientId",
          "iosUrlScheme": "my_iosUrlScheme"
        }
      ]
    ]
    }
    }
  3. Check Info.plist: ios/[project_id]/Info.plist
    
    ...
CFBundleURLTypes
<array>

  ...

  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>my_iosUrlScheme</string>
    </array>
  </dict>
</array>

...

GIDClientID my_iosClientId

...

5. Check strings.xml: `android/app/src/main/res/values/strings.xml`
... my_serverClientId

7. Run `npx expo prebuild --clean`