Skip to content

Commit a70a120

Browse files
authored
google sign in plist fix (#80)
* chore: google sign in plist fix * chore: format with prettier
1 parent 5e2a82f commit a70a120

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugin/src/withPlist.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ import { ConfigPlugin, withInfoPlist } from '@expo/config-plugins'
33
const withPlist: ConfigPlugin = (expoConfig) =>
44
withInfoPlist(expoConfig, (plistConfig) => {
55
const scheme = typeof expoConfig.scheme === 'string' ? expoConfig.scheme : expoConfig.ios?.bundleIdentifier
6-
if (scheme) plistConfig.modResults.CFBundleURLTypes = [{ CFBundleURLSchemes: [scheme] }]
6+
7+
if (scheme) {
8+
const existingURLTypes = plistConfig.modResults.CFBundleURLTypes || []
9+
const schemeExists = existingURLTypes.some((urlType: any) => urlType.CFBundleURLSchemes?.includes(scheme))
10+
11+
if (!schemeExists) {
12+
plistConfig.modResults.CFBundleURLTypes = [...existingURLTypes, { CFBundleURLSchemes: [scheme] }]
13+
}
14+
}
15+
716
return plistConfig
817
})
918

0 commit comments

Comments
 (0)