expo-invoke 2.6.14 → 2.7.0
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/android/src/main/java/expo/modules/invoke/ExpoInvokeModule.kt +35 -0
- package/android/src/main/java/expo/modules/invoke/InvokeSliceProvider.kt +9 -0
- package/build/plugin/codegen/generateSwiftIntents.js +22 -0
- package/build/plugin/codegen/generateSwiftIntents.js.map +1 -1
- package/build/plugin/codegen/generateSwiftLiveActivities.d.ts +17 -0
- package/build/plugin/codegen/generateSwiftLiveActivities.js +165 -0
- package/build/plugin/codegen/generateSwiftLiveActivities.js.map +1 -0
- package/build/plugin/codegen/generateSwiftWidget.d.ts +5 -0
- package/build/plugin/codegen/generateSwiftWidget.js.map +1 -1
- package/build/plugin/ios/widgets/withAppGroupEntitlements.d.ts +6 -0
- package/build/plugin/ios/widgets/withAppGroupEntitlements.js +27 -0
- package/build/plugin/ios/widgets/withAppGroupEntitlements.js.map +1 -0
- package/build/plugin/ios/widgets/withAppInfoPlist.d.ts +7 -0
- package/build/plugin/ios/widgets/withAppInfoPlist.js +12 -0
- package/build/plugin/ios/widgets/withAppInfoPlist.js.map +1 -0
- package/build/plugin/ios/widgets/withEasConfig.d.ts +8 -0
- package/build/plugin/ios/widgets/withEasConfig.js +52 -0
- package/build/plugin/ios/widgets/withEasConfig.js.map +1 -0
- package/build/plugin/ios/widgets/withIosWarning.d.ts +7 -0
- package/build/plugin/ios/widgets/withIosWarning.js +10 -0
- package/build/plugin/ios/widgets/withIosWarning.js.map +1 -0
- package/build/plugin/ios/widgets/withIosWidgets.d.ts +11 -0
- package/build/plugin/ios/widgets/withIosWidgets.js +83 -0
- package/build/plugin/ios/widgets/withIosWidgets.js.map +1 -0
- package/build/plugin/ios/widgets/withPodsLinking.d.ts +6 -0
- package/build/plugin/ios/widgets/withPodsLinking.js +102 -0
- package/build/plugin/ios/widgets/withPodsLinking.js.map +1 -0
- package/build/plugin/ios/widgets/withPushNotifications.d.ts +6 -0
- package/build/plugin/ios/widgets/withPushNotifications.js +12 -0
- package/build/plugin/ios/widgets/withPushNotifications.js.map +1 -0
- package/build/plugin/ios/widgets/withWidgetSourceFiles.d.ts +10 -0
- package/build/plugin/ios/widgets/withWidgetSourceFiles.js +379 -0
- package/build/plugin/ios/widgets/withWidgetSourceFiles.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.d.ts +12 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.js +41 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addPbxGroup.d.ts +5 -0
- package/build/plugin/ios/widgets/xcode/addPbxGroup.js +20 -0
- package/build/plugin/ios/widgets/xcode/addPbxGroup.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addProductFile.d.ts +7 -0
- package/build/plugin/ios/widgets/xcode/addProductFile.js +41 -0
- package/build/plugin/ios/widgets/xcode/addProductFile.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addTargetDependency.d.ts +4 -0
- package/build/plugin/ios/widgets/xcode/addTargetDependency.js +17 -0
- package/build/plugin/ios/widgets/xcode/addTargetDependency.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.d.ts +14 -0
- package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.js +29 -0
- package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.d.ts +4 -0
- package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.js +20 -0
- package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addXCConfigurationList.d.ts +11 -0
- package/build/plugin/ios/widgets/xcode/addXCConfigurationList.js +37 -0
- package/build/plugin/ios/widgets/xcode/addXCConfigurationList.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.d.ts +10 -0
- package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.js +86 -0
- package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.js.map +1 -0
- package/build/plugin/ios/withIOSInvoke.d.ts +6 -15
- package/build/plugin/ios/withIOSInvoke.js +54 -25
- package/build/plugin/ios/withIOSInvoke.js.map +1 -1
- package/build/plugin/ios/withWidgetExtension.d.ts +5 -0
- package/build/plugin/ios/withWidgetExtension.js +36 -6
- package/build/plugin/ios/withWidgetExtension.js.map +1 -1
- package/build/plugin/src/withInvoke.d.ts +34 -23
- package/build/plugin/src/withInvoke.js +16 -27
- package/build/plugin/src/withInvoke.js.map +1 -1
- package/build/plugin/types/WidgetConfig.type.d.ts +54 -0
- package/build/plugin/types/WidgetConfig.type.js +3 -0
- package/build/plugin/types/WidgetConfig.type.js.map +1 -0
- package/build/plugin/types/WidgetFamily.type.d.ts +10 -0
- package/build/plugin/types/WidgetFamily.type.js +13 -0
- package/build/plugin/types/WidgetFamily.type.js.map +1 -0
- package/build/src/hooks/useLiveActivity.d.ts +20 -10
- package/build/src/hooks/useLiveActivity.d.ts.map +1 -1
- package/build/src/hooks/useLiveActivity.js +20 -10
- package/build/src/hooks/useLiveActivity.js.map +1 -1
- package/build/src/index.d.ts +2 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +5 -0
- package/build/src/index.js.map +1 -1
- package/build/src/module.d.ts +4 -0
- package/build/src/module.d.ts.map +1 -1
- package/build/src/module.js +8 -0
- package/build/src/module.js.map +1 -1
- package/build/src/web/index.d.ts +10 -1
- package/build/src/web/index.d.ts.map +1 -1
- package/build/src/web/index.js +4 -0
- package/build/src/web/index.js.map +1 -1
- package/build/src/widgets/ExpoWidgets.d.ts +12 -0
- package/build/src/widgets/ExpoWidgets.d.ts.map +1 -0
- package/build/src/widgets/ExpoWidgets.ios.d.ts +12 -0
- package/build/src/widgets/ExpoWidgets.ios.d.ts.map +1 -0
- package/build/src/widgets/ExpoWidgets.ios.js +3 -0
- package/build/src/widgets/ExpoWidgets.ios.js.map +1 -0
- package/build/src/widgets/ExpoWidgets.js +42 -0
- package/build/src/widgets/ExpoWidgets.js.map +1 -0
- package/build/src/widgets/Widgets.d.ts +119 -0
- package/build/src/widgets/Widgets.d.ts.map +1 -0
- package/build/src/widgets/Widgets.js +158 -0
- package/build/src/widgets/Widgets.js.map +1 -0
- package/build/src/widgets/Widgets.types.d.ts +263 -0
- package/build/src/widgets/Widgets.types.d.ts.map +1 -0
- package/build/src/widgets/Widgets.types.js +2 -0
- package/build/src/widgets/Widgets.types.js.map +1 -0
- package/build/src/widgets/index.d.ts +3 -0
- package/build/src/widgets/index.d.ts.map +1 -0
- package/build/src/widgets/index.js +2 -0
- package/build/src/widgets/index.js.map +1 -0
- package/bundle/__tests__/decorator.test.ts +89 -0
- package/bundle/decorator.ts +61 -0
- package/bundle/expo-modules-core-stub.ts +1 -0
- package/bundle/expo-stub.ts +15 -0
- package/bundle/index.ts +69 -0
- package/bundle/jsx-runtime-stub.ts +71 -0
- package/bundle/react-native-stub.ts +3 -0
- package/bundle/react-stub.ts +13 -0
- package/expo-module.config.json +1 -1
- package/ios/LiveActivity/LiveActivityManager.swift +15 -14
- package/ios/Module/ExpoInvokeModule.swift +124 -0
- package/ios/Widget/WidgetManager.swift +25 -8
- package/ios/Widgets/LiveActivity.swift +81 -0
- package/ios/Widgets/LiveActivityFactory.swift +49 -0
- package/ios/Widgets/Widget/AppIntent.swift +130 -0
- package/ios/Widgets/Widget/Buttons.swift +62 -0
- package/ios/Widgets/Widget/DynamicView.swift +161 -0
- package/ios/Widgets/Widget/EntryView.swift +36 -0
- package/ios/Widgets/Widget/Fragment.swift +13 -0
- package/ios/Widgets/Widget/LiveActivityBanner.swift +19 -0
- package/ios/Widgets/Widget/RedBoxView.swift +83 -0
- package/ios/Widgets/Widget/TimelineEntry.swift +8 -0
- package/ios/Widgets/Widget/TimelineProvider.swift +45 -0
- package/ios/Widgets/Widget/Type.swift +6 -0
- package/ios/Widgets/Widget/Utils.swift +116 -0
- package/ios/Widgets/Widget/WidgetLiveActivity.swift +104 -0
- package/ios/Widgets/Widget/WidgetsJSRuntime.swift +148 -0
- package/ios/Widgets/WidgetObject.swift +31 -0
- package/ios/Widgets/WidgetsContext.swift +7 -0
- package/ios/Widgets/WidgetsEvents.swift +16 -0
- package/ios/Widgets/WidgetsExceptions.swift +25 -0
- package/ios/Widgets/WidgetsModule.swift +149 -0
- package/ios/Widgets/WidgetsRecords.swift +22 -0
- package/ios/Widgets/WidgetsStorage.swift +58 -0
- package/metro.widget.config.js +76 -0
- package/package.json +11 -1
- package/scripts/autolinking.rb +34 -0
- package/scripts/build-bundle.mjs +69 -0
- package/scripts/with-node.sh +44 -0
- package/scripts/xcode-build-bundle.sh +23 -0
- package/spm.config.json +40 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addProductFile = addProductFile;
|
|
4
|
+
function addProductFile(xcodeProject, { targetName, groupName }) {
|
|
5
|
+
var _a;
|
|
6
|
+
const basename = `${targetName}.appex`;
|
|
7
|
+
const settings = { ATTRIBUTES: ['RemoveHeadersOnCopy'] };
|
|
8
|
+
const fileReferenceSection = xcodeProject.pbxFileReferenceSection();
|
|
9
|
+
const fileRef = Object.keys(fileReferenceSection).find((key) => {
|
|
10
|
+
const fileReference = fileReferenceSection[key];
|
|
11
|
+
return ((fileReference === null || fileReference === void 0 ? void 0 : fileReference.path) === basename ||
|
|
12
|
+
(fileReference === null || fileReference === void 0 ? void 0 : fileReference.path) === `"${basename}"` ||
|
|
13
|
+
(fileReference === null || fileReference === void 0 ? void 0 : fileReference.name) === basename ||
|
|
14
|
+
(fileReference === null || fileReference === void 0 ? void 0 : fileReference.name) === `"${basename}"`);
|
|
15
|
+
});
|
|
16
|
+
if (fileRef) {
|
|
17
|
+
const buildFileSection = xcodeProject.pbxBuildFileSection();
|
|
18
|
+
const uuid = (_a = Object.keys(buildFileSection).find((key) => {
|
|
19
|
+
const buildFile = buildFileSection[key];
|
|
20
|
+
return (buildFile === null || buildFile === void 0 ? void 0 : buildFile.fileRef) === fileRef;
|
|
21
|
+
})) !== null && _a !== void 0 ? _a : xcodeProject.generateUuid();
|
|
22
|
+
return {
|
|
23
|
+
uuid,
|
|
24
|
+
fileRef,
|
|
25
|
+
target: targetName,
|
|
26
|
+
basename,
|
|
27
|
+
group: groupName,
|
|
28
|
+
settings,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return xcodeProject.addProductFile(targetName, {
|
|
32
|
+
basename,
|
|
33
|
+
group: groupName,
|
|
34
|
+
explicitFileType: 'wrapper.app-extension',
|
|
35
|
+
settings,
|
|
36
|
+
includeInIndex: 0,
|
|
37
|
+
path: basename,
|
|
38
|
+
sourceTree: 'BUILT_PRODUCTS_DIR',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=addProductFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addProductFile.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addProductFile.ts"],"names":[],"mappings":";;AAOA,wCA4CC;AA5CD,SAAgB,cAAc,CAC5B,YAA0B,EAC1B,EAAE,UAAU,EAAE,SAAS,EAAuB;;IAE9C,MAAM,QAAQ,GAAG,GAAG,UAAU,QAAQ,CAAC;IACvC,MAAM,QAAQ,GAAG,EAAE,UAAU,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC;IACzD,MAAM,oBAAoB,GAAG,YAAY,CAAC,uBAAuB,EAAE,CAAC;IACpE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7D,MAAM,aAAa,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAChD,OAAO,CACL,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,MAAK,QAAQ;YAChC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,MAAK,IAAI,QAAQ,GAAG;YACvC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,MAAK,QAAQ;YAChC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,MAAK,IAAI,QAAQ,GAAG,CACxC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,gBAAgB,GAAG,YAAY,CAAC,mBAAmB,EAAE,CAAC;QAC5D,MAAM,IAAI,GACR,MAAA,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACzC,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;YACxC,OAAO,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,MAAK,OAAO,CAAC;QACxC,CAAC,CAAC,mCAAI,YAAY,CAAC,YAAY,EAAE,CAAC;QAEpC,OAAO;YACL,IAAI;YACJ,OAAO;YACP,MAAM,EAAE,UAAU;YAClB,QAAQ;YACR,KAAK,EAAE,SAAS;YAChB,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,OAAO,YAAY,CAAC,cAAc,CAAC,UAAU,EAAE;QAC7C,QAAQ;QACR,KAAK,EAAE,SAAS;QAChB,gBAAgB,EAAE,uBAAuB;QACzC,QAAQ;QACR,cAAc,EAAE,CAAC;QACjB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,oBAAoB;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTargetDependency = addTargetDependency;
|
|
4
|
+
function addTargetDependency(xcodeProject, target) {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
const { objects } = xcodeProject.hash.project;
|
|
7
|
+
(_a = objects.PBXTargetDependency) !== null && _a !== void 0 ? _a : (objects.PBXTargetDependency = {});
|
|
8
|
+
(_b = objects.PBXContainerItemProxy) !== null && _b !== void 0 ? _b : (objects.PBXContainerItemProxy = {});
|
|
9
|
+
const mainTargetUuid = xcodeProject.getFirstTarget().uuid;
|
|
10
|
+
const mainTarget = xcodeProject.pbxNativeTargetSection()[mainTargetUuid];
|
|
11
|
+
(_c = mainTarget.dependencies) !== null && _c !== void 0 ? _c : (mainTarget.dependencies = []);
|
|
12
|
+
if (mainTarget.dependencies.some((dependency) => { var _a; return ((_a = objects.PBXTargetDependency[dependency.value]) === null || _a === void 0 ? void 0 : _a.target) === target.uuid; })) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
xcodeProject.addTargetDependency(mainTargetUuid, [target.uuid]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=addTargetDependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addTargetDependency.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addTargetDependency.ts"],"names":[],"mappings":";;AAEA,kDAmBC;AAnBD,SAAgB,mBAAmB,CAAC,YAA0B,EAAE,MAAwB;;IACtF,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9C,MAAA,OAAO,CAAC,mBAAmB,oCAA3B,OAAO,CAAC,mBAAmB,GAAK,EAAE,EAAC;IACnC,MAAA,OAAO,CAAC,qBAAqB,oCAA7B,OAAO,CAAC,qBAAqB,GAAK,EAAE,EAAC;IAErC,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC;IAC1D,MAAM,UAAU,GAAG,YAAY,CAAC,sBAAsB,EAAE,CAAC,cAAc,CAAC,CAAC;IACzE,MAAA,UAAU,CAAC,YAAY,oCAAvB,UAAU,CAAC,YAAY,GAAK,EAAE,EAAC;IAE/B,IACE,UAAU,CAAC,YAAY,CAAC,IAAI,CAC1B,CAAC,UAA6B,EAAE,EAAE,WAChC,OAAA,CAAA,MAAA,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,KAAK,CAAC,0CAAE,MAAM,MAAK,MAAM,CAAC,IAAI,CAAA,EAAA,CACxE,EACD,CAAC;QACD,OAAO;IACT,CAAC;IAED,YAAY,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
export declare function addToPbxNativeTargetSection(xcodeProject: XcodeProject, { targetName, targetUuid, productFile, xCConfigurationList, }: {
|
|
3
|
+
targetName: string;
|
|
4
|
+
targetUuid: string;
|
|
5
|
+
productFile: {
|
|
6
|
+
fileRef: string;
|
|
7
|
+
};
|
|
8
|
+
xCConfigurationList: {
|
|
9
|
+
uuid: string;
|
|
10
|
+
};
|
|
11
|
+
}): {
|
|
12
|
+
uuid: any;
|
|
13
|
+
pbxNativeTarget: any;
|
|
14
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addToPbxNativeTargetSection = addToPbxNativeTargetSection;
|
|
4
|
+
function addToPbxNativeTargetSection(xcodeProject, { targetName, targetUuid, productFile, xCConfigurationList, }) {
|
|
5
|
+
const existingTargetUuid = xcodeProject.findTargetKey(targetName);
|
|
6
|
+
if (existingTargetUuid) {
|
|
7
|
+
return {
|
|
8
|
+
uuid: existingTargetUuid,
|
|
9
|
+
pbxNativeTarget: xcodeProject.pbxNativeTargetSection()[existingTargetUuid],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const target = {
|
|
13
|
+
uuid: targetUuid,
|
|
14
|
+
pbxNativeTarget: {
|
|
15
|
+
isa: 'PBXNativeTarget',
|
|
16
|
+
name: targetName,
|
|
17
|
+
productName: targetName,
|
|
18
|
+
productReference: productFile.fileRef,
|
|
19
|
+
productType: `"com.apple.product-type.app-extension"`,
|
|
20
|
+
buildConfigurationList: xCConfigurationList.uuid,
|
|
21
|
+
buildPhases: [],
|
|
22
|
+
buildRules: [],
|
|
23
|
+
dependencies: [],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
xcodeProject.addToPbxNativeTargetSection(target);
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=addToPbxNativeTargetSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addToPbxNativeTargetSection.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addToPbxNativeTargetSection.ts"],"names":[],"mappings":";;AAEA,kEAuCC;AAvCD,SAAgB,2BAA2B,CACzC,YAA0B,EAC1B,EACE,UAAU,EACV,UAAU,EACV,WAAW,EACX,mBAAmB,GAMpB;IAED,MAAM,kBAAkB,GAAG,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAClE,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO;YACL,IAAI,EAAE,kBAAkB;YACxB,eAAe,EAAE,YAAY,CAAC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC;SAC3E,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE;YACf,GAAG,EAAE,iBAAiB;YACtB,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,UAAU;YACvB,gBAAgB,EAAE,WAAW,CAAC,OAAO;YACrC,WAAW,EAAE,wCAAwC;YACrD,sBAAsB,EAAE,mBAAmB,CAAC,IAAI;YAChD,WAAW,EAAE,EAAE;YACf,UAAU,EAAE,EAAE;YACd,YAAY,EAAE,EAAE;SACjB;KACF,CAAC;IAEF,YAAY,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addToPbxProjectSection = addToPbxProjectSection;
|
|
4
|
+
function addToPbxProjectSection(xcodeProject, target) {
|
|
5
|
+
const pbxProjectSection = xcodeProject.pbxProjectSection();
|
|
6
|
+
const project = pbxProjectSection[xcodeProject.getFirstProject().uuid];
|
|
7
|
+
const targetAlreadyAdded = project.targets.some((projectTarget) => projectTarget.value === target.uuid);
|
|
8
|
+
if (targetAlreadyAdded) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
xcodeProject.addToPbxProjectSection(target);
|
|
12
|
+
// Add target attributes to project section
|
|
13
|
+
if (!project.attributes.TargetAttributes) {
|
|
14
|
+
project.attributes.TargetAttributes = {};
|
|
15
|
+
}
|
|
16
|
+
project.attributes.TargetAttributes[target.uuid] = {
|
|
17
|
+
LastSwiftMigration: 1250,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=addToPbxProjectSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addToPbxProjectSection.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addToPbxProjectSection.ts"],"names":[],"mappings":";;AAEA,wDAiBC;AAjBD,SAAgB,sBAAsB,CAAC,YAA0B,EAAE,MAAwB;IACzF,MAAM,iBAAiB,GAAG,YAAY,CAAC,iBAAiB,EAAE,CAAC;IAC3D,MAAM,OAAO,GAAG,iBAAiB,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAC7C,CAAC,aAAgC,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI,CAC1E,CAAC;IACF,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IACD,YAAY,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC5C,2CAA2C;IAC3C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACzC,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG;QACjD,kBAAkB,EAAE,IAAI;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
interface AddXCConfigurationListProps {
|
|
3
|
+
targetName: string;
|
|
4
|
+
currentProjectVersion: string;
|
|
5
|
+
bundleIdentifier: string;
|
|
6
|
+
deploymentTarget: string;
|
|
7
|
+
marketingVersion?: string;
|
|
8
|
+
appleTeamId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function addXCConfigurationList(xcodeProject: XcodeProject, props: AddXCConfigurationListProps): any;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addXCConfigurationList = addXCConfigurationList;
|
|
4
|
+
function addXCConfigurationList(xcodeProject, props) {
|
|
5
|
+
var _a;
|
|
6
|
+
const comment = `Build configuration list for PBXNativeTarget "${props.targetName}"`;
|
|
7
|
+
const commonBuildSettings = {
|
|
8
|
+
PRODUCT_NAME: `"$(TARGET_NAME)"`,
|
|
9
|
+
SWIFT_VERSION: '5.0',
|
|
10
|
+
TARGETED_DEVICE_FAMILY: `"1,2"`,
|
|
11
|
+
INFOPLIST_FILE: `${props.targetName}/Info.plist`,
|
|
12
|
+
CURRENT_PROJECT_VERSION: `"${props.currentProjectVersion}"`,
|
|
13
|
+
IPHONEOS_DEPLOYMENT_TARGET: `"${props.deploymentTarget}"`,
|
|
14
|
+
PRODUCT_BUNDLE_IDENTIFIER: `"${props.bundleIdentifier}"`,
|
|
15
|
+
GENERATE_INFOPLIST_FILE: `"YES"`,
|
|
16
|
+
INFOPLIST_KEY_CFBundleDisplayName: props.targetName,
|
|
17
|
+
INFOPLIST_KEY_NSHumanReadableCopyright: `""`,
|
|
18
|
+
MARKETING_VERSION: `"${props.marketingVersion}"`,
|
|
19
|
+
SWIFT_OPTIMIZATION_LEVEL: `"-Onone"`,
|
|
20
|
+
CODE_SIGN_ENTITLEMENTS: `"${props.targetName}/${props.targetName}.entitlements"`,
|
|
21
|
+
APPLICATION_EXTENSION_API_ONLY: '"YES"',
|
|
22
|
+
...(props.appleTeamId ? { DEVELOPMENT_TEAM: props.appleTeamId } : {}),
|
|
23
|
+
};
|
|
24
|
+
const existingConfigurationListUuid = (_a = xcodeProject.pbxTargetByName(props.targetName)) === null || _a === void 0 ? void 0 : _a.buildConfigurationList;
|
|
25
|
+
if (existingConfigurationListUuid) {
|
|
26
|
+
return {
|
|
27
|
+
uuid: existingConfigurationListUuid,
|
|
28
|
+
xcConfigurationList: xcodeProject.pbxXCConfigurationList()[existingConfigurationListUuid],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return xcodeProject.addXCConfigurationList(['Debug', 'Release'].map((name) => ({
|
|
32
|
+
name,
|
|
33
|
+
isa: 'XCBuildConfiguration',
|
|
34
|
+
buildSettings: { ...commonBuildSettings },
|
|
35
|
+
})), 'Release', comment);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=addXCConfigurationList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addXCConfigurationList.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addXCConfigurationList.ts"],"names":[],"mappings":";;AAWA,wDA2CC;AA3CD,SAAgB,sBAAsB,CACpC,YAA0B,EAC1B,KAAkC;;IAElC,MAAM,OAAO,GAAG,iDAAiD,KAAK,CAAC,UAAU,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C,EACH,SAAS,EACT,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
type TargetXcodeProjectProps = {
|
|
3
|
+
targetName: string;
|
|
4
|
+
bundleIdentifier: string;
|
|
5
|
+
deploymentTarget: string;
|
|
6
|
+
appleTeamId?: string;
|
|
7
|
+
getFileUris: () => string[];
|
|
8
|
+
};
|
|
9
|
+
declare const withTargetXcodeProject: ConfigPlugin<TargetXcodeProjectProps>;
|
|
10
|
+
export default withTargetXcodeProject;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const addBuildPhases_1 = require("./addBuildPhases");
|
|
39
|
+
const addPbxGroup_1 = require("./addPbxGroup");
|
|
40
|
+
const addProductFile_1 = require("./addProductFile");
|
|
41
|
+
const addTargetDependency_1 = require("./addTargetDependency");
|
|
42
|
+
const addToPbxNativeTargetSection_1 = require("./addToPbxNativeTargetSection");
|
|
43
|
+
const addToPbxProjectSection_1 = require("./addToPbxProjectSection");
|
|
44
|
+
const addXCConfigurationList_1 = require("./addXCConfigurationList");
|
|
45
|
+
const withTargetXcodeProject = (config, { targetName, bundleIdentifier, deploymentTarget, appleTeamId, getFileUris }) => (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
46
|
+
const xcodeProject = config.modResults;
|
|
47
|
+
const targetUuid = xcodeProject.generateUuid();
|
|
48
|
+
const groupName = 'Embed Foundation Extensions';
|
|
49
|
+
const xCConfigurationList = (0, addXCConfigurationList_1.addXCConfigurationList)(xcodeProject, {
|
|
50
|
+
targetName,
|
|
51
|
+
bundleIdentifier,
|
|
52
|
+
deploymentTarget,
|
|
53
|
+
appleTeamId,
|
|
54
|
+
marketingVersion: '1.0',
|
|
55
|
+
currentProjectVersion: '1',
|
|
56
|
+
});
|
|
57
|
+
const productFile = (0, addProductFile_1.addProductFile)(xcodeProject, {
|
|
58
|
+
targetName,
|
|
59
|
+
groupName,
|
|
60
|
+
});
|
|
61
|
+
const target = (0, addToPbxNativeTargetSection_1.addToPbxNativeTargetSection)(xcodeProject, {
|
|
62
|
+
targetName,
|
|
63
|
+
targetUuid,
|
|
64
|
+
productFile,
|
|
65
|
+
xCConfigurationList,
|
|
66
|
+
});
|
|
67
|
+
(0, addToPbxProjectSection_1.addToPbxProjectSection)(xcodeProject, target);
|
|
68
|
+
(0, addTargetDependency_1.addTargetDependency)(xcodeProject, target);
|
|
69
|
+
const projectRoot = config.modRequest.platformProjectRoot;
|
|
70
|
+
const targetDirectory = path.join(projectRoot, targetName);
|
|
71
|
+
const relativePaths = getFileUris().map((file) => path.relative(targetDirectory, file));
|
|
72
|
+
const swiftWidgetFiles = relativePaths.filter((file) => file.endsWith('.swift'));
|
|
73
|
+
(0, addBuildPhases_1.addBuildPhases)(xcodeProject, {
|
|
74
|
+
targetUuid: target.uuid,
|
|
75
|
+
groupName,
|
|
76
|
+
productFile,
|
|
77
|
+
widgetFiles: swiftWidgetFiles,
|
|
78
|
+
});
|
|
79
|
+
(0, addPbxGroup_1.addPbxGroup)(xcodeProject, {
|
|
80
|
+
targetName,
|
|
81
|
+
widgetFiles: relativePaths,
|
|
82
|
+
});
|
|
83
|
+
return config;
|
|
84
|
+
});
|
|
85
|
+
exports.default = withTargetXcodeProject;
|
|
86
|
+
//# sourceMappingURL=withTargetXcodeProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTargetXcodeProject.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/withTargetXcodeProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAsE;AACtE,2CAA6B;AAE7B,qDAAkD;AAClD,+CAA4C;AAC5C,qDAAkD;AAClD,+DAA4D;AAC5D,+EAA4E;AAC5E,qEAAkE;AAClE,qEAAkE;AAUlE,MAAM,sBAAsB,GAA0C,CACpE,MAAM,EACN,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW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AAI;QACvB,SAAS;QACT,WAAW;QACX,WAAW,EAAE,gBAAgB;KAC9B,CAAC,CAAC;IAEH,IAAA,yBAAW,EAAC,YAAY,EAAE;QACxB,UAAU;QACV,WAAW,EAAE,aAAa;KAC3B,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC;AAEL,kBAAe,sBAAsB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
import type { IntentDefinition, AppEntityDefinition, FocusFilterDefinition, AppClipDefinition } from '../../src/types';
|
|
3
|
+
import type { WidgetConfig } from '../types/WidgetConfig.type';
|
|
3
4
|
interface IOSInvokeOptions {
|
|
4
5
|
intents: IntentDefinition[];
|
|
5
6
|
voiceUsageDescription?: string;
|
|
@@ -11,32 +12,22 @@ interface IOSInvokeOptions {
|
|
|
11
12
|
pttUsageDescription?: string;
|
|
12
13
|
enableLiveActivities?: boolean;
|
|
13
14
|
liveActivityTypes?: string[];
|
|
14
|
-
|
|
15
|
+
widgets?: WidgetConfig[];
|
|
16
|
+
widgetBundleIdentifier?: string;
|
|
17
|
+
widgetGroupIdentifier?: string;
|
|
18
|
+
enablePushNotificationsForWidgets?: boolean;
|
|
19
|
+
frequentWidgetUpdates?: boolean;
|
|
15
20
|
enableWidget?: boolean;
|
|
16
|
-
/** Display name shown in the widget picker (defaults to app name) */
|
|
17
21
|
widgetTitle?: string;
|
|
18
|
-
/** Description shown in the widget picker */
|
|
19
22
|
widgetDescription?: string;
|
|
20
|
-
/**
|
|
21
|
-
* UserDefaults key the app writes widget data to via setWidgetData().
|
|
22
|
-
* Defaults to "invokeWidgetData".
|
|
23
|
-
*/
|
|
24
23
|
widgetDataKey?: string;
|
|
25
|
-
/** Hex accent colour for the widget UI (defaults to "#267AD9") */
|
|
26
24
|
widgetAccentColor?: string;
|
|
27
|
-
/** Hex background colour for all widget sizes (defaults to "#E6F4FF") */
|
|
28
25
|
widgetBgColor?: string;
|
|
29
|
-
/** SF Symbol name used as the main widget icon (defaults to "square.grid.2x2.fill") */
|
|
30
26
|
widgetIcon?: string;
|
|
31
|
-
/** SF Symbol name used on detail rows, e.g. carrier/assignee (defaults to "person.fill") */
|
|
32
27
|
widgetDetailIcon?: string;
|
|
33
|
-
/** Text shown in the large widget empty state (defaults to "Nothing here yet") */
|
|
34
28
|
widgetEmptyText?: string;
|
|
35
|
-
/** How often in minutes the widget timeline refreshes (defaults to 15) */
|
|
36
29
|
widgetRefreshMinutes?: number;
|
|
37
|
-
/** URL scheme deep-link opened when widget is tapped */
|
|
38
30
|
widgetDeepLink?: string;
|
|
39
|
-
/** Widget sizes to support (defaults to ["small","medium"]) */
|
|
40
31
|
widgetSizes?: ('small' | 'medium' | 'large')[];
|
|
41
32
|
}
|
|
42
33
|
export declare const withIOSInvoke: ConfigPlugin<IOSInvokeOptions>;
|
|
@@ -32,6 +32,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
39
|
exports.withIOSInvoke = void 0;
|
|
37
40
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
@@ -41,10 +44,23 @@ const generateSwiftIntents_1 = require("../codegen/generateSwiftIntents");
|
|
|
41
44
|
const generateSwiftEntities_1 = require("../codegen/generateSwiftEntities");
|
|
42
45
|
const generateSwiftFocusFilters_1 = require("../codegen/generateSwiftFocusFilters");
|
|
43
46
|
const generateSwiftAppClip_1 = require("../codegen/generateSwiftAppClip");
|
|
47
|
+
const generateSwiftLiveActivities_1 = require("../codegen/generateSwiftLiveActivities");
|
|
44
48
|
const withWidgetExtension_1 = require("./withWidgetExtension");
|
|
49
|
+
const withIosWidgets_1 = __importDefault(require("./widgets/withIosWidgets"));
|
|
45
50
|
const withIOSInvoke = (config, options) => {
|
|
46
51
|
var _a, _b, _c;
|
|
47
|
-
const { intents, voiceUsageDescription, appGroupId, entities = [], focusFilters = [], appClips = [], enablePushToTalk = false, pttUsageDescription, enableLiveActivities = false,
|
|
52
|
+
const { intents, voiceUsageDescription, appGroupId, entities = [], focusFilters = [], appClips = [], enablePushToTalk = false, pttUsageDescription, enableLiveActivities = false, liveActivityTypes = [],
|
|
53
|
+
// New widget options
|
|
54
|
+
widgets, widgetBundleIdentifier, widgetGroupIdentifier, enablePushNotificationsForWidgets = false, frequentWidgetUpdates = false,
|
|
55
|
+
// Legacy widget options
|
|
56
|
+
enableWidget = false, widgetTitle, widgetDescription = 'Quick access from your home screen.', widgetDataKey = 'invokeWidgetData', widgetAccentColor = '#267AD9', widgetBgColor = '#E6F4FF', widgetIcon = 'square.grid.2x2.fill', widgetDetailIcon = 'person.fill', widgetEmptyText = 'Nothing here yet', widgetRefreshMinutes = 15, widgetDeepLink = '', widgetSizes = ['small', 'medium'], } = options;
|
|
57
|
+
// Warn about features that are accepted in config but not fully implemented.
|
|
58
|
+
if (enablePushToTalk) {
|
|
59
|
+
console.warn('[expo-invoke] enablePushToTalk: true — the PushToTalk framework integration is currently ' +
|
|
60
|
+
'a simulation (emits synthetic intents). Real PTT requires PTTChannelManager setup and the ' +
|
|
61
|
+
'PushToTalk entitlement in your provisioning profile. The usePushToTalk() hook tracks state ' +
|
|
62
|
+
'locally and works for UI purposes, but audio transmission is not handled by expo-invoke.');
|
|
63
|
+
}
|
|
48
64
|
// 1. Info.plist usage descriptions + feature flags
|
|
49
65
|
config = (0, config_plugins_1.withInfoPlist)(config, (cfg) => {
|
|
50
66
|
var _a;
|
|
@@ -127,33 +143,46 @@ const withIOSInvoke = (config, options) => {
|
|
|
127
143
|
const clipCode = (0, generateSwiftAppClip_1.generateSwiftAppClip)(appClips);
|
|
128
144
|
if (clipCode)
|
|
129
145
|
writeSwift('InvokeAppClip.swift', clipCode);
|
|
146
|
+
// InvokeLiveActivities.swift — ActivityKit-backed LiveActivityRegistry + ExpoInvokeActivityAttributes
|
|
147
|
+
// Generated when enableLiveActivities: true so the legacy useLiveActivity() API actually works.
|
|
148
|
+
if (enableLiveActivities) {
|
|
149
|
+
writeSwift('InvokeLiveActivities.swift', (0, generateSwiftLiveActivities_1.generateSwiftLiveActivities)(liveActivityTypes));
|
|
150
|
+
}
|
|
130
151
|
return cfg;
|
|
131
152
|
},
|
|
132
153
|
]);
|
|
133
|
-
// 4. Widget
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
// 4. Widget & Live Activity Extension
|
|
155
|
+
const hasNewStyleWidgets = widgets && widgets.length > 0;
|
|
156
|
+
if (hasNewStyleWidgets) {
|
|
157
|
+
// New path: use the battle-tested expo-widgets-derived plugin (now built into expo-invoke).
|
|
158
|
+
// Handles Xcode target creation, proper Podfile linking (expo_widgets_post_install),
|
|
159
|
+
// EAS appExtensions registration, app group entitlements, and push notification entitlements.
|
|
160
|
+
config = (0, withIosWidgets_1.default)(config, {
|
|
161
|
+
bundleIdentifier: widgetBundleIdentifier,
|
|
162
|
+
groupIdentifier: widgetGroupIdentifier !== null && widgetGroupIdentifier !== void 0 ? widgetGroupIdentifier : appGroupId,
|
|
163
|
+
enablePushNotifications: enablePushNotificationsForWidgets,
|
|
164
|
+
frequentUpdates: frequentWidgetUpdates,
|
|
165
|
+
widgets: widgets,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
else if (enableWidget && appGroupId) {
|
|
169
|
+
// Legacy deprecated path — still functional but logs a deprecation warning.
|
|
170
|
+
const bundleIdentifier = ((_b = (_a = config.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier) !== null && _b !== void 0 ? _b : 'com.example.app') + '.InvokeWidget';
|
|
171
|
+
config = (0, withWidgetExtension_1.withWidgetExtension)(config, {
|
|
172
|
+
appGroupId,
|
|
173
|
+
bundleId: bundleIdentifier,
|
|
174
|
+
widgetTitle: widgetTitle !== null && widgetTitle !== void 0 ? widgetTitle : ((_c = config.name) !== null && _c !== void 0 ? _c : 'My App'),
|
|
175
|
+
widgetDescription,
|
|
176
|
+
widgetDataKey,
|
|
177
|
+
widgetAccentColor,
|
|
178
|
+
widgetBgColor,
|
|
179
|
+
widgetIcon,
|
|
180
|
+
widgetDetailIcon,
|
|
181
|
+
widgetEmptyText,
|
|
182
|
+
widgetRefreshMinutes,
|
|
183
|
+
widgetDeepLink,
|
|
184
|
+
widgetSizes,
|
|
185
|
+
});
|
|
157
186
|
}
|
|
158
187
|
return config;
|
|
159
188
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIOSInvoke.js","sourceRoot":"","sources":["../../../plugin/ios/withIOSInvoke.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withIOSInvoke.js","sourceRoot":"","sources":["../../../plugin/ios/withIOSInvoke.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAK8B;AAC9B,uCAAyB;AACzB,2CAA6B;AAC7B,0EAAuE;AACvE,4EAAyE;AACzE,oFAAiF;AACjF,0EAAuE;AACvE,wFAAqF;AACrF,+DAA4D;AAC5D,8EAAsD;AAyC/C,MAAM,aAAa,GAAmC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;;IAC/E,MAAM,EACJ,OAAO,EACP,qBAAqB,EACrB,UAAU,EACV,QAAQ,GAAG,EAAE,EACb,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,EAAE,EACb,gBAAg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Q,EAAE,gBAAgB;YAC1B,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,CAAC,MAAA,MAAM,CAAC,IAAI,mCAAI,QAAQ,CAAC;YACrD,iBAAiB;YACjB,aAAa;YACb,iBAAiB;YACjB,aAAa;YACb,UAAU;YACV,gBAAgB;YAChB,eAAe;YACf,oBAAoB;YACpB,cAAc;YACd,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAtLW,QAAA,aAAa,iBAsLxB"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated This module is superseded by the `widgets` array option which uses
|
|
3
|
+
* createWidget()/createLiveActivity() React components with the built-in widget engine.
|
|
4
|
+
* Kept for backwards compatibility with `enableWidget: true`. Will be removed in v3.
|
|
5
|
+
*/
|
|
1
6
|
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
7
|
import { type WidgetCodegenOptions } from '../codegen/generateSwiftWidget';
|
|
3
8
|
export interface WidgetExtensionOptions extends WidgetCodegenOptions {
|
|
@@ -34,6 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.withWidgetExtension = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated This module is superseded by the `widgets` array option which uses
|
|
39
|
+
* createWidget()/createLiveActivity() React components with the built-in widget engine.
|
|
40
|
+
* Kept for backwards compatibility with `enableWidget: true`. Will be removed in v3.
|
|
41
|
+
*/
|
|
37
42
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
38
43
|
const fs = __importStar(require("fs"));
|
|
39
44
|
const path = __importStar(require("path"));
|
|
@@ -126,18 +131,43 @@ const withWidgetExtension = (config, opts) => {
|
|
|
126
131
|
// Xcode 14 signs resource bundles by default. Extension targets like
|
|
127
132
|
// InvokeWidget pull in pods that create resource bundles; without a team
|
|
128
133
|
// set on each one the build fails with XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR.
|
|
129
|
-
//
|
|
134
|
+
// Must be placed AFTER react_native_post_install() which can reset build settings.
|
|
135
|
+
// Uses pods_project.targets with product_type check — works in all CocoaPods versions.
|
|
130
136
|
if (!podfile.includes('expo-invoke: resource bundle code signing')) {
|
|
131
137
|
const rbFix = `\n # expo-invoke: resource bundle code signing (Xcode 14+)\n` +
|
|
132
|
-
` installer.
|
|
133
|
-
` .
|
|
134
|
-
`
|
|
135
|
-
` resource_bundle_target.build_configurations.each do |config|\n` +
|
|
138
|
+
` installer.pods_project.targets.each do |target|\n` +
|
|
139
|
+
` if target.respond_to?(:product_type) && target.product_type == "com.apple.product-type.bundle"\n` +
|
|
140
|
+
` target.build_configurations.each do |config|\n` +
|
|
136
141
|
` config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n` +
|
|
137
142
|
` end\n` +
|
|
138
143
|
` end\n` +
|
|
139
144
|
` end`;
|
|
140
|
-
|
|
145
|
+
// Insert AFTER the closing ) of react_native_post_install(...) so it runs
|
|
146
|
+
// after that function, which may otherwise reset CODE_SIGNING_ALLOWED.
|
|
147
|
+
const rnCallMarker = 'react_native_post_install(';
|
|
148
|
+
const rnCallIdx = podfile.indexOf(rnCallMarker);
|
|
149
|
+
if (rnCallIdx !== -1) {
|
|
150
|
+
// Walk forward from the opening ( counting depth to find the matching )
|
|
151
|
+
let depth = 0;
|
|
152
|
+
let closeIdx = -1;
|
|
153
|
+
for (let i = podfile.indexOf('(', rnCallIdx); i < podfile.length; i++) {
|
|
154
|
+
if (podfile[i] === '(')
|
|
155
|
+
depth++;
|
|
156
|
+
else if (podfile[i] === ')') {
|
|
157
|
+
depth--;
|
|
158
|
+
if (depth === 0) {
|
|
159
|
+
closeIdx = i;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (closeIdx !== -1) {
|
|
165
|
+
podfile = podfile.slice(0, closeIdx + 1) + rbFix + podfile.slice(closeIdx + 1);
|
|
166
|
+
console.log('[expo-invoke] Added resource bundle code signing fix after react_native_post_install');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else if (podfile.includes('post_install do |installer|')) {
|
|
170
|
+
// Fallback: no react_native_post_install found, insert at top of block
|
|
141
171
|
podfile = podfile.replace('post_install do |installer|', `post_install do |installer|${rbFix}`);
|
|
142
172
|
console.log('[expo-invoke] Added resource bundle code signing fix to post_install hook');
|
|
143
173
|
}
|