UNPKG

react-native-app-auth

Version:

React Native bridge for AppAuth for supporting any OAuth 2 provider

23 lines (20 loc) 643 B
import { withInfoPlist, ConfigPlugin } from '@expo/config-plugins'; import { AppAuthProps } from '../types'; export const withUrlSchemes: ConfigPlugin<AppAuthProps | undefined> = (config, props) => { return withInfoPlist(config, cfg => { if (!cfg.ios) { cfg.ios = {}; } if (!cfg.ios.infoPlist) { cfg.ios.infoPlist = {}; } if (!cfg.ios.infoPlist.CFBundleURLTypes) { cfg.ios.infoPlist.CFBundleURLTypes = []; } cfg.ios.infoPlist.CFBundleURLTypes.push({ CFBundleURLName: '$(PRODUCT_BUNDLE_IDENTIFIER)', CFBundleURLSchemes: [props?.ios?.urlScheme], }); return cfg; }); };