expo-live-activity 0.2.1-alpha1 → 0.3.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +5 -0
- package/.prettierrc +6 -0
- package/README.md +152 -56
- package/app.plugin.js +1 -1
- package/build/ExpoLiveActivityModule.d.ts.map +1 -1
- package/build/ExpoLiveActivityModule.js.map +1 -1
- package/build/index.d.ts +18 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +21 -33
- package/build/index.js.map +1 -1
- package/eslint.config.js +42 -0
- package/ios/ExpoLiveActivityModule.swift +154 -91
- package/ios/Helpers.swift +1 -2
- package/ios-files/Assets.xcassets/AccentColor.colorset/Contents.json +5 -5
- package/ios-files/Assets.xcassets/AppIcon.appiconset/Contents.json +19 -19
- package/ios-files/Assets.xcassets/Contents.json +3 -3
- package/ios-files/Assets.xcassets/WidgetBackground.colorset/Contents.json +5 -5
- package/ios-files/View+applyWidgetURL.swift +15 -1
- package/package.json +18 -6
- package/plugin/build/index.d.ts +1 -1
- package/plugin/build/index.js +8 -3
- package/plugin/build/lib/getWidgetExtensionEntitlements.d.ts +6 -2
- package/plugin/build/lib/getWidgetExtensionEntitlements.js +1 -1
- package/plugin/build/lib/getWidgetFiles.js +18 -17
- package/plugin/build/types.d.ts +1 -1
- package/plugin/build/withConfig.d.ts +1 -1
- package/plugin/build/withPlist.d.ts +5 -0
- package/plugin/build/withPlist.js +25 -0
- package/plugin/build/withPodfile.d.ts +1 -1
- package/plugin/build/withPodfile.js +5 -5
- package/plugin/build/withPushNotifications.d.ts +1 -1
- package/plugin/build/withPushNotifications.js +2 -2
- package/plugin/build/withWidgetExtensionEntitlements.d.ts +1 -1
- package/plugin/build/withWidgetExtensionEntitlements.js +1 -1
- package/plugin/build/withXcode.d.ts +1 -1
- package/plugin/build/withXcode.js +8 -8
- package/plugin/build/xcode/addBuildPhases.d.ts +2 -2
- package/plugin/build/xcode/addBuildPhases.js +8 -10
- package/plugin/build/xcode/addPbxGroup.d.ts +2 -2
- package/plugin/build/xcode/addPbxGroup.js +2 -2
- package/plugin/build/xcode/addProductFile.d.ts +1 -1
- package/plugin/build/xcode/addProductFile.js +3 -3
- package/plugin/build/xcode/addTargetDependency.d.ts +1 -1
- package/plugin/build/xcode/addTargetDependency.js +5 -7
- package/plugin/build/xcode/addToPbxNativeTargetSection.d.ts +1 -1
- package/plugin/build/xcode/addToPbxNativeTargetSection.js +5 -5
- package/plugin/build/xcode/addToPbxProjectSection.d.ts +1 -1
- package/plugin/build/xcode/addToPbxProjectSection.js +1 -2
- package/plugin/build/xcode/addXCConfigurationList.d.ts +1 -1
- package/plugin/build/xcode/addXCConfigurationList.js +6 -6
- package/plugin/src/index.ts +19 -18
- package/plugin/src/lib/getWidgetExtensionEntitlements.ts +10 -13
- package/plugin/src/lib/getWidgetFiles.ts +70 -74
- package/plugin/src/types.ts +3 -5
- package/plugin/src/withConfig.ts +15 -15
- package/plugin/src/withPlist.ts +27 -0
- package/plugin/src/withPodfile.ts +17 -24
- package/plugin/src/withPushNotifications.ts +7 -11
- package/plugin/src/withWidgetExtensionEntitlements.ts +14 -14
- package/plugin/src/withXcode.ts +32 -41
- package/plugin/src/xcode/addBuildPhases.ts +26 -41
- package/plugin/src/xcode/addPbxGroup.ts +9 -16
- package/plugin/src/xcode/addProductFile.ts +7 -7
- package/plugin/src/xcode/addTargetDependency.ts +7 -12
- package/plugin/src/xcode/addToPbxNativeTargetSection.ts +13 -15
- package/plugin/src/xcode/addToPbxProjectSection.ts +7 -17
- package/plugin/src/xcode/addXCConfigurationList.ts +16 -16
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/scripts/update-version.sh +15 -0
- package/src/ExpoLiveActivityModule.ts +2 -2
- package/src/index.ts +69 -55
- package/.eslintrc.js +0 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
7
|
+
const plist_1 = __importDefault(require("@expo/plist"));
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const withPlist = (expoConfig, { targetName }) => (0, config_plugins_1.withInfoPlist)(expoConfig, (plistConfig) => {
|
|
11
|
+
const scheme = typeof expoConfig.scheme === 'string' ? expoConfig.scheme : expoConfig.ios?.bundleIdentifier;
|
|
12
|
+
if (scheme) {
|
|
13
|
+
const targetPath = (0, path_1.join)(plistConfig.modRequest.platformProjectRoot, targetName);
|
|
14
|
+
const filePath = (0, path_1.join)(targetPath, 'Info.plist');
|
|
15
|
+
const content = plist_1.default.parse((0, fs_1.readFileSync)(filePath, 'utf8'));
|
|
16
|
+
content.CFBundleURLTypes = [
|
|
17
|
+
{
|
|
18
|
+
CFBundleURLSchemes: [scheme],
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
(0, fs_1.writeFileSync)(filePath, plist_1.default.build(content));
|
|
22
|
+
}
|
|
23
|
+
return plistConfig;
|
|
24
|
+
});
|
|
25
|
+
exports.default = withPlist;
|
|
@@ -34,15 +34,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.withPodfile = void 0;
|
|
37
|
-
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
38
37
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
38
|
+
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
39
39
|
const fs = __importStar(require("fs"));
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const withPodfile = (config, { targetName }) => {
|
|
42
42
|
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
43
|
-
|
|
43
|
+
'ios',
|
|
44
44
|
(config) => {
|
|
45
|
-
const podFilePath = path.join(config.modRequest.platformProjectRoot,
|
|
45
|
+
const podFilePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');
|
|
46
46
|
let podFileContent = fs.readFileSync(podFilePath).toString();
|
|
47
47
|
/* podFileContent = mergeContents({
|
|
48
48
|
tag: "withWidgetExtensionPodfile1999999999",
|
|
@@ -57,7 +57,7 @@ const withPodfile = (config, { targetName }) => {
|
|
|
57
57
|
`use_expo_modules!(searchPaths: ["./node_modules", "../../node_modules", "../../../WidgetExtension"])`
|
|
58
58
|
); */
|
|
59
59
|
podFileContent = (0, generateCode_1.mergeContents)({
|
|
60
|
-
tag:
|
|
60
|
+
tag: 'react-native-widget-extension-1',
|
|
61
61
|
src: podFileContent,
|
|
62
62
|
newSrc: `installer.pods_project.targets.each do |target|
|
|
63
63
|
target.build_configurations.each do |config|
|
|
@@ -67,7 +67,7 @@ const withPodfile = (config, { targetName }) => {
|
|
|
67
67
|
end`,
|
|
68
68
|
anchor: /installer.target_installation_results.pod_target_installation_results/,
|
|
69
69
|
offset: 0,
|
|
70
|
-
comment:
|
|
70
|
+
comment: '#',
|
|
71
71
|
}).contents;
|
|
72
72
|
/* podFileContent = mergeContents({
|
|
73
73
|
tag: "react-native-widget-extension-2",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ConfigPlugin } from
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
export declare const withPushNotifications: ConfigPlugin;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withPushNotifications = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
5
|
const withPushNotifications = (config) => (0, config_plugins_1.withInfoPlist)((0, config_plugins_1.withEntitlementsPlist)(config, (mod) => {
|
|
6
|
-
mod.modResults[
|
|
6
|
+
mod.modResults['aps-environment'] = 'development';
|
|
7
7
|
return mod;
|
|
8
8
|
}), (mod) => {
|
|
9
|
-
mod.modResults[
|
|
9
|
+
mod.modResults['ExpoLiveActivity_EnablePushNotifications'] = true;
|
|
10
10
|
return mod;
|
|
11
11
|
});
|
|
12
12
|
exports.withPushNotifications = withPushNotifications;
|
|
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.withWidgetExtensionEntitlements = void 0;
|
|
40
|
-
const plist_1 = __importDefault(require("@expo/plist"));
|
|
41
40
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
41
|
+
const plist_1 = __importDefault(require("@expo/plist"));
|
|
42
42
|
const fs = __importStar(require("fs"));
|
|
43
43
|
const path = __importStar(require("path"));
|
|
44
44
|
// import { getWidgetExtensionEntitlements } from "./lib/getWidgetExtensionEntitlements";
|
|
@@ -36,26 +36,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.withXcode = void 0;
|
|
37
37
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
-
const
|
|
39
|
+
const getWidgetFiles_1 = require("./lib/getWidgetFiles");
|
|
40
|
+
const addBuildPhases_1 = require("./xcode/addBuildPhases");
|
|
41
|
+
const addPbxGroup_1 = require("./xcode/addPbxGroup");
|
|
40
42
|
const addProductFile_1 = require("./xcode/addProductFile");
|
|
43
|
+
const addTargetDependency_1 = require("./xcode/addTargetDependency");
|
|
41
44
|
const addToPbxNativeTargetSection_1 = require("./xcode/addToPbxNativeTargetSection");
|
|
42
45
|
const addToPbxProjectSection_1 = require("./xcode/addToPbxProjectSection");
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const addBuildPhases_1 = require("./xcode/addBuildPhases");
|
|
46
|
-
const getWidgetFiles_1 = require("./lib/getWidgetFiles");
|
|
47
|
-
const withXcode = (config, { targetName, bundleIdentifier, deploymentTarget, }) => {
|
|
46
|
+
const addXCConfigurationList_1 = require("./xcode/addXCConfigurationList");
|
|
47
|
+
const withXcode = (config, { targetName, bundleIdentifier, deploymentTarget }) => {
|
|
48
48
|
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
49
49
|
const xcodeProject = config.modResults;
|
|
50
50
|
const targetUuid = xcodeProject.generateUuid();
|
|
51
|
-
const groupName =
|
|
51
|
+
const groupName = 'Embed Foundation Extensions';
|
|
52
52
|
const { platformProjectRoot } = config.modRequest;
|
|
53
53
|
const marketingVersion = config.version;
|
|
54
54
|
const targetPath = path.join(platformProjectRoot, targetName);
|
|
55
55
|
const widgetFiles = (0, getWidgetFiles_1.getWidgetFiles)(targetPath);
|
|
56
56
|
const xCConfigurationList = (0, addXCConfigurationList_1.addXCConfigurationList)(xcodeProject, {
|
|
57
57
|
targetName,
|
|
58
|
-
currentProjectVersion: config.ios.buildNumber ||
|
|
58
|
+
currentProjectVersion: config.ios.buildNumber || '1',
|
|
59
59
|
bundleIdentifier,
|
|
60
60
|
deploymentTarget,
|
|
61
61
|
marketingVersion,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { XcodeProject } from
|
|
2
|
-
import { WidgetFiles } from
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
import { WidgetFiles } from '../lib/getWidgetFiles';
|
|
3
3
|
export declare function addBuildPhases(xcodeProject: XcodeProject, { targetUuid, groupName, productFile, widgetFiles, }: {
|
|
4
4
|
targetUuid: string;
|
|
5
5
|
groupName: string;
|
|
@@ -37,21 +37,19 @@ exports.addBuildPhases = addBuildPhases;
|
|
|
37
37
|
const util = __importStar(require("util"));
|
|
38
38
|
function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, widgetFiles, }) {
|
|
39
39
|
const buildPath = `""`;
|
|
40
|
-
const folderType =
|
|
41
|
-
const { swiftFiles, intentFiles, assetDirectories
|
|
40
|
+
const folderType = 'app_extension';
|
|
41
|
+
const { swiftFiles, intentFiles, assetDirectories } = widgetFiles;
|
|
42
42
|
// Sources build phase
|
|
43
|
-
xcodeProject.addBuildPhase([...swiftFiles, ...intentFiles],
|
|
43
|
+
xcodeProject.addBuildPhase([...swiftFiles, ...intentFiles], 'PBXSourcesBuildPhase', groupName, targetUuid, folderType, buildPath);
|
|
44
44
|
// Copy files build phase
|
|
45
|
-
xcodeProject.addBuildPhase([],
|
|
46
|
-
xcodeProject
|
|
47
|
-
.buildPhaseObject("PBXCopyFilesBuildPhase", groupName, productFile.target)
|
|
48
|
-
.files.push({
|
|
45
|
+
xcodeProject.addBuildPhase([], 'PBXCopyFilesBuildPhase', groupName, xcodeProject.getFirstTarget().uuid, folderType, buildPath);
|
|
46
|
+
xcodeProject.buildPhaseObject('PBXCopyFilesBuildPhase', groupName, productFile.target).files.push({
|
|
49
47
|
value: productFile.uuid,
|
|
50
|
-
comment: util.format(
|
|
48
|
+
comment: util.format('%s in %s', productFile.basename, productFile.group), // longComment(file);
|
|
51
49
|
});
|
|
52
50
|
xcodeProject.addToPbxBuildFileSection(productFile);
|
|
53
51
|
// Frameworks build phase
|
|
54
|
-
xcodeProject.addBuildPhase([],
|
|
52
|
+
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', groupName, targetUuid, folderType, buildPath);
|
|
55
53
|
// Resources build phase
|
|
56
|
-
xcodeProject.addBuildPhase([...assetDirectories],
|
|
54
|
+
xcodeProject.addBuildPhase([...assetDirectories], 'PBXResourcesBuildPhase', groupName, targetUuid, folderType, buildPath);
|
|
57
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { XcodeProject } from
|
|
2
|
-
import { WidgetFiles } from
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
import { WidgetFiles } from '../lib/getWidgetFiles';
|
|
3
3
|
export declare function addPbxGroup(xcodeProject: XcodeProject, { targetName, widgetFiles, }: {
|
|
4
4
|
targetName: string;
|
|
5
5
|
widgetFiles: WidgetFiles;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addPbxGroup = addPbxGroup;
|
|
4
4
|
function addPbxGroup(xcodeProject, { targetName, widgetFiles, }) {
|
|
5
|
-
const { swiftFiles, intentFiles, otherFiles, assetDirectories, entitlementFiles, plistFiles
|
|
5
|
+
const { swiftFiles, intentFiles, otherFiles, assetDirectories, entitlementFiles, plistFiles } = widgetFiles;
|
|
6
6
|
// Add PBX group
|
|
7
7
|
const { uuid: pbxGroupUuid } = xcodeProject.addPbxGroup([
|
|
8
8
|
...swiftFiles,
|
|
@@ -14,7 +14,7 @@ function addPbxGroup(xcodeProject, { targetName, widgetFiles, }) {
|
|
|
14
14
|
`${targetName}.entitlements`,
|
|
15
15
|
], targetName, targetName);
|
|
16
16
|
// Add PBXGroup to top level group
|
|
17
|
-
const groups = xcodeProject.hash.project.objects[
|
|
17
|
+
const groups = xcodeProject.hash.project.objects['PBXGroup'];
|
|
18
18
|
if (pbxGroupUuid) {
|
|
19
19
|
Object.keys(groups).forEach(function (key) {
|
|
20
20
|
if (groups[key].name === undefined && groups[key].path === undefined) {
|
|
@@ -7,14 +7,14 @@ function addProductFile(xcodeProject, { targetName, groupName }) {
|
|
|
7
7
|
// fileRef: xcodeProject.generateUuid(),
|
|
8
8
|
// uuid: xcodeProject.generateUuid(),
|
|
9
9
|
group: groupName,
|
|
10
|
-
explicitFileType:
|
|
10
|
+
explicitFileType: 'wrapper.app-extension',
|
|
11
11
|
/* fileEncoding: 4, */
|
|
12
12
|
settings: {
|
|
13
|
-
ATTRIBUTES: [
|
|
13
|
+
ATTRIBUTES: ['RemoveHeadersOnCopy'],
|
|
14
14
|
},
|
|
15
15
|
includeInIndex: 0,
|
|
16
16
|
path: `${targetName}.appex`,
|
|
17
|
-
sourceTree:
|
|
17
|
+
sourceTree: 'BUILT_PRODUCTS_DIR',
|
|
18
18
|
};
|
|
19
19
|
const productFile = xcodeProject.addProductFile(targetName, options);
|
|
20
20
|
return productFile;
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addTargetDependency = addTargetDependency;
|
|
4
4
|
function addTargetDependency(xcodeProject, target) {
|
|
5
|
-
if (!xcodeProject.hash.project.objects[
|
|
6
|
-
xcodeProject.hash.project.objects[
|
|
5
|
+
if (!xcodeProject.hash.project.objects['PBXTargetDependency']) {
|
|
6
|
+
xcodeProject.hash.project.objects['PBXTargetDependency'] = {};
|
|
7
7
|
}
|
|
8
|
-
if (!xcodeProject.hash.project.objects[
|
|
9
|
-
xcodeProject.hash.project.objects[
|
|
8
|
+
if (!xcodeProject.hash.project.objects['PBXContainerItemProxy']) {
|
|
9
|
+
xcodeProject.hash.project.objects['PBXContainerItemProxy'] = {};
|
|
10
10
|
}
|
|
11
|
-
xcodeProject.addTargetDependency(xcodeProject.getFirstTarget().uuid, [
|
|
12
|
-
target.uuid,
|
|
13
|
-
]);
|
|
11
|
+
xcodeProject.addTargetDependency(xcodeProject.getFirstTarget().uuid, [target.uuid]);
|
|
14
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XcodeProject } from
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
2
|
export declare function addToPbxNativeTargetSection(xcodeProject: XcodeProject, { targetName, targetUuid, productFile, xCConfigurationList, }: {
|
|
3
3
|
targetName: string;
|
|
4
4
|
targetUuid: string;
|
|
@@ -5,7 +5,7 @@ function addToPbxNativeTargetSection(xcodeProject, { targetName, targetUuid, pro
|
|
|
5
5
|
const target = {
|
|
6
6
|
uuid: targetUuid,
|
|
7
7
|
pbxNativeTarget: {
|
|
8
|
-
isa:
|
|
8
|
+
isa: 'PBXNativeTarget',
|
|
9
9
|
name: targetName,
|
|
10
10
|
productName: targetName,
|
|
11
11
|
productReference: productFile.fileRef,
|
|
@@ -17,10 +17,10 @@ function addToPbxNativeTargetSection(xcodeProject, { targetName, targetUuid, pro
|
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
xcodeProject.addToPbxNativeTargetSection(target);
|
|
20
|
-
const frameworksGroup = xcodeProject.findPBXGroupKey({ name:
|
|
21
|
-
const file1 = xcodeProject.addFile(
|
|
22
|
-
const file2 = xcodeProject.addFile(
|
|
23
|
-
const frameworksBuildPhaseObj = xcodeProject.pbxFrameworksBuildPhaseObj(target.uuid)
|
|
20
|
+
// const frameworksGroup = xcodeProject.findPBXGroupKey({ name: 'Frameworks' })
|
|
21
|
+
// const file1 = xcodeProject.addFile('WidgetKit.framework', frameworksGroup)
|
|
22
|
+
// const file2 = xcodeProject.addFile('SwiftUI.framework', frameworksGroup)
|
|
23
|
+
// const frameworksBuildPhaseObj = xcodeProject.pbxFrameworksBuildPhaseObj(target.uuid)
|
|
24
24
|
/* console.log(
|
|
25
25
|
{ file1, file2, frameworksBuildPhaseObj },
|
|
26
26
|
frameworksBuildPhaseObj.files
|
|
@@ -4,8 +4,7 @@ exports.addToPbxProjectSection = addToPbxProjectSection;
|
|
|
4
4
|
function addToPbxProjectSection(xcodeProject, target) {
|
|
5
5
|
xcodeProject.addToPbxProjectSection(target);
|
|
6
6
|
// Add target attributes to project section
|
|
7
|
-
if (!xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid]
|
|
8
|
-
.attributes.TargetAttributes) {
|
|
7
|
+
if (!xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes) {
|
|
9
8
|
xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes = {};
|
|
10
9
|
}
|
|
11
10
|
xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes[target.uuid] = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XcodeProject } from
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
2
|
export declare function addXCConfigurationList(xcodeProject: XcodeProject, { targetName, currentProjectVersion, bundleIdentifier, deploymentTarget, marketingVersion, }: {
|
|
3
3
|
targetName: string;
|
|
4
4
|
currentProjectVersion: string;
|
|
@@ -26,7 +26,7 @@ function addXCConfigurationList(xcodeProject, { targetName, currentProjectVersio
|
|
|
26
26
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
|
27
27
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; */
|
|
28
28
|
PRODUCT_NAME: `"$(TARGET_NAME)"`,
|
|
29
|
-
SWIFT_VERSION:
|
|
29
|
+
SWIFT_VERSION: '5.0',
|
|
30
30
|
TARGETED_DEVICE_FAMILY: `"1,2"`,
|
|
31
31
|
INFOPLIST_FILE: `${targetName}/Info.plist`,
|
|
32
32
|
CURRENT_PROJECT_VERSION: `"${currentProjectVersion}"`,
|
|
@@ -42,20 +42,20 @@ function addXCConfigurationList(xcodeProject, { targetName, currentProjectVersio
|
|
|
42
42
|
};
|
|
43
43
|
const buildConfigurationsList = [
|
|
44
44
|
{
|
|
45
|
-
name:
|
|
46
|
-
isa:
|
|
45
|
+
name: 'Debug',
|
|
46
|
+
isa: 'XCBuildConfiguration',
|
|
47
47
|
buildSettings: {
|
|
48
48
|
...commonBuildSettings,
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
name:
|
|
53
|
-
isa:
|
|
52
|
+
name: 'Release',
|
|
53
|
+
isa: 'XCBuildConfiguration',
|
|
54
54
|
buildSettings: {
|
|
55
55
|
...commonBuildSettings,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
];
|
|
59
|
-
const xCConfigurationList = xcodeProject.addXCConfigurationList(buildConfigurationsList,
|
|
59
|
+
const xCConfigurationList = xcodeProject.addXCConfigurationList(buildConfigurationsList, 'Release', `Build configuration list for PBXNativeTarget "${targetName}"`);
|
|
60
60
|
return xCConfigurationList;
|
|
61
61
|
}
|
package/plugin/src/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IOSConfig, withPlugins } from
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { withPushNotifications } from
|
|
1
|
+
import { IOSConfig, withPlugins } from 'expo/config-plugins'
|
|
2
|
+
|
|
3
|
+
import type { LiveActivityConfigPlugin } from './types'
|
|
4
|
+
import { withConfig } from './withConfig'
|
|
5
|
+
import withPlist from './withPlist'
|
|
6
|
+
import { withPodfile } from './withPodfile'
|
|
7
|
+
import { withPushNotifications } from './withPushNotifications'
|
|
8
|
+
import { withWidgetExtensionEntitlements } from './withWidgetExtensionEntitlements'
|
|
9
|
+
import { withXcode } from './withXcode'
|
|
8
10
|
|
|
9
11
|
const withWidgetsAndLiveActivities: LiveActivityConfigPlugin = (config, props) => {
|
|
10
|
-
const deploymentTarget =
|
|
11
|
-
const targetName = `${IOSConfig.XcodeUtils.sanitizedName(
|
|
12
|
-
|
|
13
|
-
)}LiveActivity`;
|
|
14
|
-
const bundleIdentifier = `${config.ios?.bundleIdentifier}.${targetName}`;
|
|
12
|
+
const deploymentTarget = '16.2'
|
|
13
|
+
const targetName = `${IOSConfig.XcodeUtils.sanitizedName(config.name)}LiveActivity`
|
|
14
|
+
const bundleIdentifier = `${config.ios?.bundleIdentifier}.${targetName}`
|
|
15
15
|
|
|
16
16
|
config.ios = {
|
|
17
17
|
...config.ios,
|
|
@@ -20,9 +20,10 @@ const withWidgetsAndLiveActivities: LiveActivityConfigPlugin = (config, props) =
|
|
|
20
20
|
NSSupportsLiveActivities: true,
|
|
21
21
|
NSSupportsLiveActivitiesFrequentUpdates: false,
|
|
22
22
|
},
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
config = withPlugins(config, [
|
|
26
|
+
[withPlist, { targetName }],
|
|
26
27
|
[
|
|
27
28
|
withXcode,
|
|
28
29
|
{
|
|
@@ -34,13 +35,13 @@ const withWidgetsAndLiveActivities: LiveActivityConfigPlugin = (config, props) =
|
|
|
34
35
|
[withWidgetExtensionEntitlements, { targetName }],
|
|
35
36
|
[withPodfile, { targetName }],
|
|
36
37
|
[withConfig, { targetName, bundleIdentifier }],
|
|
37
|
-
])
|
|
38
|
+
])
|
|
38
39
|
|
|
39
40
|
if (props?.enablePushNotifications) {
|
|
40
|
-
config = withPushNotifications(config)
|
|
41
|
+
config = withPushNotifications(config)
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
return config
|
|
44
|
-
}
|
|
44
|
+
return config
|
|
45
|
+
}
|
|
45
46
|
|
|
46
|
-
export default withWidgetsAndLiveActivities
|
|
47
|
+
export default withWidgetsAndLiveActivities
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { ExportedConfig, InfoPlist } from
|
|
1
|
+
import { ExportedConfig, InfoPlist } from '@expo/config-plugins'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
) {
|
|
11
|
-
const entitlements: InfoPlist = {};
|
|
3
|
+
interface Options {
|
|
4
|
+
groupIdentifier?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getWidgetExtensionEntitlements(_iosConfig: ExportedConfig['ios'], _options: Options | undefined = {}) {
|
|
8
|
+
const entitlements: InfoPlist = {}
|
|
12
9
|
|
|
13
|
-
addApplicationGroupsEntitlement(entitlements)
|
|
10
|
+
addApplicationGroupsEntitlement(entitlements)
|
|
14
11
|
|
|
15
|
-
return entitlements
|
|
12
|
+
return entitlements
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
export function addApplicationGroupsEntitlement(entitlements: InfoPlist, groupIdentifier?: string) {
|
|
@@ -22,5 +19,5 @@ export function addApplicationGroupsEntitlement(entitlements: InfoPlist, groupId
|
|
|
22
19
|
// entitlements["com.apple.security.application-groups"] = [groupIdentifier, ...existingApplicationGroups];
|
|
23
20
|
// }
|
|
24
21
|
|
|
25
|
-
return entitlements
|
|
22
|
+
return entitlements
|
|
26
23
|
}
|