Skip to content

Commit fdb1110

Browse files
committed
Add Expo CNG support and validation example
- Add app.plugin.js entry point for Expo plugin discoverability - Fix plugin configuration transform to handle redirectUrls properly - Include plugin directory and entry point in npm package files - Ensure iOS and Android URL schemes are configured correctly from redirectUrls array
1 parent 5269567 commit fdb1110

File tree

4 files changed

+1400
-42
lines changed

4 files changed

+1400
-42
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./plugin');

packages/react-native-app-auth/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"files": [
1212
"android",
1313
"ios",
14+
"plugin",
15+
"app.plugin.js",
1416
"index.d.ts",
1517
"react-native-app-auth.podspec"
1618
],

packages/react-native-app-auth/plugin/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,27 @@ const {
1212
const { withAppAuthAppBuildGradle } = require('./android');
1313

1414
const withAppAuth = (config, props) => {
15+
// Transform redirectUrls configuration to platform-specific format
16+
const transformedProps = props?.redirectUrls ? {
17+
ios: {
18+
urlScheme: props.redirectUrls[0]?.split('://')[0], // Extract scheme from first URL
19+
},
20+
android: {
21+
appAuthRedirectScheme: props.redirectUrls[0]?.split('://')[0], // Extract scheme from first URL
22+
},
23+
...props,
24+
} : props;
25+
1526
return withPlugins(config, [
1627
// iOS
1728
withBridgingHeader,
1829
withXcodeBuildSettings,
1930
withAppAuthAppDelegate,
2031
withAppAuthAppDelegateHeader,
21-
[withUrlSchemes, props],
32+
[withUrlSchemes, transformedProps],
2233

2334
// Android
24-
[withAppAuthAppBuildGradle, props],
35+
[withAppAuthAppBuildGradle, transformedProps],
2536
]);
2637
};
2738

0 commit comments

Comments
 (0)