react-native-acoustic-connect-beta 18.0.35 → 18.0.37

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.
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+ // Copyright (C) 2026 Acoustic, L.P. All rights reserved.
3
+ //
4
+ // NOTICE: This file contains material that is confidential and proprietary to
5
+ // Acoustic, L.P. and/or other developers. No license is granted under any
6
+ // intellectual or industrial property rights of Acoustic, L.P. except as may
7
+ // be provided in an agreement with Acoustic, L.P. Any unauthorized copying or
8
+ // distribution of content from this file is prohibited.
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || function (mod) {
26
+ if (mod && mod.__esModule) return mod;
27
+ var result = {};
28
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
+ __setModuleDefault(result, mod);
30
+ return result;
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.withConnectNCE = exports.withNCEPodfile = exports.withNCEXcodeProject = exports.injectPodfileBlock = exports.buildPodfileBlock = exports.buildNCEEntitlements = exports.buildNCEInfoPlist = void 0;
34
+ const config_plugins_1 = require("@expo/config-plugins");
35
+ const fs = __importStar(require("fs"));
36
+ const path = __importStar(require("path"));
37
+ const withConnectNSE_1 = require("./withConnectNSE");
38
+ // ─── Target / config constants ─────────────────────────────────────────────
39
+ const NSE_TARGET_NAME = 'ConnectNSE';
40
+ const NCE_TARGET_NAME = 'ConnectNCE';
41
+ // Configs belonging to either extension target must be skipped when mirroring
42
+ // host build settings. The NCE mod runs AFTER the NSE mod in the composition,
43
+ // so by the time this executes the pbxproj already carries ConnectNSE configs;
44
+ // without skipping both, the NCE could mirror the NSE target's settings rather
45
+ // than the host app's.
46
+ const EXTENSION_TARGET_NAMES = [NSE_TARGET_NAME, NCE_TARGET_NAME];
47
+ // ─── Plist helpers ────────────────────────────────────────────────────────────
48
+ /**
49
+ * Generates the Info.plist content for the ConnectNCE target.
50
+ *
51
+ * The NSExtensionAttributes mirror the canonical bare-workflow reference
52
+ * (Examples/bare-workflow/ios/ConnectNCE/Info.plist), which itself mirrors the
53
+ * iOS-SDK NCE 1:1:
54
+ * - UNNotificationExtensionCategory: the category identifiers the Connect
55
+ * APNs payload routes rich-media notifications through. Must match the
56
+ * category the SDK/Collector sets — keep in sync with the iOS-SDK NCE.
57
+ * - UNNotificationExtensionDefaultContentHidden=false: keep the default
58
+ * system body alongside the custom content view.
59
+ * - UNNotificationExtensionInitialContentSizeRatio=1.0: start full-height;
60
+ * the SDK content controller resizes to fit the rendered media.
61
+ *
62
+ * RCTNewArchEnabled is intentionally omitted: the NCE links the Connect SDK
63
+ * only — no React Native runtime is present in the extension process. (The
64
+ * bare-workflow reference carries it as an Xcode-template leftover; the
65
+ * plugin-generated target drops it, consistent with the NSE template.)
66
+ */
67
+ function buildNCEInfoPlist() {
68
+ return `<?xml version="1.0" encoding="UTF-8"?>
69
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
70
+ <plist version="1.0">
71
+ <dict>
72
+ \t<key>CFBundleDevelopmentRegion</key>
73
+ \t<string>$(DEVELOPMENT_LANGUAGE)</string>
74
+ \t<key>CFBundleDisplayName</key>
75
+ \t<string>ConnectNCE</string>
76
+ \t<key>CFBundleExecutable</key>
77
+ \t<string>$(EXECUTABLE_NAME)</string>
78
+ \t<key>CFBundleIdentifier</key>
79
+ \t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
80
+ \t<key>CFBundleInfoDictionaryVersion</key>
81
+ \t<string>6.0</string>
82
+ \t<key>CFBundleName</key>
83
+ \t<string>$(PRODUCT_NAME)</string>
84
+ \t<key>CFBundlePackageType</key>
85
+ \t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
86
+ \t<key>CFBundleShortVersionString</key>
87
+ \t<string>$(MARKETING_VERSION)</string>
88
+ \t<key>CFBundleVersion</key>
89
+ \t<string>$(CURRENT_PROJECT_VERSION)</string>
90
+ \t<key>NSExtension</key>
91
+ \t<dict>
92
+ \t\t<key>NSExtensionAttributes</key>
93
+ \t\t<dict>
94
+ \t\t\t<key>UNNotificationExtensionCategory</key>
95
+ \t\t\t<array>
96
+ \t\t\t\t<string>ACOUSTIC_RICH_NOTIFICATION</string>
97
+ \t\t\t\t<string>ACTIONABLE_NOTIFICATION</string>
98
+ \t\t\t</array>
99
+ \t\t\t<key>UNNotificationExtensionDefaultContentHidden</key>
100
+ \t\t\t<false/>
101
+ \t\t\t<key>UNNotificationExtensionInitialContentSizeRatio</key>
102
+ \t\t\t<real>1.0</real>
103
+ \t\t</dict>
104
+ \t\t<key>NSExtensionPointIdentifier</key>
105
+ \t\t<string>com.apple.usernotifications.content-extension</string>
106
+ \t\t<key>NSExtensionPrincipalClass</key>
107
+ \t\t<string>$(PRODUCT_MODULE_NAME).NotificationViewController</string>
108
+ \t</dict>
109
+ </dict>
110
+ </plist>
111
+ `;
112
+ }
113
+ exports.buildNCEInfoPlist = buildNCEInfoPlist;
114
+ /** Generates the entitlements plist content for the ConnectNCE target. */
115
+ function buildNCEEntitlements(appGroupIdentifier) {
116
+ return `<?xml version="1.0" encoding="UTF-8"?>
117
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
118
+ <plist version="1.0">
119
+ <dict>
120
+ \t<key>com.apple.security.application-groups</key>
121
+ \t<array>
122
+ \t\t<string>${appGroupIdentifier}</string>
123
+ \t</array>
124
+ </dict>
125
+ </plist>
126
+ `;
127
+ }
128
+ exports.buildNCEEntitlements = buildNCEEntitlements;
129
+ // ─── Podfile injection ────────────────────────────────────────────────────────
130
+ const PODFILE_MARKER = '# @generated ConnectNCE target (react-native-acoustic-connect-beta)';
131
+ /**
132
+ * Returns the Ruby snippet to inject into the Expo-generated Podfile for the
133
+ * ConnectNCE target. Thin wrapper over the shared
134
+ * {@link buildConnectPodTargetBlock} (single source of truth for the
135
+ * AcousticConnect pod-resolution helper), parameterised with the NCE marker,
136
+ * helper name, and target name.
137
+ */
138
+ function buildPodfileBlock() {
139
+ return (0, withConnectNSE_1.buildConnectPodTargetBlock)(PODFILE_MARKER, 'acoustic_connect_pod_nce', NCE_TARGET_NAME);
140
+ }
141
+ exports.buildPodfileBlock = buildPodfileBlock;
142
+ /**
143
+ * Injects the ConnectNCE Podfile block into `podfileContent` if not already
144
+ * present (idempotent, guarded by PODFILE_MARKER).
145
+ */
146
+ function injectPodfileBlock(podfileContent) {
147
+ if (podfileContent.includes(PODFILE_MARKER)) {
148
+ return podfileContent;
149
+ }
150
+ return podfileContent + buildPodfileBlock();
151
+ }
152
+ exports.injectPodfileBlock = injectPodfileBlock;
153
+ // ─── Xcode project mod ───────────────────────────────────────────────────────
154
+ /**
155
+ * Adds the ConnectNCE Xcode target (app_extension) to the project.
156
+ *
157
+ * Sibling to withNSEXcodeProject; the only differences are the target name,
158
+ * the Swift source file (NotificationViewController.swift), the NCE Info.plist
159
+ * (content-extension NSExtension keys), and skipping BOTH extension targets'
160
+ * configs when mirroring host build settings.
161
+ *
162
+ * Idempotent: if a target named ConnectNCE already exists, skips target
163
+ * creation but still (re)writes the source files.
164
+ */
165
+ function withNCEXcodeProject(config, appGroupIdentifier, swiftContent) {
166
+ return (0, config_plugins_1.withXcodeProject)(config, (c) => {
167
+ var _a, _b, _c, _d;
168
+ const xcodeProject = c.modResults;
169
+ // ios/ directory — modRequest.platformProjectRoot is the canonical
170
+ // native project root. (xcodeProject.filepath points INSIDE the
171
+ // .xcodeproj bundle, so deriving from it misplaces the files.)
172
+ const iosDir = c.modRequest.platformProjectRoot;
173
+ const nceDir = path.join(iosDir, NCE_TARGET_NAME);
174
+ // Always write / overwrite the source files (idempotent)
175
+ fs.mkdirSync(nceDir, { recursive: true });
176
+ fs.writeFileSync(path.join(nceDir, 'NotificationViewController.swift'), swiftContent, 'utf8');
177
+ fs.writeFileSync(path.join(nceDir, 'Info.plist'), buildNCEInfoPlist(), 'utf8');
178
+ fs.writeFileSync(path.join(nceDir, `${NCE_TARGET_NAME}.entitlements`), buildNCEEntitlements(appGroupIdentifier), 'utf8');
179
+ // Idempotency check — skip if target already registered in the pbxproj.
180
+ // Note: pbxTargetByName misses targets on a REPARSED project because the
181
+ // xcode lib stores written names with literal quotes ('"ConnectNCE"'),
182
+ // so compare quote-stripped names across the native-target section.
183
+ const nativeTargets = xcodeProject.pbxNativeTargetSection();
184
+ const targetExists = Object.values(nativeTargets).some((t) => typeof t === 'object' &&
185
+ typeof t.name === 'string' &&
186
+ t.name.replace(/"/g, '') === NCE_TARGET_NAME);
187
+ if (targetExists) {
188
+ return c;
189
+ }
190
+ // Derive the host bundle id — the NCE bundle id must be
191
+ // `<hostBundleId>.ConnectNCE`. Fail fast rather than emit a placeholder
192
+ // (a wrong bundle id breaks App Group pairing and App Store submission).
193
+ const hostBundleId = (_a = c.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier;
194
+ if (!hostBundleId) {
195
+ throw new Error(`[react-native-acoustic-connect-beta] ios.bundleIdentifier is not set.\n\n` +
196
+ `The ConnectNCE extension bundle id is derived as ` +
197
+ `"<ios.bundleIdentifier>.ConnectNCE", so the host bundle id must be ` +
198
+ `defined in app.json before prebuild:\n` +
199
+ ` { "expo": { "ios": { "bundleIdentifier": "com.example.app" } } }`);
200
+ }
201
+ // Add the native target (app_extension)
202
+ const nceTarget = xcodeProject.addTarget(NCE_TARGET_NAME, 'app_extension', NCE_TARGET_NAME, `${hostBundleId}.ConnectNCE`);
203
+ if (!nceTarget) {
204
+ throw new Error(`[react-native-acoustic-connect-beta] Failed to add ConnectNCE Xcode target.`);
205
+ }
206
+ // Add the build phase for Swift sources
207
+ xcodeProject.addBuildPhase(['NotificationViewController.swift'], 'PBXSourcesBuildPhase', 'Sources', nceTarget.uuid);
208
+ // Add Resources build phase (empty, but required by Xcode)
209
+ xcodeProject.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', nceTarget.uuid);
210
+ // Add the Frameworks build phase, then explicitly link the two
211
+ // user-notifications system frameworks into the NCE target.
212
+ //
213
+ // The NCE principal class conforms to `UNNotificationContentExtension`,
214
+ // whose extension-point context class
215
+ // (`_UNNotificationContentExtensionVendorContext`) is vended by
216
+ // UserNotificationsUI.framework, and whose `didReceive(_:)` consumes
217
+ // `UNNotification` / `UNNotificationContent` from UserNotifications.framework.
218
+ // Without these explicit links the extension binary never loads them, so on
219
+ // a PHYSICAL DEVICE iOS logs "Unable to find NSExtensionContextClass … did
220
+ // you link the framework that declares the extension point?" and never calls
221
+ // `didReceive(_:)`. The custom expanded view (rich-media `expandedImage`)
222
+ // then silently never renders, while the NSE-produced thumbnail still shows.
223
+ // The iOS Simulator resolves these classes implicitly, masking the omission —
224
+ // so this only surfaces on device. Both are Apple SYSTEM frameworks, so
225
+ // CocoaPods does NOT add them; they must be linked here, mirroring the
226
+ // canonical Examples/bare-workflow ConnectNCE target (which also lists the
227
+ // auto-linked Foundation/UIKit — omitted here as Swift links them implicitly).
228
+ xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', nceTarget.uuid);
229
+ xcodeProject.addFramework('System/Library/Frameworks/UserNotifications.framework', { target: nceTarget.uuid });
230
+ xcodeProject.addFramework('System/Library/Frameworks/UserNotificationsUI.framework', { target: nceTarget.uuid });
231
+ // Make the host app target depend on ConnectNCE. CocoaPods resolves an
232
+ // extension's host target through PBXTargetDependency
233
+ // (xcodeproj's host_targets_for_embedded_target), NOT through the embed
234
+ // copy phase — without this edge `pod install` fails with "Unable to find
235
+ // host target(s) for ConnectNCE".
236
+ // The xcode lib SILENTLY no-ops addTargetDependency when these sections
237
+ // are absent from the parsed project — create them first. (The NSE mod
238
+ // already creates them when it runs before this; guarding here keeps the
239
+ // NCE mod correct if it ever runs first.)
240
+ const objects = xcodeProject.hash.project.objects;
241
+ objects['PBXTargetDependency'] = (_b = objects['PBXTargetDependency']) !== null && _b !== void 0 ? _b : {};
242
+ objects['PBXContainerItemProxy'] = (_c = objects['PBXContainerItemProxy']) !== null && _c !== void 0 ? _c : {};
243
+ const hostTargetUuid = xcodeProject.getFirstTarget().uuid;
244
+ xcodeProject.addTargetDependency(hostTargetUuid, [nceTarget.uuid]);
245
+ // Create a PBXGroup for ConnectNCE source files
246
+ const nceGroup = xcodeProject.addPbxGroup([
247
+ 'NotificationViewController.swift',
248
+ 'Info.plist',
249
+ `${NCE_TARGET_NAME}.entitlements`,
250
+ ], NCE_TARGET_NAME, NCE_TARGET_NAME);
251
+ // Add the group to the main project group
252
+ const mainGroup = xcodeProject.getFirstProject().firstProject.mainGroup;
253
+ xcodeProject.addToPbxGroup(nceGroup.uuid, mainGroup);
254
+ // Set per-configuration build settings — mirror each host configuration
255
+ // individually so Debug gets Debug values and Release gets Release values.
256
+ const buildConfigurations = xcodeProject.pbxXCConfigurationList();
257
+ const nceConfigListUuid = nceTarget.pbxNativeTarget.buildConfigurationList;
258
+ if (nceConfigListUuid) {
259
+ const configList = buildConfigurations[nceConfigListUuid];
260
+ if (configList &&
261
+ Array.isArray(configList
262
+ .buildConfigurations)) {
263
+ const configs = xcodeProject.pbxXCBuildConfigurationSection();
264
+ for (const entry of configList.buildConfigurations) {
265
+ const buildConfig = configs[entry.value];
266
+ if (buildConfig && buildConfig.buildSettings) {
267
+ // Determine which host config name to mirror (Debug → Debug, etc.)
268
+ const configName = (_d = buildConfig.name) !== null && _d !== void 0 ? _d : 'Debug';
269
+ // Mirror per-configuration values; fall back to the other config's
270
+ // value only when the matching one is absent. Skip BOTH extension
271
+ // targets so the NCE never mirrors the NSE target's settings.
272
+ const deploymentTarget = (0, withConnectNSE_1.getHostBuildSettingForConfig)(xcodeProject, 'IPHONEOS_DEPLOYMENT_TARGET', configName,
273
+ // Matches the AcousticConnect podspec floor (iOS >= 15.1) so the
274
+ // NCE never demands a higher minimum than the host app.
275
+ '15.1', EXTENSION_TARGET_NAMES);
276
+ const swiftVersion = (0, withConnectNSE_1.getHostBuildSettingForConfig)(xcodeProject, 'SWIFT_VERSION', configName, '5.0', EXTENSION_TARGET_NAMES);
277
+ const marketingVersion = (0, withConnectNSE_1.getHostBuildSettingForConfig)(xcodeProject, 'MARKETING_VERSION', configName, '1.0', EXTENSION_TARGET_NAMES);
278
+ const currentProjectVersion = (0, withConnectNSE_1.getHostBuildSettingForConfig)(xcodeProject, 'CURRENT_PROJECT_VERSION', configName, '1', EXTENSION_TARGET_NAMES);
279
+ Object.assign(buildConfig.buildSettings, {
280
+ // Prevent Xcode from synthesising a second Info.plist that would
281
+ // shadow the NSExtension dictionary in ours.
282
+ GENERATE_INFOPLIST_FILE: 'NO',
283
+ INFOPLIST_FILE: `${NCE_TARGET_NAME}/Info.plist`,
284
+ // Extension must target the device SDK and restrict to
285
+ // extension-safe APIs (mirrors bare-workflow reference target).
286
+ SDKROOT: 'iphoneos',
287
+ APPLICATION_EXTENSION_API_ONLY: 'YES',
288
+ IPHONEOS_DEPLOYMENT_TARGET: deploymentTarget,
289
+ SWIFT_VERSION: swiftVersion,
290
+ MARKETING_VERSION: marketingVersion,
291
+ CURRENT_PROJECT_VERSION: currentProjectVersion,
292
+ CODE_SIGN_ENTITLEMENTS: `${NCE_TARGET_NAME}/${NCE_TARGET_NAME}.entitlements`,
293
+ PRODUCT_NAME: NCE_TARGET_NAME,
294
+ PRODUCT_BUNDLE_IDENTIFIER: `${hostBundleId}.ConnectNCE`,
295
+ TARGETED_DEVICE_FAMILY: '"1,2"',
296
+ CODE_SIGN_STYLE: 'Automatic',
297
+ });
298
+ }
299
+ }
300
+ }
301
+ }
302
+ return c;
303
+ });
304
+ }
305
+ exports.withNCEXcodeProject = withNCEXcodeProject;
306
+ // ─── Podfile mod ─────────────────────────────────────────────────────────────
307
+ /**
308
+ * Injects the ConnectNCE Podfile target block via withDangerousMod.
309
+ * Guarded by a marker comment — re-runs are no-ops.
310
+ *
311
+ * Throws a clear, actionable error when the Podfile does not exist at
312
+ * mod-execution time, instead of silently returning — a silent skip would
313
+ * ship an NCE whose `import Connect` cannot resolve.
314
+ */
315
+ function withNCEPodfile(config) {
316
+ return (0, config_plugins_1.withDangerousMod)(config, [
317
+ 'ios',
318
+ async (c) => {
319
+ const podfilePath = path.join(c.modRequest.platformProjectRoot, 'Podfile');
320
+ if (!fs.existsSync(podfilePath)) {
321
+ throw new Error(`[react-native-acoustic-connect-beta] ios/Podfile not found at ${podfilePath}.\n\n` +
322
+ `This mod runs after prebuild generates the ios/ directory. ` +
323
+ `If you are running this plugin outside of \`expo prebuild\`, ` +
324
+ `ensure the Podfile exists before the dangerous mod phase executes.\n` +
325
+ `Check prebuild ordering: withDangerousMod('ios') runs after ` +
326
+ `withXcodeProject, so the ios/ directory should already be present.`);
327
+ }
328
+ const current = fs.readFileSync(podfilePath, 'utf8');
329
+ const updated = injectPodfileBlock(current);
330
+ if (updated !== current) {
331
+ fs.writeFileSync(podfilePath, updated, 'utf8');
332
+ }
333
+ return c;
334
+ },
335
+ ]);
336
+ }
337
+ exports.withNCEPodfile = withNCEPodfile;
338
+ // ─── Composed mod ─────────────────────────────────────────────────────────────
339
+ /**
340
+ * Expo Config Plugin mod that provisions a Notification Content Extension
341
+ * (NCE) Xcode target named `ConnectNCE`.
342
+ *
343
+ * Applies three mutations — all idempotent:
344
+ * 1. Host app entitlements: merges App Group into
345
+ * `com.apple.security.application-groups` (reuses the NSE host-entitlements
346
+ * mod — the host shares one App Group across app + NSE + NCE; the merge is
347
+ * a no-op when the NSE mod already added it).
348
+ * 2. Xcode project: adds ConnectNCE target + files (skips if already present).
349
+ * 3. Podfile: injects `target 'ConnectNCE'` block (guarded by marker comment).
350
+ *
351
+ * `config._internal.projectRoot` is required (injected by Expo CLI during
352
+ * `expo prebuild`); an actionable error is thrown if absent rather than
353
+ * silently falling back to `process.cwd()`.
354
+ *
355
+ * NSE coupling (intentional, tracked for refactor): this mod deliberately
356
+ * reuses three pieces of withConnectNSE — `withNSEEntitlements` (the host App
357
+ * Group is shared across app + NSE + NCE), `buildConnectPodTargetBlock` (one
358
+ * source for the pod-resolution helper), and `getHostBuildSettingForConfig`
359
+ * (the per-config mirroring logic). The composition always runs withConnectNSE
360
+ * before withConnectNCE, so the shared host entitlement and the
361
+ * PBXTargetDependency/PBXContainerItemProxy sections already exist when this
362
+ * runs. Extracting a shared `withConnectExtension` base for NSE + NCE is
363
+ * tracked as a follow-up refactor (see PR description) rather than done here,
364
+ * to keep the already-landed NSE mod stable.
365
+ */
366
+ const withConnectNCE = (config, props = {}) => {
367
+ var _a;
368
+ const projectRoot = (_a = config._internal) === null || _a === void 0 ? void 0 : _a.projectRoot;
369
+ if (!projectRoot) {
370
+ throw new Error(`[react-native-acoustic-connect-beta] config._internal.projectRoot is not set.\n\n` +
371
+ `This value is injected by Expo CLI during \`expo prebuild\`. ` +
372
+ `If you are calling this plugin outside of Expo CLI (e.g. in a test or ` +
373
+ `custom script), set config._internal = { projectRoot: '/abs/path/to/project' } ` +
374
+ `before invoking the plugin.`);
375
+ }
376
+ const appGroupIdentifier = (0, withConnectNSE_1.resolveAppGroupIdentifier)(projectRoot, props);
377
+ const swiftTemplatePath = path.join(__dirname, '..', 'swift', 'NotificationViewController.swift');
378
+ const swiftContent = (0, withConnectNSE_1.substituteSwiftTemplate)(swiftTemplatePath, appGroupIdentifier);
379
+ let result = (0, withConnectNSE_1.withNSEEntitlements)(config, appGroupIdentifier);
380
+ result = withNCEXcodeProject(result, appGroupIdentifier, swiftContent);
381
+ result = withNCEPodfile(result);
382
+ return result;
383
+ };
384
+ exports.withConnectNCE = withConnectNCE;
385
+ //# sourceMappingURL=withConnectNCE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withConnectNCE.js","sourceRoot":"","sources":["../src/withConnectNCE.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,8EAA8E;AAC9E,wDAAwD;;;;;;;;;;;;;;;;;;;;;;;;;;AAExD,yDAI6B;AAE7B,uCAAwB;AACxB,2CAA4B;AAC5B,qDAOyB;AASzB,8EAA8E;AAE9E,MAAM,eAAe,GAAG,YAAY,CAAA;AACpC,MAAM,eAAe,GAAG,YAAY,CAAA;AAEpC,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,uBAAuB;AACvB,MAAM,sBAAsB,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;AAEjE,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,iBAAiB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CR,CAAA;AACD,CAAC;AA7CD,8CA6CC;AAED,0EAA0E;AAC1E,SAAgB,oBAAoB,CAAC,kBAA0B;IAC7D,OAAO;;;;;;cAMK,kBAAkB;;;;CAI/B,CAAA;AACD,CAAC;AAZD,oDAYC;AAED,iFAAiF;AAEjF,MAAM,cAAc,GAClB,qEAAqE,CAAA;AAEvE;;;;;;GAMG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,IAAA,2CAA0B,EAC/B,cAAc,EACd,0BAA0B,EAC1B,eAAe,CAChB,CAAA;AACH,CAAC;AAND,8CAMC;AAED;;;GA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AAM,CAAC,CAAA;aAC/C;YACD,OAAO,CAAC,CAAA;QACV,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAvBD,wCAuBC;AAED,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,MAAM,cAAc,GAAqC,CAC9D,MAAM,EACN,KAAK,GAAG,EAAE,EACV,EAAE;;IACF,MAAM,WAAW,GAAG,MAAA,MAAM,CAAC,SAAS,0CAAE,WAAW,CAAA;IACjD,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CACb,mFAAmF;YACjF,+DAA+D;YAC/D,wEAAwE;YACxE,iFAAiF;YACjF,6BAA6B,CAChC,CAAA;KACF;IAED,MAAM,kBAAkB,GAAG,IAAA,0CAAyB,EAAC,WAAW,EAAE,KAAK,CAAC,CAAA;IAExE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CACjC,SAAS,EACT,IAAI,EACJ,OAAO,EACP,kCAAkC,CACnC,CAAA;IACD,MAAM,YAAY,GAAG,IAAA,wCAAuB,EAC1C,iBAAiB,EACjB,kBAAkB,CACnB,CAAA;IAED,IAAI,MAAM,GAAG,IAAA,oCAAmB,EAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IAC5D,MAAM,GAAG,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAA;IACtE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IAC/B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAhCY,QAAA,cAAc,kBAgC1B"}
@@ -1,5 +1,6 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
1
+ import { withXcodeProject, type ConfigPlugin } from '@expo/config-plugins';
2
2
  import type { ExpoConfig } from '@expo/config-types';
3
+ type XcodeProject = Parameters<Parameters<typeof withXcodeProject>[1]>[0]['modResults'];
3
4
  export interface ConnectPluginProps {
4
5
  /** Explicit App Group override. Wins over ConnectConfig.json when set. */
5
6
  iosAppGroupIdentifier?: string;
@@ -37,7 +38,11 @@ export declare function buildNSEInfoPlist(): string;
37
38
  /** Generates the entitlements plist content for the ConnectNSE target. */
38
39
  export declare function buildNSEEntitlements(appGroupIdentifier: string): string;
39
40
  /**
40
- * Returns the Ruby snippet to inject into the Expo-generated Podfile.
41
+ * Builds the Ruby Podfile snippet shared by the NSE and NCE mods: a helper
42
+ * that resolves the AcousticConnect pod (name + version requirements) from
43
+ * ConnectConfig.json, plus an extension `target` that links it. Centralised
44
+ * here so the NSE and NCE blocks have a single source of truth for the
45
+ * resolution logic — they differ only in marker, helper name, and target name.
41
46
  *
42
47
  * Tolerates a missing ConnectConfig.json or a missing `Connect` key: when
43
48
  * the file or key is absent the block defaults to AcousticConnectDebug with
@@ -46,6 +51,11 @@ export declare function buildNSEEntitlements(appGroupIdentifier: string): string
46
51
  * JSON, `pod install` will print a warning and use the same defaults rather
47
52
  * than crashing.
48
53
  */
54
+ export declare function buildConnectPodTargetBlock(marker: string, helperName: string, targetName: string): string;
55
+ /**
56
+ * Returns the Ruby snippet to inject into the Expo-generated Podfile for the
57
+ * ConnectNSE target. Thin wrapper over {@link buildConnectPodTargetBlock}.
58
+ */
49
59
  export declare function buildPodfileBlock(): string;
50
60
  /**
51
61
  * Injects the ConnectNSE Podfile block into `podfileContent` if not already
@@ -53,10 +63,32 @@ export declare function buildPodfileBlock(): string;
53
63
  */
54
64
  export declare function injectPodfileBlock(podfileContent: string): string;
55
65
  /**
56
- * Adds the App Group to the HOST app's entitlements. Merges idempotently
57
- * — never clobbers an existing `com.apple.security.application-groups` array.
66
+ * Adds the HOST app's push entitlements. Merges idempotently:
67
+ * - `aps-environment` the APNs (Push Notifications) capability. Required for
68
+ * the SDK's automatic `registerForRemoteNotifications()` to receive a device
69
+ * token; without it iOS fails registration with "no valid aps-environment
70
+ * entitlement string found", so no token is ever sent to the collector.
71
+ * Mirrors the bare-workflow host entitlements. `development` targets the
72
+ * sandbox APNs used by dev/`expo run:ios`/EAS `development` builds;
73
+ * production/TestFlight builds need `production`.
74
+ * - `com.apple.security.application-groups` — shared App Group for the host app
75
+ * and the NSE/NCE extensions. Never clobbers an existing array.
58
76
  */
59
77
  export declare function withNSEEntitlements(config: ExpoConfig, appGroupIdentifier: string): ExpoConfig;
78
+ /**
79
+ * Extracts a build setting value scoped to the host native target's
80
+ * configuration list for the given `configName` (e.g. "Debug" or "Release").
81
+ * Falls back to the other host config if the named one is absent, then to the
82
+ * hardcoded `fallback`.
83
+ *
84
+ * Scoped to host configs only: configs whose CODE_SIGN_ENTITLEMENTS references
85
+ * one of `skipTargetNames` (the extension targets this plugin generates) are
86
+ * skipped, so values are never mirrored from a previously generated extension
87
+ * target. Defaults to `[NSE_TARGET_NAME]`; the NCE mod (withConnectNCE) passes
88
+ * both ConnectNSE and ConnectNCE so a re-run that already wrote the NSE target
89
+ * never mirrors the sibling extension's settings.
90
+ */
91
+ export declare function getHostBuildSettingForConfig(xcodeProject: XcodeProject, setting: string, configName: string, fallback: string, skipTargetNames?: string[]): string;
60
92
  /**
61
93
  * Adds the ConnectNSE Xcode target (app_extension) to the project.
62
94
  *
@@ -92,4 +124,5 @@ export declare function withNSEPodfile(config: ExpoConfig): ExpoConfig;
92
124
  * in monorepo setups.
93
125
  */
94
126
  export declare const withConnectNSE: ConfigPlugin<ConnectPluginProps>;
127
+ export {};
95
128
  //# sourceMappingURL=withConnectNSE.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withConnectNSE.d.ts","sourceRoot":"","sources":["../src/withConnectNSE.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAapD,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B;AAUD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAA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,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAClB,kBAAkB,EAAE,MAAM,EAC1B,YAAY,EAAE,MAAM,GACnB,UAAU,CA+MZ;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAuB7D;AAID;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,kBAAkB,CAgC3D,CAAA"}
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
30
30
  return result;
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.withConnectNSE = exports.withNSEPodfile = exports.withNSEXcodeProject = exports.withNSEEntitlements = exports.injectPodfileBlock = exports.buildPodfileBlock = exports.buildNSEEntitlements = exports.buildNSEInfoPlist = exports.substituteSwiftTemplate = exports.resolveAppGroupIdentifier = exports.assertValidAppGroup = void 0;
33
+ exports.withConnectNSE = exports.withNSEPodfile = exports.withNSEXcodeProject = exports.getHostBuildSettingForConfig = exports.withNSEEntitlements = exports.injectPodfileBlock = exports.buildPodfileBlock = exports.buildConnectPodTargetBlock = exports.buildNSEEntitlements = exports.buildNSEInfoPlist = exports.substituteSwiftTemplate = exports.resolveAppGroupIdentifier = exports.assertValidAppGroup = void 0;
34
34
  const config_plugins_1 = require("@expo/config-plugins");
35
35
  const fs = __importStar(require("fs"));
36
36
  const path = __importStar(require("path"));
@@ -171,7 +171,11 @@ exports.buildNSEEntitlements = buildNSEEntitlements;
171
171
  // ─── Podfile injection ────────────────────────────────────────────────────────
172
172
  const PODFILE_MARKER = '# @generated ConnectNSE target (react-native-acoustic-connect-beta)';
173
173
  /**
174
- * Returns the Ruby snippet to inject into the Expo-generated Podfile.
174
+ * Builds the Ruby Podfile snippet shared by the NSE and NCE mods: a helper
175
+ * that resolves the AcousticConnect pod (name + version requirements) from
176
+ * ConnectConfig.json, plus an extension `target` that links it. Centralised
177
+ * here so the NSE and NCE blocks have a single source of truth for the
178
+ * resolution logic — they differ only in marker, helper name, and target name.
175
179
  *
176
180
  * Tolerates a missing ConnectConfig.json or a missing `Connect` key: when
177
181
  * the file or key is absent the block defaults to AcousticConnectDebug with
@@ -180,10 +184,10 @@ const PODFILE_MARKER = '# @generated ConnectNSE target (react-native-acoustic-co
180
184
  * JSON, `pod install` will print a warning and use the same defaults rather
181
185
  * than crashing.
182
186
  */
183
- function buildPodfileBlock() {
187
+ function buildConnectPodTargetBlock(marker, helperName, targetName) {
184
188
  return `
185
- ${PODFILE_MARKER}
186
- def acoustic_connect_pod_nse
189
+ ${marker}
190
+ def ${helperName}
187
191
  config_path = File.join(__dir__, '..', 'ConnectConfig.json')
188
192
  connect_config = {}
189
193
  if File.exist?(config_path)
@@ -202,13 +206,21 @@ def acoustic_connect_pod_nse
202
206
  [name, requirements]
203
207
  end
204
208
 
205
- target 'ConnectNSE' do
206
- connect_name, connect_requirements = acoustic_connect_pod_nse
209
+ target '${targetName}' do
210
+ connect_name, connect_requirements = ${helperName}
207
211
  pod connect_name, *connect_requirements
208
212
  end
209
- # @end ConnectNSE target (react-native-acoustic-connect-beta)
213
+ # @end ${targetName} target (react-native-acoustic-connect-beta)
210
214
  `;
211
215
  }
216
+ exports.buildConnectPodTargetBlock = buildConnectPodTargetBlock;
217
+ /**
218
+ * Returns the Ruby snippet to inject into the Expo-generated Podfile for the
219
+ * ConnectNSE target. Thin wrapper over {@link buildConnectPodTargetBlock}.
220
+ */
221
+ function buildPodfileBlock() {
222
+ return buildConnectPodTargetBlock(PODFILE_MARKER, 'acoustic_connect_pod_nse', 'ConnectNSE');
223
+ }
212
224
  exports.buildPodfileBlock = buildPodfileBlock;
213
225
  /**
214
226
  * Injects the ConnectNSE Podfile block into `podfileContent` if not already
@@ -223,12 +235,23 @@ function injectPodfileBlock(podfileContent) {
223
235
  exports.injectPodfileBlock = injectPodfileBlock;
224
236
  // ─── Entitlements mod ─────────────────────────────────────────────────────────
225
237
  /**
226
- * Adds the App Group to the HOST app's entitlements. Merges idempotently
227
- * — never clobbers an existing `com.apple.security.application-groups` array.
238
+ * Adds the HOST app's push entitlements. Merges idempotently:
239
+ * - `aps-environment` the APNs (Push Notifications) capability. Required for
240
+ * the SDK's automatic `registerForRemoteNotifications()` to receive a device
241
+ * token; without it iOS fails registration with "no valid aps-environment
242
+ * entitlement string found", so no token is ever sent to the collector.
243
+ * Mirrors the bare-workflow host entitlements. `development` targets the
244
+ * sandbox APNs used by dev/`expo run:ios`/EAS `development` builds;
245
+ * production/TestFlight builds need `production`.
246
+ * - `com.apple.security.application-groups` — shared App Group for the host app
247
+ * and the NSE/NCE extensions. Never clobbers an existing array.
228
248
  */
229
249
  function withNSEEntitlements(config, appGroupIdentifier) {
230
250
  return (0, config_plugins_1.withEntitlementsPlist)(config, (c) => {
231
251
  var _a;
252
+ if (!c.modResults['aps-environment']) {
253
+ c.modResults['aps-environment'] = 'development';
254
+ }
232
255
  const existing = (_a = c.modResults['com.apple.security.application-groups']) !== null && _a !== void 0 ? _a : [];
233
256
  if (!existing.includes(appGroupIdentifier)) {
234
257
  c.modResults['com.apple.security.application-groups'] = [
@@ -248,11 +271,14 @@ const NSE_TARGET_NAME = 'ConnectNSE';
248
271
  * Falls back to the other host config if the named one is absent, then to the
249
272
  * hardcoded `fallback`.
250
273
  *
251
- * Scoped to host configs only: configs whose CODE_SIGN_ENTITLEMENTS contains
252
- * the ConnectNSE target name are skipped, so values are never mirrored from a
253
- * previously generated extension target.
274
+ * Scoped to host configs only: configs whose CODE_SIGN_ENTITLEMENTS references
275
+ * one of `skipTargetNames` (the extension targets this plugin generates) are
276
+ * skipped, so values are never mirrored from a previously generated extension
277
+ * target. Defaults to `[NSE_TARGET_NAME]`; the NCE mod (withConnectNCE) passes
278
+ * both ConnectNSE and ConnectNCE so a re-run that already wrote the NSE target
279
+ * never mirrors the sibling extension's settings.
254
280
  */
255
- function getHostBuildSettingForConfig(xcodeProject, setting, configName, fallback) {
281
+ function getHostBuildSettingForConfig(xcodeProject, setting, configName, fallback, skipTargetNames = [NSE_TARGET_NAME]) {
256
282
  const allConfigs = xcodeProject.pbxXCBuildConfigurationSection();
257
283
  // Two-pass resolution, both passes skipping the plugin's own NSE configs
258
284
  // (identified by CODE_SIGN_ENTITLEMENTS containing NSE_TARGET_NAME) so a
@@ -270,7 +296,8 @@ function getHostBuildSettingForConfig(xcodeProject, setting, configName, fallbac
270
296
  entry.buildSettings) {
271
297
  // Skip NSE/NCE extension targets already written by this plugin
272
298
  const cse = entry.buildSettings['CODE_SIGN_ENTITLEMENTS'];
273
- if (typeof cse === 'string' && cse.includes(NSE_TARGET_NAME)) {
299
+ if (typeof cse === 'string' &&
300
+ skipTargetNames.some((name) => cse.includes(name))) {
274
301
  continue;
275
302
  }
276
303
  const val = entry.buildSettings[setting];
@@ -279,12 +306,13 @@ function getHostBuildSettingForConfig(xcodeProject, setting, configName, fallbac
279
306
  }
280
307
  }
281
308
  }
282
- // Pass 2: sibling host config fallback (any name), skip NSE targets.
309
+ // Pass 2: sibling host config fallback (any name), skip NSE/NCE targets.
283
310
  for (const key of Object.keys(allConfigs)) {
284
311
  const entry = allConfigs[key];
285
312
  if (entry && entry.buildSettings) {
286
313
  const cse = entry.buildSettings['CODE_SIGN_ENTITLEMENTS'];
287
- if (typeof cse === 'string' && cse.includes(NSE_TARGET_NAME)) {
314
+ if (typeof cse === 'string' &&
315
+ skipTargetNames.some((name) => cse.includes(name))) {
288
316
  continue;
289
317
  }
290
318
  const val = entry.buildSettings[setting];
@@ -295,6 +323,7 @@ function getHostBuildSettingForConfig(xcodeProject, setting, configName, fallbac
295
323
  }
296
324
  return fallback;
297
325
  }
326
+ exports.getHostBuildSettingForConfig = getHostBuildSettingForConfig;
298
327
  /**
299
328
  * Adds the ConnectNSE Xcode target (app_extension) to the project.
300
329
  *