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

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,494 @@
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.withConnectNSE = exports.withNSEPodfile = exports.withNSEXcodeProject = exports.withNSEEntitlements = exports.injectPodfileBlock = exports.buildPodfileBlock = exports.buildNSEEntitlements = exports.buildNSEInfoPlist = exports.substituteSwiftTemplate = exports.resolveAppGroupIdentifier = exports.assertValidAppGroup = void 0;
34
+ const config_plugins_1 = require("@expo/config-plugins");
35
+ const fs = __importStar(require("fs"));
36
+ const path = __importStar(require("path"));
37
+ // ─── App Group resolution ─────────────────────────────────────────────────────
38
+ // Apple App Group identifiers are `group.` followed by a reverse-DNS string of
39
+ // alphanumerics, dots, and hyphens. Validating against this both catches typos
40
+ // early and guarantees the value is safe to interpolate into the entitlements
41
+ // XML (no `<`, `>`, `&`, or quotes can appear).
42
+ const APP_GROUP_PATTERN = /^group\.[A-Za-z0-9.-]+$/;
43
+ /**
44
+ * Validates an App Group identifier against Apple's format and returns it.
45
+ * Throws an actionable error otherwise.
46
+ */
47
+ function assertValidAppGroup(value, source) {
48
+ if (!APP_GROUP_PATTERN.test(value)) {
49
+ throw new Error(`[react-native-acoustic-connect-beta] Invalid iOS App Group identifier ` +
50
+ `"${value}" (from ${source}).\n\n` +
51
+ `It must start with "group." followed by letters, digits, dots, or ` +
52
+ `hyphens — e.g. "group.com.example.app".`);
53
+ }
54
+ return value;
55
+ }
56
+ exports.assertValidAppGroup = assertValidAppGroup;
57
+ /**
58
+ * Resolves the iOS App Group identifier used by ConnectNSE.
59
+ *
60
+ * Priority:
61
+ * 1. `iosAppGroupIdentifier` plugin prop in app.json (explicit override)
62
+ * 2. `Connect.iOSAppGroupIdentifier` in `<projectRoot>/ConnectConfig.json`
63
+ *
64
+ * The resolved value is validated against Apple's App Group format. Throws a
65
+ * clear, actionable error if neither source provides the value, or if the
66
+ * provided value is malformed.
67
+ */
68
+ function resolveAppGroupIdentifier(projectRoot, props) {
69
+ if (props.iosAppGroupIdentifier) {
70
+ return assertValidAppGroup(props.iosAppGroupIdentifier, 'app.json plugin prop');
71
+ }
72
+ const configPath = path.join(projectRoot, 'ConnectConfig.json');
73
+ if (fs.existsSync(configPath)) {
74
+ const raw = fs.readFileSync(configPath, 'utf8');
75
+ let parsed;
76
+ try {
77
+ parsed = JSON.parse(raw);
78
+ }
79
+ catch {
80
+ throw new Error(`[react-native-acoustic-connect-beta] ConnectConfig.json at ${configPath} is not valid JSON.`);
81
+ }
82
+ const connect = parsed['Connect'];
83
+ const groupId = connect === null || connect === void 0 ? void 0 : connect['iOSAppGroupIdentifier'];
84
+ if (typeof groupId === 'string' && groupId.length > 0) {
85
+ return assertValidAppGroup(groupId, 'Connect.iOSAppGroupIdentifier in ConnectConfig.json');
86
+ }
87
+ }
88
+ throw new Error(`[react-native-acoustic-connect-beta] Could not resolve iOS App Group identifier.\n\n` +
89
+ `To fix this, do ONE of the following:\n` +
90
+ ` 1. (Preferred) Add "iOSAppGroupIdentifier" to the "Connect" object in ` +
91
+ `your project's ConnectConfig.json:\n` +
92
+ ` { "Connect": { "iOSAppGroupIdentifier": "group.com.example.app" } }\n` +
93
+ ` 2. Pass the identifier as a plugin prop in app.json:\n` +
94
+ ` ["react-native-acoustic-connect-beta", { "iosAppGroupIdentifier": "group.com.example.app" }]\n`);
95
+ }
96
+ exports.resolveAppGroupIdentifier = resolveAppGroupIdentifier;
97
+ // ─── Swift template substitution ─────────────────────────────────────────────
98
+ const PLACEHOLDER = 'CONNECT_APP_GROUP_IDENTIFIER_PLACEHOLDER';
99
+ const GENERATED_HEADER = '// @generated by react-native-acoustic-connect-beta Expo Config Plugin — do not edit manually.\n';
100
+ /**
101
+ * Returns the content of `plugin/swift/NotificationService.swift` with the
102
+ * placeholder replaced by the resolved App Group identifier and a generated
103
+ * header prepended.
104
+ */
105
+ function substituteSwiftTemplate(templatePath, appGroupIdentifier) {
106
+ const template = fs.readFileSync(templatePath, 'utf8');
107
+ // split/join replaces EVERY occurrence — the template mentions the
108
+ // placeholder in a comment before the code occurrence, and a string
109
+ // pattern to .replace() would only substitute that first mention.
110
+ const substituted = template.split(PLACEHOLDER).join(appGroupIdentifier);
111
+ return GENERATED_HEADER + substituted;
112
+ }
113
+ exports.substituteSwiftTemplate = substituteSwiftTemplate;
114
+ // ─── Plist helpers ────────────────────────────────────────────────────────────
115
+ /**
116
+ * Generates the Info.plist content for the ConnectNSE target.
117
+ *
118
+ * RCTNewArchEnabled is intentionally omitted: the NSE links the Connect SDK
119
+ * only — no React Native runtime is present in the extension process.
120
+ */
121
+ function buildNSEInfoPlist() {
122
+ return `<?xml version="1.0" encoding="UTF-8"?>
123
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
124
+ <plist version="1.0">
125
+ <dict>
126
+ \t<key>CFBundleDevelopmentRegion</key>
127
+ \t<string>$(DEVELOPMENT_LANGUAGE)</string>
128
+ \t<key>CFBundleDisplayName</key>
129
+ \t<string>ConnectNSE</string>
130
+ \t<key>CFBundleExecutable</key>
131
+ \t<string>$(EXECUTABLE_NAME)</string>
132
+ \t<key>CFBundleIdentifier</key>
133
+ \t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
134
+ \t<key>CFBundleInfoDictionaryVersion</key>
135
+ \t<string>6.0</string>
136
+ \t<key>CFBundleName</key>
137
+ \t<string>$(PRODUCT_NAME)</string>
138
+ \t<key>CFBundlePackageType</key>
139
+ \t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
140
+ \t<key>CFBundleShortVersionString</key>
141
+ \t<string>$(MARKETING_VERSION)</string>
142
+ \t<key>CFBundleVersion</key>
143
+ \t<string>$(CURRENT_PROJECT_VERSION)</string>
144
+ \t<key>NSExtension</key>
145
+ \t<dict>
146
+ \t\t<key>NSExtensionPointIdentifier</key>
147
+ \t\t<string>com.apple.usernotifications.service</string>
148
+ \t\t<key>NSExtensionPrincipalClass</key>
149
+ \t\t<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
150
+ \t</dict>
151
+ </dict>
152
+ </plist>
153
+ `;
154
+ }
155
+ exports.buildNSEInfoPlist = buildNSEInfoPlist;
156
+ /** Generates the entitlements plist content for the ConnectNSE target. */
157
+ function buildNSEEntitlements(appGroupIdentifier) {
158
+ return `<?xml version="1.0" encoding="UTF-8"?>
159
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
160
+ <plist version="1.0">
161
+ <dict>
162
+ \t<key>com.apple.security.application-groups</key>
163
+ \t<array>
164
+ \t\t<string>${appGroupIdentifier}</string>
165
+ \t</array>
166
+ </dict>
167
+ </plist>
168
+ `;
169
+ }
170
+ exports.buildNSEEntitlements = buildNSEEntitlements;
171
+ // ─── Podfile injection ────────────────────────────────────────────────────────
172
+ const PODFILE_MARKER = '# @generated ConnectNSE target (react-native-acoustic-connect-beta)';
173
+ /**
174
+ * Returns the Ruby snippet to inject into the Expo-generated Podfile.
175
+ *
176
+ * Tolerates a missing ConnectConfig.json or a missing `Connect` key: when
177
+ * the file or key is absent the block defaults to AcousticConnectDebug with
178
+ * floor '>= 2.1.12' and no version pin, so prop-only setups (no
179
+ * ConnectConfig.json) keep working. If the file exists but contains invalid
180
+ * JSON, `pod install` will print a warning and use the same defaults rather
181
+ * than crashing.
182
+ */
183
+ function buildPodfileBlock() {
184
+ return `
185
+ ${PODFILE_MARKER}
186
+ def acoustic_connect_pod_nse
187
+ config_path = File.join(__dir__, '..', 'ConnectConfig.json')
188
+ connect_config = {}
189
+ if File.exist?(config_path)
190
+ begin
191
+ parsed = JSON.parse(File.read(config_path))
192
+ connect_config = parsed['Connect'] || {}
193
+ rescue JSON::ParserError => e
194
+ warn "[react-native-acoustic-connect-beta] ConnectConfig.json is not valid JSON: #{e.message}. Using defaults."
195
+ end
196
+ end
197
+ use_release = connect_config['useRelease'] || false
198
+ ios_version = (connect_config['iOSVersion'] || '').to_s
199
+ name = use_release ? 'AcousticConnect' : 'AcousticConnectDebug'
200
+ floor = '>= 2.1.12'
201
+ requirements = ios_version.empty? ? [floor] : [floor, ios_version]
202
+ [name, requirements]
203
+ end
204
+
205
+ target 'ConnectNSE' do
206
+ connect_name, connect_requirements = acoustic_connect_pod_nse
207
+ pod connect_name, *connect_requirements
208
+ end
209
+ # @end ConnectNSE target (react-native-acoustic-connect-beta)
210
+ `;
211
+ }
212
+ exports.buildPodfileBlock = buildPodfileBlock;
213
+ /**
214
+ * Injects the ConnectNSE Podfile block into `podfileContent` if not already
215
+ * present (idempotent, guarded by PODFILE_MARKER).
216
+ */
217
+ function injectPodfileBlock(podfileContent) {
218
+ if (podfileContent.includes(PODFILE_MARKER)) {
219
+ return podfileContent;
220
+ }
221
+ return podfileContent + buildPodfileBlock();
222
+ }
223
+ exports.injectPodfileBlock = injectPodfileBlock;
224
+ // ─── Entitlements mod ─────────────────────────────────────────────────────────
225
+ /**
226
+ * Adds the App Group to the HOST app's entitlements. Merges idempotently
227
+ * — never clobbers an existing `com.apple.security.application-groups` array.
228
+ */
229
+ function withNSEEntitlements(config, appGroupIdentifier) {
230
+ return (0, config_plugins_1.withEntitlementsPlist)(config, (c) => {
231
+ var _a;
232
+ const existing = (_a = c.modResults['com.apple.security.application-groups']) !== null && _a !== void 0 ? _a : [];
233
+ if (!existing.includes(appGroupIdentifier)) {
234
+ c.modResults['com.apple.security.application-groups'] = [
235
+ ...existing,
236
+ appGroupIdentifier,
237
+ ];
238
+ }
239
+ return c;
240
+ });
241
+ }
242
+ exports.withNSEEntitlements = withNSEEntitlements;
243
+ // ─── Xcode project mod ───────────────────────────────────────────────────────
244
+ const NSE_TARGET_NAME = 'ConnectNSE';
245
+ /**
246
+ * Extracts a build setting value scoped to the host native target's
247
+ * configuration list for the given `configName` (e.g. "Debug" or "Release").
248
+ * Falls back to the other host config if the named one is absent, then to the
249
+ * hardcoded `fallback`.
250
+ *
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.
254
+ */
255
+ function getHostBuildSettingForConfig(xcodeProject, setting, configName, fallback) {
256
+ const allConfigs = xcodeProject.pbxXCBuildConfigurationSection();
257
+ // Two-pass resolution, both passes skipping the plugin's own NSE configs
258
+ // (identified by CODE_SIGN_ENTITLEMENTS containing NSE_TARGET_NAME) so a
259
+ // re-run never mirrors values from a previously generated extension target:
260
+ // Pass 1 — exact match on the requested configName (Debug → Debug).
261
+ // Pass 2 — graceful fallback to the sibling host config's value when the
262
+ // matching config has no explicit setting; mirroring the host's
263
+ // other config beats dropping to the hardcoded default.
264
+ // Pass 1: exact configName match.
265
+ for (const key of Object.keys(allConfigs)) {
266
+ const entry = allConfigs[key];
267
+ if (entry &&
268
+ typeof entry === 'object' &&
269
+ entry.name === configName &&
270
+ entry.buildSettings) {
271
+ // Skip NSE/NCE extension targets already written by this plugin
272
+ const cse = entry.buildSettings['CODE_SIGN_ENTITLEMENTS'];
273
+ if (typeof cse === 'string' && cse.includes(NSE_TARGET_NAME)) {
274
+ continue;
275
+ }
276
+ const val = entry.buildSettings[setting];
277
+ if (typeof val === 'string') {
278
+ return val;
279
+ }
280
+ }
281
+ }
282
+ // Pass 2: sibling host config fallback (any name), skip NSE targets.
283
+ for (const key of Object.keys(allConfigs)) {
284
+ const entry = allConfigs[key];
285
+ if (entry && entry.buildSettings) {
286
+ const cse = entry.buildSettings['CODE_SIGN_ENTITLEMENTS'];
287
+ if (typeof cse === 'string' && cse.includes(NSE_TARGET_NAME)) {
288
+ continue;
289
+ }
290
+ const val = entry.buildSettings[setting];
291
+ if (typeof val === 'string') {
292
+ return val;
293
+ }
294
+ }
295
+ }
296
+ return fallback;
297
+ }
298
+ /**
299
+ * Adds the ConnectNSE Xcode target (app_extension) to the project.
300
+ *
301
+ * Follows the OneSignal plugin pattern (withOneSignalNSE.ts) using the
302
+ * `xcode` API exposed via `config.modResults`.
303
+ *
304
+ * Idempotent: if a target named ConnectNSE already exists, skips target
305
+ * creation but still (re)writes the source files.
306
+ */
307
+ function withNSEXcodeProject(config, appGroupIdentifier, swiftContent) {
308
+ return (0, config_plugins_1.withXcodeProject)(config, (c) => {
309
+ var _a, _b, _c, _d;
310
+ const xcodeProject = c.modResults;
311
+ // ios/ directory — modRequest.platformProjectRoot is the canonical
312
+ // native project root. (xcodeProject.filepath points INSIDE the
313
+ // .xcodeproj bundle, so deriving from it misplaces the files.)
314
+ const iosDir = c.modRequest.platformProjectRoot;
315
+ const nseDir = path.join(iosDir, NSE_TARGET_NAME);
316
+ // Always write / overwrite the source files (idempotent)
317
+ fs.mkdirSync(nseDir, { recursive: true });
318
+ fs.writeFileSync(path.join(nseDir, 'NotificationService.swift'), swiftContent, 'utf8');
319
+ fs.writeFileSync(path.join(nseDir, 'Info.plist'), buildNSEInfoPlist(), 'utf8');
320
+ fs.writeFileSync(path.join(nseDir, `${NSE_TARGET_NAME}.entitlements`), buildNSEEntitlements(appGroupIdentifier), 'utf8');
321
+ // Idempotency check — skip if target already registered in the pbxproj.
322
+ // Note: pbxTargetByName misses targets on a REPARSED project because the
323
+ // xcode lib stores written names with literal quotes ('"ConnectNSE"'),
324
+ // so compare quote-stripped names across the native-target section.
325
+ const nativeTargets = xcodeProject.pbxNativeTargetSection();
326
+ const targetExists = Object.values(nativeTargets).some((t) => typeof t === 'object' &&
327
+ typeof t.name === 'string' &&
328
+ t.name.replace(/"/g, '') === NSE_TARGET_NAME);
329
+ if (targetExists) {
330
+ return c;
331
+ }
332
+ // Derive the host bundle id — the NSE bundle id must be
333
+ // `<hostBundleId>.ConnectNSE`. Fail fast rather than emit a placeholder
334
+ // (a wrong bundle id breaks App Group pairing and App Store submission).
335
+ const hostBundleId = (_a = c.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier;
336
+ if (!hostBundleId) {
337
+ throw new Error(`[react-native-acoustic-connect-beta] ios.bundleIdentifier is not set.\n\n` +
338
+ `The ConnectNSE extension bundle id is derived as ` +
339
+ `"<ios.bundleIdentifier>.ConnectNSE", so the host bundle id must be ` +
340
+ `defined in app.json before prebuild:\n` +
341
+ ` { "expo": { "ios": { "bundleIdentifier": "com.example.app" } } }`);
342
+ }
343
+ // Add the native target (app_extension)
344
+ const nseTarget = xcodeProject.addTarget(NSE_TARGET_NAME, 'app_extension', NSE_TARGET_NAME, `${hostBundleId}.ConnectNSE`);
345
+ if (!nseTarget) {
346
+ throw new Error(`[react-native-acoustic-connect-beta] Failed to add ConnectNSE Xcode target.`);
347
+ }
348
+ // Add the build phase for Swift sources
349
+ xcodeProject.addBuildPhase(['NotificationService.swift'], 'PBXSourcesBuildPhase', 'Sources', nseTarget.uuid);
350
+ // Add Resources build phase (empty, but required by Xcode)
351
+ xcodeProject.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', nseTarget.uuid);
352
+ // Add Frameworks build phase (empty — CocoaPods populates it)
353
+ xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', nseTarget.uuid);
354
+ // Make the host app target depend on ConnectNSE. CocoaPods resolves an
355
+ // extension's host target through PBXTargetDependency (xcodeproj's
356
+ // host_targets_for_embedded_target), NOT through the embed copy phase —
357
+ // without this edge `pod install` fails with "Unable to find host
358
+ // target(s) for ConnectNSE".
359
+ // The xcode lib SILENTLY no-ops addTargetDependency when these sections
360
+ // are absent from the parsed project (Expo templates ship without any
361
+ // extension, so they are) — create them first.
362
+ const objects = xcodeProject.hash.project.objects;
363
+ objects['PBXTargetDependency'] = (_b = objects['PBXTargetDependency']) !== null && _b !== void 0 ? _b : {};
364
+ objects['PBXContainerItemProxy'] = (_c = objects['PBXContainerItemProxy']) !== null && _c !== void 0 ? _c : {};
365
+ const hostTargetUuid = xcodeProject.getFirstTarget().uuid;
366
+ xcodeProject.addTargetDependency(hostTargetUuid, [nseTarget.uuid]);
367
+ // Create a PBXGroup for ConnectNSE source files
368
+ const nseGroup = xcodeProject.addPbxGroup([
369
+ 'NotificationService.swift',
370
+ 'Info.plist',
371
+ `${NSE_TARGET_NAME}.entitlements`,
372
+ ], NSE_TARGET_NAME, NSE_TARGET_NAME);
373
+ // Add the group to the main project group
374
+ const mainGroup = xcodeProject.getFirstProject().firstProject.mainGroup;
375
+ xcodeProject.addToPbxGroup(nseGroup.uuid, mainGroup);
376
+ // Set per-configuration build settings — mirror each host configuration
377
+ // individually so Debug gets Debug values and Release gets Release values.
378
+ const buildConfigurations = xcodeProject.pbxXCConfigurationList();
379
+ const nseConfigListUuid = nseTarget.pbxNativeTarget.buildConfigurationList;
380
+ if (nseConfigListUuid) {
381
+ const configList = buildConfigurations[nseConfigListUuid];
382
+ if (configList &&
383
+ Array.isArray(configList
384
+ .buildConfigurations)) {
385
+ const configs = xcodeProject.pbxXCBuildConfigurationSection();
386
+ for (const entry of configList.buildConfigurations) {
387
+ const buildConfig = configs[entry.value];
388
+ if (buildConfig && buildConfig.buildSettings) {
389
+ // Determine which host config name to mirror (Debug → Debug, etc.)
390
+ const configName = (_d = buildConfig.name) !== null && _d !== void 0 ? _d : 'Debug';
391
+ // M2: mirror per-configuration values; fall back to the other
392
+ // config's value only when the matching one is absent.
393
+ const deploymentTarget = getHostBuildSettingForConfig(xcodeProject, 'IPHONEOS_DEPLOYMENT_TARGET', configName,
394
+ // Matches the AcousticConnect podspec floor (iOS >= 15.1) so the
395
+ // NSE never demands a higher minimum than the host app.
396
+ '15.1');
397
+ const swiftVersion = getHostBuildSettingForConfig(xcodeProject, 'SWIFT_VERSION', configName, '5.0');
398
+ const marketingVersion = getHostBuildSettingForConfig(xcodeProject, 'MARKETING_VERSION', configName, '1.0');
399
+ const currentProjectVersion = getHostBuildSettingForConfig(xcodeProject, 'CURRENT_PROJECT_VERSION', configName, '1');
400
+ Object.assign(buildConfig.buildSettings, {
401
+ // C1: prevent Xcode from synthesising a second Info.plist that
402
+ // would shadow the NSExtension dictionary in ours.
403
+ GENERATE_INFOPLIST_FILE: 'NO',
404
+ INFOPLIST_FILE: `${NSE_TARGET_NAME}/Info.plist`,
405
+ // M1: extension must target the device SDK and restrict to
406
+ // extension-safe APIs (mirrors bare-workflow reference target).
407
+ SDKROOT: 'iphoneos',
408
+ APPLICATION_EXTENSION_API_ONLY: 'YES',
409
+ IPHONEOS_DEPLOYMENT_TARGET: deploymentTarget,
410
+ SWIFT_VERSION: swiftVersion,
411
+ MARKETING_VERSION: marketingVersion,
412
+ CURRENT_PROJECT_VERSION: currentProjectVersion,
413
+ CODE_SIGN_ENTITLEMENTS: `${NSE_TARGET_NAME}/${NSE_TARGET_NAME}.entitlements`,
414
+ PRODUCT_NAME: NSE_TARGET_NAME,
415
+ PRODUCT_BUNDLE_IDENTIFIER: `${hostBundleId}.ConnectNSE`,
416
+ TARGETED_DEVICE_FAMILY: '"1,2"',
417
+ CODE_SIGN_STYLE: 'Automatic',
418
+ });
419
+ }
420
+ }
421
+ }
422
+ }
423
+ return c;
424
+ });
425
+ }
426
+ exports.withNSEXcodeProject = withNSEXcodeProject;
427
+ // ─── Podfile mod ─────────────────────────────────────────────────────────────
428
+ /**
429
+ * Injects the ConnectNSE Podfile target block via withDangerousMod.
430
+ * Guarded by a marker comment — re-runs are no-ops.
431
+ *
432
+ * M5: throws a clear, actionable error when the Podfile does not exist at
433
+ * mod-execution time, instead of silently returning — a silent skip would
434
+ * ship an NSE whose `import Connect` cannot resolve.
435
+ */
436
+ function withNSEPodfile(config) {
437
+ return (0, config_plugins_1.withDangerousMod)(config, [
438
+ 'ios',
439
+ async (c) => {
440
+ const podfilePath = path.join(c.modRequest.platformProjectRoot, 'Podfile');
441
+ if (!fs.existsSync(podfilePath)) {
442
+ throw new Error(`[react-native-acoustic-connect-beta] ios/Podfile not found at ${podfilePath}.\n\n` +
443
+ `This mod runs after prebuild generates the ios/ directory. ` +
444
+ `If you are running this plugin outside of \`expo prebuild\`, ` +
445
+ `ensure the Podfile exists before the dangerous mod phase executes.\n` +
446
+ `Check prebuild ordering: withDangerousMod('ios') runs after ` +
447
+ `withXcodeProject, so the ios/ directory should already be present.`);
448
+ }
449
+ const current = fs.readFileSync(podfilePath, 'utf8');
450
+ const updated = injectPodfileBlock(current);
451
+ if (updated !== current) {
452
+ fs.writeFileSync(podfilePath, updated, 'utf8');
453
+ }
454
+ return c;
455
+ },
456
+ ]);
457
+ }
458
+ exports.withNSEPodfile = withNSEPodfile;
459
+ // ─── Composed mod ─────────────────────────────────────────────────────────────
460
+ /**
461
+ * Expo Config Plugin mod that provisions a Notification Service Extension
462
+ * (NSE) Xcode target named `ConnectNSE`.
463
+ *
464
+ * Applies three mutations — all idempotent:
465
+ * 1. Host app entitlements: merges App Group into
466
+ * `com.apple.security.application-groups`.
467
+ * 2. Xcode project: adds ConnectNSE target + files (skips if already present).
468
+ * 3. Podfile: injects `target 'ConnectNSE'` block (guarded by marker comment).
469
+ *
470
+ * M4: `config._internal.projectRoot` is required. If absent (i.e. invoked
471
+ * outside Expo CLI), an actionable error is thrown rather than silently
472
+ * falling back to `process.cwd()`, which would misresolve ConnectConfig.json
473
+ * in monorepo setups.
474
+ */
475
+ const withConnectNSE = (config, props = {}) => {
476
+ var _a;
477
+ const projectRoot = (_a = config._internal) === null || _a === void 0 ? void 0 : _a.projectRoot;
478
+ if (!projectRoot) {
479
+ throw new Error(`[react-native-acoustic-connect-beta] config._internal.projectRoot is not set.\n\n` +
480
+ `This value is injected by Expo CLI during \`expo prebuild\`. ` +
481
+ `If you are calling this plugin outside of Expo CLI (e.g. in a test or ` +
482
+ `custom script), set config._internal = { projectRoot: '/abs/path/to/project' } ` +
483
+ `before invoking the plugin.`);
484
+ }
485
+ const appGroupIdentifier = resolveAppGroupIdentifier(projectRoot, props);
486
+ const swiftTemplatePath = path.join(__dirname, '..', 'swift', 'NotificationService.swift');
487
+ const swiftContent = substituteSwiftTemplate(swiftTemplatePath, appGroupIdentifier);
488
+ let result = withNSEEntitlements(config, appGroupIdentifier);
489
+ result = withNSEXcodeProject(result, appGroupIdentifier, swiftContent);
490
+ result = withNSEPodfile(result);
491
+ return result;
492
+ };
493
+ exports.withConnectNSE = withConnectNSE;
494
+ //# sourceMappingURL=withConnectNSE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withConnectNSE.js","sourceRoot":"","sources":["../src/withConnectNSE.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,8EAA8E;AAC9E,wDAAwD;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C3C,IAAI,OAAO,KAAK,OAAO,EAAE;gBACvB,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;aAC/C;YACD,OAAO,CAAC,CAAA;QACV,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAvBD,wCAuBC;AAED,iFAAiF;AAEjF;;;;;;;;;;;;;;GAcG;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,yBAAyB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;IAExE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CACjC,SAAS,EACT,IAAI,EACJ,OAAO,EACP,2BAA2B,CAC5B,CAAA;IACD,MAAM,YAAY,GAAG,uBAAuB,CAC1C,iBAAiB,EACjB,kBAAkB,CACnB,CAAA;IAED,IAAI,MAAM,GAAG,mBAAmB,CAAC,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"}
@@ -0,0 +1,42 @@
1
+ // Copyright (C) 2026 Acoustic, L.P. All rights reserved.
2
+ //
3
+ // NOTICE: This file contains material that is confidential and proprietary to
4
+ // Acoustic, L.P. and/or other developers. No license is granted under any
5
+ // intellectual or industrial property rights of Acoustic, L.P. except as may
6
+ // be provided in an agreement with Acoustic, L.P. Any unauthorized copying or
7
+ // distribution of content from this file is prohibited.
8
+
9
+ import { type ConfigPlugin } from '@expo/config-plugins'
10
+ import { withConnectNSE, type ConnectPluginProps } from './withConnectNSE'
11
+
12
+ /**
13
+ * Expo Config Plugin for react-native-acoustic-connect-beta.
14
+ *
15
+ * Provisions the ConnectNSE Notification Service Extension target during
16
+ * `expo prebuild`. Designed as a chainable composition: additional mods
17
+ * (e.g. withConnectNCE from CA-143488) are appended by adding to the mods
18
+ * array without touching this file.
19
+ *
20
+ * Consumer app.json usage:
21
+ * // With explicit App Group override:
22
+ * ["react-native-acoustic-connect-beta", { "iosAppGroupIdentifier": "group.com.example.app" }]
23
+ *
24
+ * // Without props (reads from ConnectConfig.json):
25
+ * "react-native-acoustic-connect-beta"
26
+ */
27
+ const withAcousticConnect: ConfigPlugin<ConnectPluginProps | void> = (
28
+ config,
29
+ props
30
+ ) => {
31
+ const resolvedProps: ConnectPluginProps =
32
+ props != null && typeof props === 'object' ? props : {}
33
+
34
+ // Chainable composition array — CA-143488 appends withConnectNCE here.
35
+ const mods: Array<ConfigPlugin<ConnectPluginProps>> = [withConnectNSE]
36
+
37
+ return mods.reduce((accConfig, mod) => mod(accConfig, resolvedProps), config)
38
+ }
39
+
40
+ export default withAcousticConnect
41
+ export { withConnectNSE }
42
+ export type { ConnectPluginProps }