config-plugins icon indicating copy to clipboard operation
config-plugins copied to clipboard

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

Open heryTz opened this issue 1 year ago • 0 comments

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"
        }
      ]
    ]
  }
}
  1. Check Info.plist: ios/[project_id]/Info.plist
...

<key>CFBundleURLTypes</key>
    <array>

      ...

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

...

<key>GIDClientID</key>
<string>my_iosClientId</string>

...
  1. Check strings.xml: android/app/src/main/res/values/strings.xml
<resources>
  ...
  <string name="server_client_id">my_serverClientId</string>
</resources>
  1. Run npx expo prebuild --clean

heryTz avatar Feb 23 '24 06:02 heryTz