-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathapp.plugin.js
34 lines (30 loc) · 1.21 KB
/
app.plugin.js
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
/** @type {import('@kingstinct/expo-apple-targets/build/config-plugin').Config} */
const withTargetsDir = require("@kingstinct/expo-apple-targets/build/config-plugin");
const { createRunOncePlugin } = require("expo/config-plugins");
const withCopyTargetFolder = require("./config-plugin/withCopyTargetFolder");
const withEntitlementsPlugin = require("./config-plugin/withEntitlements");
const withInfoPlistAppGroup = require("./config-plugin/withInfoPlistAppGroup");
const withXcodeSettings = require("./config-plugin/withXCodeSettings");
const pkg = require("./package.json");
/** @type {import('@expo/config-plugins').ConfigPlugin<{ appleTeamId?: string; match?: string; appGroup: string; copyToTargetFolder?: boolean }>} */
const withActivityMonitorExtensionPlugin = (config, props) => {
if (!props || !props.appGroup) {
throw Error(
"'appGroup' is required for react-native-device-activity config plugin",
);
}
return withXcodeSettings(
withInfoPlistAppGroup(
withTargetsDir(
withEntitlementsPlugin(withCopyTargetFolder(config, props), props),
),
props,
),
props,
);
};
module.exports = createRunOncePlugin(
withActivityMonitorExtensionPlugin,
pkg.name,
pkg.version,
);