File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import { withEasManagedCredentials } from './withEasManagedCredentials';
1010
1111// Typed props that bubble all the way down to the sub‑mods
1212import type { ConfigProps } from '../@types' ;
13- import { withMainAppEntitlementsFile } from './withMainAppEntitlementsFile' ;
1413
1514export const withBroadcastExtension : ConfigPlugin < ConfigProps > = (
1615 config ,
@@ -19,7 +18,6 @@ export const withBroadcastExtension: ConfigPlugin<ConfigProps> = (
1918 return withPlugins ( config , [
2019 /** Main‑app tweaks */
2120 [ withMainAppAppGroupInfoPlist , props ] ,
22- [ withMainAppEntitlementsFile , props ] ,
2321 [ withMainAppAppGroupEntitlement , props ] ,
2422
2523 /** Broadcast extension target */
Original file line number Diff line number Diff line change @@ -10,15 +10,28 @@ export const withMainAppAppGroupEntitlement: ConfigPlugin<ConfigProps> = (
1010) => {
1111 const APP_GROUP_KEY = 'com.apple.security.application-groups' ;
1212 return withEntitlementsPlist ( config , ( newConfig ) => {
13+ // Ensure we have an array, preserving any existing entries
1314 if ( ! Array . isArray ( newConfig . modResults [ APP_GROUP_KEY ] ) ) {
1415 newConfig . modResults [ APP_GROUP_KEY ] = [ ] ;
1516 }
17+
1618 const modResultsArray = newConfig . modResults [ APP_GROUP_KEY ] as Array < any > ;
1719 const entitlement = getAppGroup ( newConfig ?. ios ?. bundleIdentifier ! ) ;
18- if ( modResultsArray . indexOf ( entitlement ) !== - 1 ) {
20+
21+ console . log ( 'hit with' , entitlement ) ;
22+
23+ // Check if our entitlement already exists
24+ if ( modResultsArray . includes ( entitlement ) ) {
25+ console . log ( 'found - skipping' ) ;
1926 return newConfig ;
2027 }
28+
29+ console . log ( 'pushing' , entitlement ) ;
2130 modResultsArray . push ( entitlement ) ;
31+
32+ // Log final state for debugging
33+ console . log ( 'Final app groups:' , modResultsArray ) ;
34+
2235 return newConfig ;
2336 } ) ;
2437} ;
You can’t perform that action at this time.
0 commit comments