react-native-acoustic-connect-beta
Version:
BETA: React native plugin for Acoustic Connect
70 lines • 4.27 kB
JavaScript
;
// Copyright (C) 2026 Acoustic, L.P. All rights reserved.
//
// NOTICE: This file contains material that is confidential and proprietary to
// Acoustic, L.P. and/or other developers. No license is granted under any
// intellectual or industrial property rights of Acoustic, L.P. except as may
// be provided in an agreement with Acoustic, L.P. Any unauthorized copying or
// distribution of content from this file is prohibited.
Object.defineProperty(exports, "__esModule", { value: true });
exports.withConnectAndroidGoogleServicesMatch = exports.withConnectAndroidConfig = exports.withConnectIosSigning = exports.withConnectNCE = exports.withConnectNSE = void 0;
const withConnectNSE_1 = require("./withConnectNSE");
Object.defineProperty(exports, "withConnectNSE", { enumerable: true, get: function () { return withConnectNSE_1.withConnectNSE; } });
const withConnectNCE_1 = require("./withConnectNCE");
Object.defineProperty(exports, "withConnectNCE", { enumerable: true, get: function () { return withConnectNCE_1.withConnectNCE; } });
const withConnectAndroidConfig_1 = require("./withConnectAndroidConfig");
Object.defineProperty(exports, "withConnectAndroidConfig", { enumerable: true, get: function () { return withConnectAndroidConfig_1.withConnectAndroidConfig; } });
Object.defineProperty(exports, "withConnectAndroidGoogleServicesMatch", { enumerable: true, get: function () { return withConnectAndroidConfig_1.withConnectAndroidGoogleServicesMatch; } });
const withConnectIosSigning_1 = require("./withConnectIosSigning");
Object.defineProperty(exports, "withConnectIosSigning", { enumerable: true, get: function () { return withConnectIosSigning_1.withConnectIosSigning; } });
/**
* Expo Config Plugin for react-native-acoustic-connect-beta.
*
* iOS: provisions the ConnectNSE Notification Service Extension and the
* ConnectNCE Notification Content Extension targets during `expo prebuild`.
*
* Android: wires the SDK's config.gradle into the generated app build so
* ConnectConfig.json values (collector URL, app key) reach the native assets
* at build time (withConnectAndroidConfig). FCM push needs no mod here — Expo
* wires the google-services Gradle plugin natively when the consumer sets
* `android.googleServicesFile` in app.json.
*
* Designed as a chainable composition: additional mods are appended by adding
* to the mods array. Order matters for the iOS pair — withConnectNSE runs
* first so it seeds the host entitlements and the
* PBXTargetDependency/PBXContainerItemProxy sections that withConnectNCE
* reuses. The Android mod is independent of that ordering.
*
* Consumer app.json usage:
* // With explicit App Group + signing team overrides:
* ["react-native-acoustic-connect-beta", {
* "iosAppGroupIdentifier": "group.com.example.app",
* "iosDevelopmentTeam": "ABCDE12345" // 10-char Apple Team ID — required
* // for push (else aps-environment is
* // dropped to ad-hoc, no APNs token)
* }]
*
* // Without props (reads iOSAppGroupIdentifier / iOSDevelopmentTeam from
* // ConnectConfig.json):
* "react-native-acoustic-connect-beta"
*/
const withAcousticConnect = (config, props) => {
const resolvedProps = props != null && typeof props === 'object' ? props : {};
// Chainable composition array. Order matters:
// - withConnectNSE must precede withConnectNCE: the NSE mod seeds the host
// App Group entitlement and the PBXTargetDependency/PBXContainerItemProxy
// sections the NCE mod relies on.
// - withConnectIosSigning must follow both so the ConnectNSE/ConnectNCE
// targets exist before it stamps DEVELOPMENT_TEAM onto them.
// The Android mods are independent of that ordering.
const mods = [
withConnectNSE_1.withConnectNSE,
withConnectNCE_1.withConnectNCE,
withConnectIosSigning_1.withConnectIosSigning,
withConnectAndroidConfig_1.withConnectAndroidConfig,
withConnectAndroidConfig_1.withConnectAndroidGoogleServicesMatch,
];
return mods.reduce((accConfig, mod) => mod(accConfig, resolvedProps), config);
};
exports.default = withAcousticConnect;
//# sourceMappingURL=index.js.map