-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
36 lines (33 loc) · 1.29 KB
/
index.ts
File metadata and controls
36 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {
type ConfigPlugin,
createRunOncePlugin,
withPlugins,
} from '@expo/config-plugins';
import { withAppBridgingHeaderMod } from './custom-mod/withBridgingHeader';
import { withRNOrientationAppDelegate } from './withRNOrientationAppDelegate';
import { withRNOrientationBridgingHeader } from './withRNOrientationBridgingHeader';
import { withRNOrientationMainActivity } from './withRNOrientationMainActivity';
/**
* So, expo config plugin are awesome and the documentation is well written, but I still needed to look around to see
* how other projects actually modify the AppDelegate. I've found react-native-firebase to implement a plugin config
* that changes the AppDelegate, so I'll leave their link as reference:
* https://github.com/invertase/react-native-firebase/blob/main/packages/app/plugin/src/ios/appDelegate.ts
*
* Kudos to them, because this stuff is hard!
*
* @param config
*/
const withRNOrientationDirector: ConfigPlugin = (config) => {
return withPlugins(config, [
withRNOrientationAppDelegate,
withRNOrientationBridgingHeader,
withRNOrientationMainActivity,
withAppBridgingHeaderMod,
]);
};
const pak = require('react-native-orientation-director/package.json');
export default createRunOncePlugin(
withRNOrientationDirector,
pak.name,
pak.version
);