customerio-expo-plugin 3.4.0 → 3.5.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.
Files changed (79) hide show
  1. package/package.json +2 -1
  2. package/plugin/lib/commonjs/android/withAndroidManifestUpdates.js +64 -59
  3. package/plugin/lib/commonjs/android/withAndroidManifestUpdates.js.map +1 -1
  4. package/plugin/lib/commonjs/android/withAppGoogleServices.js +10 -7
  5. package/plugin/lib/commonjs/android/withAppGoogleServices.js.map +1 -1
  6. package/plugin/lib/commonjs/android/withGoogleServicesJSON.js +18 -21
  7. package/plugin/lib/commonjs/android/withGoogleServicesJSON.js.map +1 -1
  8. package/plugin/lib/commonjs/android/withLocationGradleProperties.js +16 -12
  9. package/plugin/lib/commonjs/android/withLocationGradleProperties.js.map +1 -1
  10. package/plugin/lib/commonjs/android/withMainApplicationModifications.js +19 -12
  11. package/plugin/lib/commonjs/android/withMainApplicationModifications.js.map +1 -1
  12. package/plugin/lib/commonjs/android/withNotificationChannelMetadata.js +2 -1
  13. package/plugin/lib/commonjs/android/withNotificationChannelMetadata.js.map +1 -1
  14. package/plugin/lib/commonjs/android/withProjectBuildGradle.js +29 -25
  15. package/plugin/lib/commonjs/android/withProjectBuildGradle.js.map +1 -1
  16. package/plugin/lib/commonjs/android/withProjectGoogleServices.js +9 -5
  17. package/plugin/lib/commonjs/android/withProjectGoogleServices.js.map +1 -1
  18. package/plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js +63 -31
  19. package/plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map +1 -1
  20. package/plugin/lib/commonjs/ios/withAppDelegateModifications.js +47 -33
  21. package/plugin/lib/commonjs/ios/withAppDelegateModifications.js.map +1 -1
  22. package/plugin/lib/commonjs/ios/withCIOIosSwift.js +26 -42
  23. package/plugin/lib/commonjs/ios/withCIOIosSwift.js.map +1 -1
  24. package/plugin/lib/commonjs/ios/withGoogleServicesJsonFile.js +46 -30
  25. package/plugin/lib/commonjs/ios/withGoogleServicesJsonFile.js.map +1 -1
  26. package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js +192 -122
  27. package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -1
  28. package/plugin/lib/module/android/withAndroidManifestUpdates.js +61 -58
  29. package/plugin/lib/module/android/withAndroidManifestUpdates.js.map +1 -1
  30. package/plugin/lib/module/android/withAppGoogleServices.js +9 -7
  31. package/plugin/lib/module/android/withAppGoogleServices.js.map +1 -1
  32. package/plugin/lib/module/android/withGoogleServicesJSON.js +17 -21
  33. package/plugin/lib/module/android/withGoogleServicesJSON.js.map +1 -1
  34. package/plugin/lib/module/android/withLocationGradleProperties.js +15 -12
  35. package/plugin/lib/module/android/withLocationGradleProperties.js.map +1 -1
  36. package/plugin/lib/module/android/withMainApplicationModifications.js +18 -12
  37. package/plugin/lib/module/android/withMainApplicationModifications.js.map +1 -1
  38. package/plugin/lib/module/android/withNotificationChannelMetadata.js +1 -1
  39. package/plugin/lib/module/android/withNotificationChannelMetadata.js.map +1 -1
  40. package/plugin/lib/module/android/withProjectBuildGradle.js +28 -25
  41. package/plugin/lib/module/android/withProjectBuildGradle.js.map +1 -1
  42. package/plugin/lib/module/android/withProjectGoogleServices.js +8 -5
  43. package/plugin/lib/module/android/withProjectGoogleServices.js.map +1 -1
  44. package/plugin/lib/module/helpers/utils/injectCIOPodfileCode.js +61 -31
  45. package/plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map +1 -1
  46. package/plugin/lib/module/ios/withAppDelegateModifications.js +45 -33
  47. package/plugin/lib/module/ios/withAppDelegateModifications.js.map +1 -1
  48. package/plugin/lib/module/ios/withCIOIosSwift.js +24 -42
  49. package/plugin/lib/module/ios/withCIOIosSwift.js.map +1 -1
  50. package/plugin/lib/module/ios/withGoogleServicesJsonFile.js +45 -30
  51. package/plugin/lib/module/ios/withGoogleServicesJsonFile.js.map +1 -1
  52. package/plugin/lib/module/ios/withNotificationsXcodeProject.js +187 -122
  53. package/plugin/lib/module/ios/withNotificationsXcodeProject.js.map +1 -1
  54. package/plugin/lib/typescript/android/withAndroidManifestUpdates.d.ts +2 -0
  55. package/plugin/lib/typescript/android/withAppGoogleServices.d.ts +1 -0
  56. package/plugin/lib/typescript/android/withGoogleServicesJSON.d.ts +1 -0
  57. package/plugin/lib/typescript/android/withLocationGradleProperties.d.ts +2 -0
  58. package/plugin/lib/typescript/android/withMainApplicationModifications.d.ts +6 -0
  59. package/plugin/lib/typescript/android/withNotificationChannelMetadata.d.ts +5 -0
  60. package/plugin/lib/typescript/android/withProjectBuildGradle.d.ts +9 -0
  61. package/plugin/lib/typescript/android/withProjectGoogleServices.d.ts +1 -0
  62. package/plugin/lib/typescript/helpers/utils/injectCIOPodfileCode.d.ts +14 -0
  63. package/plugin/lib/typescript/ios/withAppDelegateModifications.d.ts +13 -0
  64. package/plugin/lib/typescript/ios/withCIOIosSwift.d.ts +11 -0
  65. package/plugin/lib/typescript/ios/withGoogleServicesJsonFile.d.ts +14 -1
  66. package/plugin/lib/typescript/ios/withNotificationsXcodeProject.d.ts +53 -2
  67. package/plugin/src/android/withAndroidManifestUpdates.ts +83 -73
  68. package/plugin/src/android/withAppGoogleServices.ts +13 -11
  69. package/plugin/src/android/withGoogleServicesJSON.ts +30 -28
  70. package/plugin/src/android/withLocationGradleProperties.ts +23 -17
  71. package/plugin/src/android/withMainApplicationModifications.ts +25 -15
  72. package/plugin/src/android/withNotificationChannelMetadata.ts +1 -1
  73. package/plugin/src/android/withProjectBuildGradle.ts +37 -27
  74. package/plugin/src/android/withProjectGoogleServices.ts +14 -9
  75. package/plugin/src/helpers/utils/injectCIOPodfileCode.ts +83 -48
  76. package/plugin/src/ios/withAppDelegateModifications.ts +61 -48
  77. package/plugin/src/ios/withCIOIosSwift.ts +33 -50
  78. package/plugin/src/ios/withGoogleServicesJsonFile.ts +66 -48
  79. package/plugin/src/ios/withNotificationsXcodeProject.ts +257 -207
@@ -1 +1 @@
1
- {"version":3,"names":["_configPlugins","require","_path","_interopRequireDefault","_common","_ios","_codeInjection","_fileManagement","_patchPluginNativeCode","_logger","_plugin","_xcode","_utils","e","__esModule","default","CIO_SDK_APP_DELEGATE_HANDLER_CLASS","CIO_SDK_APP_DELEGATE_HANDLER_FILENAME","copyAndConfigureAppDelegateHandler","config","sdkConfig","props","location","projectName","modRequest","logger","warn","xcodeProject","modResults","projectRoot","iosProjectRoot","path","join","group","getOrCreateCustomerIOGroup","pushNotification","copyAndConfigurePushAppDelegateHandler","copyAndConfigureNativeSDKInitializer","_props$pushNotificati","_props$pushNotificati2","_props$pushNotificati3","_props$pushNotificati4","_props$pushNotificati5","useFcm","isFcmPushProvider","handlerSourcePath","getIosNativeFilesPath","handlerDestPath","FileManagement","copyFile","addSourceFile","handlerFileContent","readFile","disableNotificationRegistration","snippet","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET_v2","replaceCodeByRegex","CIO_REGISTER_PUSH_NOTIFICATION_PLACEHOLDER","autoTrackPushEvents","toString","autoFetchDeviceToken","showPushAppInForeground","appGroupId","appGroupIdBuilderLine","JSON","stringify","replace","CIO_MESSAGING_PUSH_APP_DELEGATE_INIT_REGEX","CIO_NATIVE_SDK_INITIALIZE_SNIPPET","writeFile","_sdkConfig$location","locationOptions","enabled","trackingMode","undefined","filename","sourcePath","copyFileToXcode","sourceFilePath","targetFileName","transform","content","patchNativeSDKInitializer","PLATFORM","IOS","customerIOGroup","withCIOIosSwift","configOuter","withXcodeProject","withAppDelegate","modifyAppDelegateWithPushAppDelegateHandler","modifyAppDelegateWithNativeSDKInitializer","exports","_props$pushNotificati6","appDelegateContent","contents","includes","info","modifiedContent","addHandlerPropertyDeclaration","modifyDidFinishLaunchingWithOptions","addDidRegisterForRemoteNotificationsWithDeviceToken","addDidFailToRegisterForRemoteNotificationsWithError","handleDeeplinkInKilledState","addHandleDeeplinkInKilledState","CIO_NATIVE_SDK_INITIALIZE_CALL","methodExistsInAppDelegate","methodSignature","classDeclarationRegex","match","position","index","length","substring","codeToInject","returnStatementRegex","returnStatementMatch","insertPosition","methodRegex","methodContent","openBraceIndex","indexOf","modifiedMethod","classEndRegex","classEndMatch","deepLinkMarker","modifiedReturnStatement","factoryStartRegex","test","result","CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET","replacementCode"],"sources":["withCIOIosSwift.ts"],"sourcesContent":["import type {\n ExportedConfigWithProps,\n XcodeProject,\n} from '@expo/config-plugins';\nimport { withAppDelegate, withXcodeProject } from '@expo/config-plugins';\nimport type { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\nimport { PLATFORM } from '../helpers/constants/common';\nimport {\n CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET,\n CIO_MESSAGING_PUSH_APP_DELEGATE_INIT_REGEX,\n CIO_NATIVE_SDK_INITIALIZE_CALL,\n CIO_NATIVE_SDK_INITIALIZE_SNIPPET,\n CIO_REGISTER_PUSHNOTIFICATION_SNIPPET_v2,\n CIO_REGISTER_PUSH_NOTIFICATION_PLACEHOLDER,\n} from '../helpers/constants/ios';\nimport { replaceCodeByRegex } from '../helpers/utils/codeInjection';\nimport { FileManagement } from '../helpers/utils/fileManagement';\nimport { patchNativeSDKInitializer } from '../helpers/utils/patchPluginNativeCode';\nimport type {\n CustomerIOPluginOptionsIOS,\n CustomerIOPluginLocationOptions,\n NativeSDKConfig,\n} from '../types/cio-types';\nimport { logger } from '../utils/logger';\nimport { getIosNativeFilesPath } from '../utils/plugin';\nimport { copyFileToXcode, getOrCreateCustomerIOGroup } from '../utils/xcode';\nimport { isFcmPushProvider } from './utils';\n\n// Constants\nconst CIO_SDK_APP_DELEGATE_HANDLER_CLASS = 'CioSdkAppDelegateHandler';\nconst CIO_SDK_APP_DELEGATE_HANDLER_FILENAME = `${CIO_SDK_APP_DELEGATE_HANDLER_CLASS}.swift`;\n\n/**\n * Copy and configure the CioSdkAppDelegateHandler.swift file\n */\nconst copyAndConfigureAppDelegateHandler = (\n config: ExportedConfigWithProps<XcodeProject>,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsIOS,\n location?: CustomerIOPluginLocationOptions,\n): ExportedConfigWithProps<XcodeProject> => {\n // Destination path in the iOS project\n const projectName = config.modRequest.projectName || '';\n if (!projectName) {\n logger.warn(\n 'Project name is undefined, cannot copy CustomerIO files'\n );\n return config;\n }\n\n // Add files to the Xcode project\n const xcodeProject = config.modResults;\n const projectRoot = config.modRequest.projectRoot;\n const iosProjectRoot = path.join(projectRoot, 'ios');\n\n const group = getOrCreateCustomerIOGroup(xcodeProject, projectName);\n if (props?.pushNotification) {\n // Copy CioSdkAppDelegateHandler.swift for full push notification + auto-init support\n copyAndConfigurePushAppDelegateHandler({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n props,\n location,\n });\n } else if (sdkConfig) {\n // Copy only CustomerIOSDKInitializer.swift for auto-init without push notifications\n copyAndConfigureNativeSDKInitializer({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n location,\n });\n }\n\n return config;\n};\n\nconst copyAndConfigurePushAppDelegateHandler = ({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n props,\n location,\n}: {\n xcodeProject: XcodeProject;\n group: XcodeProject['pbxCreateGroup'];\n iosProjectRoot: string;\n projectName: string;\n sdkConfig: NativeSDKConfig | undefined;\n props: CustomerIOPluginOptionsIOS;\n location?: CustomerIOPluginLocationOptions;\n}) => {\n const useFcm = isFcmPushProvider(props);\n\n // Source path for the handler file\n const handlerSourcePath = path.join(\n getIosNativeFilesPath(),\n useFcm ? 'fcm' : 'apn',\n CIO_SDK_APP_DELEGATE_HANDLER_FILENAME\n );\n\n const handlerDestPath = path.join(\n iosProjectRoot,\n projectName,\n CIO_SDK_APP_DELEGATE_HANDLER_FILENAME\n );\n\n FileManagement.copyFile(handlerSourcePath, handlerDestPath);\n\n // Add the file to the Xcode project\n xcodeProject.addSourceFile(\n `${projectName}/${CIO_SDK_APP_DELEGATE_HANDLER_FILENAME}`,\n null,\n group\n );\n\n let handlerFileContent = FileManagement.readFile(handlerDestPath);\n\n const disableNotificationRegistration =\n props.pushNotification?.disableNotificationRegistration;\n let snippet = '';\n // unless this property is explicity set to true, push notification\n // registration will be added to the AppDelegate\n if (disableNotificationRegistration !== true) {\n snippet = CIO_REGISTER_PUSHNOTIFICATION_SNIPPET_v2;\n }\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n CIO_REGISTER_PUSH_NOTIFICATION_PLACEHOLDER,\n snippet\n );\n\n const autoTrackPushEvents =\n props.pushNotification?.autoTrackPushEvents !== false;\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{AUTO_TRACK_PUSH_EVENTS\\}\\}/,\n autoTrackPushEvents.toString()\n );\n\n const autoFetchDeviceToken =\n props.pushNotification?.autoFetchDeviceToken !== false;\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{AUTO_FETCH_DEVICE_TOKEN\\}\\}/,\n autoFetchDeviceToken.toString()\n );\n\n const showPushAppInForeground =\n props.pushNotification?.showPushAppInForeground !== false;\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{SHOW_PUSH_APP_IN_FOREGROUND\\}\\}/,\n showPushAppInForeground.toString()\n );\n\n const appGroupId = props.pushNotification?.appGroupId;\n const appGroupIdBuilderLine = appGroupId\n ? ` .appGroupId(${JSON.stringify(appGroupId)})\\n`\n : '';\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{APP_GROUP_ID_BUILDER_LINE\\}\\}/,\n appGroupIdBuilderLine\n );\n\n // Add auto initialization if sdkConfig is provided\n if (sdkConfig) {\n // Also copy CustomerIOSDKInitializer.swift for auto-initialization\n copyAndConfigureNativeSDKInitializer({ xcodeProject, group, iosProjectRoot, projectName, sdkConfig, location });\n\n // Inject auto initialization call before MessagingPush initialization\n handlerFileContent = handlerFileContent.replace(CIO_MESSAGING_PUSH_APP_DELEGATE_INIT_REGEX, CIO_NATIVE_SDK_INITIALIZE_SNIPPET + '$1');\n }\n\n FileManagement.writeFile(handlerDestPath, handlerFileContent);\n};\n\nconst copyAndConfigureNativeSDKInitializer = ({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n location,\n}: {\n xcodeProject: XcodeProject;\n group: XcodeProject['pbxCreateGroup'];\n iosProjectRoot: string;\n projectName: string;\n sdkConfig: NativeSDKConfig;\n location?: CustomerIOPluginLocationOptions;\n}) => {\n const locationOptions = location\n ? { enabled: location.enabled === true, trackingMode: sdkConfig?.location?.trackingMode }\n : undefined;\n const filename = 'CustomerIOSDKInitializer.swift';\n const sourcePath = path.join(getIosNativeFilesPath(), filename);\n // Add the CustomerIOSDKInitializer.swift file to the same Xcode group as CioSdkAppDelegateHandler\n copyFileToXcode({\n xcodeProject,\n iosProjectRoot,\n projectName,\n sourceFilePath: sourcePath,\n targetFileName: filename,\n transform: (content) =>\n patchNativeSDKInitializer(content, PLATFORM.IOS, sdkConfig, locationOptions),\n customerIOGroup: group,\n });\n};\n\nexport const withCIOIosSwift = (\n configOuter: ExpoConfig,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsIOS,\n location?: CustomerIOPluginLocationOptions,\n) => {\n // First, copy required swift files to iOS folder and add it to Xcode project\n configOuter = withXcodeProject(configOuter, async (config) => {\n return copyAndConfigureAppDelegateHandler(config, sdkConfig, props, location);\n });\n\n // Modify the AppDelegate based on configuration\n if (props?.pushNotification) {\n // With push notifications: delegate to CioSdkAppDelegateHandler for both push and auto-init\n return withAppDelegate(configOuter, async (config) => {\n return modifyAppDelegateWithPushAppDelegateHandler(config, props);\n });\n } else if (sdkConfig) {\n // Without push notifications: directly inject auto initialization into AppDelegate\n return withAppDelegate(configOuter, async (config) => {\n return modifyAppDelegateWithNativeSDKInitializer(config);\n });\n } else {\n return configOuter;\n }\n};\n\n/**\n * Modify the AppDelegate to integrate with Customer.io SDK\n */\nconst modifyAppDelegateWithPushAppDelegateHandler = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n config: any,\n props: CustomerIOPluginOptionsIOS\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any => {\n const appDelegateContent = config.modResults.contents;\n\n // Check if modifications have already been applied\n if (appDelegateContent.includes(CIO_SDK_APP_DELEGATE_HANDLER_CLASS)) {\n logger.info(\n 'CustomerIO Swift AppDelegate changes already exist. Skipping...'\n );\n return config;\n }\n\n // Add the handler property declaration\n let modifiedContent = addHandlerPropertyDeclaration(appDelegateContent);\n\n // Modify didFinishLaunchingWithOptions to initialize and call the handler\n modifiedContent = modifyDidFinishLaunchingWithOptions(\n modifiedContent,\n ` cioSdkHandler.application(application, didFinishLaunchingWithOptions: launchOptions)\\n\\n `\n );\n\n // Add didRegisterForRemoteNotificationsWithDeviceToken implementation\n modifiedContent =\n addDidRegisterForRemoteNotificationsWithDeviceToken(modifiedContent);\n\n // Add didFailToRegisterForRemoteNotificationsWithError implementation\n modifiedContent =\n addDidFailToRegisterForRemoteNotificationsWithError(modifiedContent);\n\n // Add deep link handling for killed state if enabled\n if (props.pushNotification?.handleDeeplinkInKilledState === true) {\n modifiedContent = addHandleDeeplinkInKilledState(modifiedContent);\n }\n\n config.modResults.contents = modifiedContent;\n return config;\n};\n\n/**\n * Modify the AppDelegate to integrate with Customer.io SDK\n */\nconst modifyAppDelegateWithNativeSDKInitializer = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n config: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any => {\n const appDelegateContent = config.modResults.contents;\n\n // Check if modifications have already been applied\n if (appDelegateContent.includes(CIO_NATIVE_SDK_INITIALIZE_CALL)) {\n logger.info(\n 'CustomerIO Swift AppDelegate changes already exist. Skipping...'\n );\n return config;\n }\n\n // Modify didFinishLaunchingWithOptions to initialize and call the handler\n const modifiedContent = modifyDidFinishLaunchingWithOptions(\n appDelegateContent,\n CIO_NATIVE_SDK_INITIALIZE_SNIPPET,\n );\n\n config.modResults.contents = modifiedContent;\n return config;\n};\n\n/**\n * Check if a method exists in the AppDelegate content\n * @param content The AppDelegate content\n * @param methodSignature The method signature to check for\n * @returns true if the method exists, false otherwise\n */\nconst methodExistsInAppDelegate = (\n content: string,\n methodSignature: string\n): boolean => {\n return content.includes(methodSignature);\n};\n\n/**\n * Add handler property declaration to the AppDelegate class\n * This adds the line: let cioSdkHandler = CioSdkAppDelegateHandler()\n * to the AppDelegate class\n */\nconst addHandlerPropertyDeclaration = (content: string): string => {\n // Look for the AppDelegate class declaration\n const classDeclarationRegex = /class\\s+AppDelegate\\s*:\\s*.*\\s*{/;\n const match = content.match(classDeclarationRegex);\n\n if (!match) {\n logger.warn('Could not find AppDelegate class declaration');\n return content;\n }\n\n const position = (match.index ?? 0) + match[0].length;\n return (\n content.substring(0, position) +\n `\\n let cioSdkHandler = ${CIO_SDK_APP_DELEGATE_HANDLER_CLASS}()\\n` +\n content.substring(position)\n );\n};\n\n/**\n * Modify didFinishLaunchingWithOptions to inject Customer.io code\n * Injects the provided code (either handler call or auto initialization) before the return statement\n */\nconst modifyDidFinishLaunchingWithOptions = (content: string, codeToInject: string): string => {\n // Find the return statement in didFinishLaunchingWithOptions\n // Always look for launchOptions since modifiedLaunchOptions is only set later\n const returnStatementRegex =\n /return\\s+super\\.application\\s*\\(\\s*application\\s*,\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\)/;\n\n const returnStatementMatch = content.match(returnStatementRegex);\n\n if (!returnStatementMatch) {\n logger.warn(\n 'Could not find return statement with super.application in didFinishLaunchingWithOptions'\n );\n return content;\n }\n\n // Inject Customer.io code before the return statement\n const insertPosition = returnStatementMatch.index ?? 0;\n\n return (\n content.substring(0, insertPosition) +\n codeToInject +\n content.substring(insertPosition)\n );\n};\n\n/**\n * Add or modify didRegisterForRemoteNotificationsWithDeviceToken implementation\n * If the method already exists, it adds the handler call to the existing method\n * If the method doesn't exist, it adds a new method implementation\n */\nconst addDidRegisterForRemoteNotificationsWithDeviceToken = (\n content: string\n): string => {\n const methodSignature =\n 'func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken:';\n\n // Check if method already exists\n if (methodExistsInAppDelegate(content, methodSignature)) {\n // Method exists, modify it to call our handler\n const methodRegex =\n /func\\s+application\\s*\\(\\s*_\\s+application\\s*:\\s*UIApplication\\s*,\\s*didRegisterForRemoteNotificationsWithDeviceToken\\s+deviceToken\\s*:\\s*Data\\s*\\)\\s*{[\\s\\S]*?}/;\n const match = content.match(methodRegex);\n\n if (match) {\n // Add our handler call to the existing method\n const methodContent = match[0];\n const openBraceIndex = methodContent.indexOf('{') + 1;\n const modifiedMethod =\n methodContent.substring(0, openBraceIndex) +\n '\\n // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)\\n' +\n methodContent.substring(openBraceIndex);\n\n return content.replace(methodRegex, modifiedMethod);\n }\n\n return content;\n } else {\n // Method doesn't exist, add it inside the AppDelegate class\n // Find the end of the AppDelegate class\n const classEndRegex = /^}(\\s*$|\\s*\\/\\/)/m;\n const classEndMatch = content.match(classEndRegex);\n\n if (!classEndMatch) {\n logger.warn('Could not find end of AppDelegate class');\n return content;\n }\n\n // Insert the method inside the class\n const position = classEndMatch.index ?? 0;\n return (\n content.substring(0, position) +\n '\\n // Handle device token registration\\n' +\n ' public override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\\n' +\n ' // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)\\n' +\n ' super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)\\n' +\n ' }\\n' +\n content.substring(position)\n );\n }\n};\n\n/**\n * Add or modify didFailToRegisterForRemoteNotificationsWithError implementation\n * If the method already exists, it adds the handler call to the existing method\n * If the method doesn't exist, it adds a new method implementation\n */\nconst addDidFailToRegisterForRemoteNotificationsWithError = (\n content: string\n): string => {\n const methodSignature =\n 'func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error:';\n\n // Check if method already exists\n if (methodExistsInAppDelegate(content, methodSignature)) {\n // Method exists, modify it to call our handler\n const methodRegex =\n /func\\s+application\\s*\\(\\s*_\\s+application\\s*:\\s*UIApplication\\s*,\\s*didFailToRegisterForRemoteNotificationsWithError\\s+error\\s*:\\s*Error\\s*\\)\\s*{[\\s\\S]*?}/;\n const match = content.match(methodRegex);\n\n if (match) {\n // Add our handler call to the existing method\n const methodContent = match[0];\n const openBraceIndex = methodContent.indexOf('{') + 1;\n const modifiedMethod =\n methodContent.substring(0, openBraceIndex) +\n '\\n // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didFailToRegisterForRemoteNotificationsWithError: error)\\n' +\n methodContent.substring(openBraceIndex);\n\n return content.replace(methodRegex, modifiedMethod);\n }\n\n return content;\n } else {\n // Method doesn't exist, add it inside the AppDelegate class\n // Find the end of the AppDelegate class\n const classEndRegex = /^}(\\s*$|\\s*\\/\\/)/m;\n const classEndMatch = content.match(classEndRegex);\n\n if (!classEndMatch) {\n logger.warn('Could not find end of AppDelegate class');\n return content;\n }\n\n // Insert the method inside the class\n const position = classEndMatch.index ?? 0;\n return (\n content.substring(0, position) +\n '\\n // Handle remote notification registration errors\\n' +\n ' public override func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {\\n' +\n ' // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didFailToRegisterForRemoteNotificationsWithError: error)\\n' +\n ' super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)\\n' +\n ' }\\n' +\n content.substring(position)\n );\n }\n};\n\n/**\n * Add deep link handling for killed state\n *\n * On modern Expo Swift templates, RN is bootstrapped by `factory.startReactNative(...)`\n * inside an `#if os(iOS) || os(tvOS)` guard, *before* the trailing `return super.application(...)`.\n * The deep-link block must run before that call so `modifiedLaunchOptions` flows into RN's\n * initial launchOptions; otherwise the workaround is a no-op.\n *\n * For older templates (no `factory.startReactNative` — `super.application(...)` is what\n * starts RN), the snippet is injected before the return statement as before.\n */\nconst addHandleDeeplinkInKilledState = (content: string): string => {\n const deepLinkMarker = 'Deep link workaround for app killed state start';\n if (content.includes(deepLinkMarker)) {\n return content;\n }\n\n const returnStatementRegex =\n /return\\s+super\\.application\\s*\\(\\s*application\\s*,\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\)/;\n const modifiedReturnStatement =\n 'return super.application(application, didFinishLaunchingWithOptions: modifiedLaunchOptions)';\n\n const factoryStartRegex =\n /(\\s*)#if\\s+os\\(iOS\\)\\s*\\|\\|\\s*os\\(tvOS\\)([\\s\\S]*?factory\\.startReactNative\\s*\\([\\s\\S]*?launchOptions:\\s*)launchOptions(\\s*\\)[\\s\\S]*?#endif)/;\n\n if (factoryStartRegex.test(content)) {\n let result = content.replace(\n factoryStartRegex,\n `\\n${CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET}\\n#if os(iOS) || os(tvOS)$2modifiedLaunchOptions$3`\n );\n if (returnStatementRegex.test(result)) {\n result = result.replace(returnStatementRegex, modifiedReturnStatement);\n }\n return result;\n }\n\n if (!returnStatementRegex.test(content)) {\n logger.warn('Could not find return statement with launchOptions');\n return content;\n }\n const replacementCode =\n CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET +\n '\\n\\n ' +\n modifiedReturnStatement;\n return content.replace(returnStatementRegex, replacementCode);\n};\n"],"mappings":";;;;;;AAIA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAQA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAP,OAAA;AAMA,IAAAQ,OAAA,GAA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AAC,EAAEH,QAAQ,CAAC,GAC9B,yDAAyD,GACzD,qIAAqI,GACrI,sCAAsC,GACtC,uGAAuG,GACvG,+FAA+F,GAC/F,OAAO,GACP7B,OAAO,CAACgC,SAAS,CAACH,QAAQ,CAAC;EAE/B;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMN,8BAA8B,GAAIvB,OAAe,IAAa;EAClE,MAAM4C,cAAc,GAAG,iDAAiD;EACxE,IAAI5C,OAAO,CAACe,QAAQ,CAAC6B,cAAc,CAAC,EAAE;IACpC,OAAO5C,OAAO;EAChB;EAEA,MAAMkC,oBAAoB,GACxB,6GAA6G;EAC/G,MAAMW,uBAAuB,GAC3B,6FAA6F;EAE/F,MAAMC,iBAAiB,GACrB,6IAA6I;EAE/I,IAAIA,iBAAiB,CAACC,IAAI,CAAC/C,OAAO,CAAC,EAAE;IACnC,IAAIgD,MAAM,GAAGhD,OAAO,CAACf,OAAO,CAC1B6D,iBAAiB,EACjB,KAAKG,oDAA+C,oDACtD,CAAC;IACD,IAAIf,oBAAoB,CAACa,IAAI,CAACC,MAAM,CAAC,EAAE;MACrCA,MAAM,GAAGA,MAAM,CAAC/D,OAAO,CAACiD,oBAAoB,EAAEW,uBAAuB,CAAC;IACxE;IACA,OAAOG,MAAM;EACf;EAEA,IAAI,CAACd,oBAAoB,CAACa,IAAI,CAAC/C,OAAO,CAAC,EAAE;IACvCxD,cAAM,CAACC,IAAI,CAAC,oDAAoD,CAAC;IACjE,OAAOuD,OAAO;EAChB;EACA,MAAMkD,eAAe,GACnBD,oDAA+C,GAC/C,UAAU,GACVJ,uBAAuB;EACzB,OAAO7C,OAAO,CAACf,OAAO,CAACiD,oBAAoB,EAAEgB,eAAe,CAAC;AAC/D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_configPlugins","require","_path","_interopRequireDefault","_common","_ios","_codeInjection","_fileManagement","_patchPluginNativeCode","_logger","_plugin","_xcode","_utils","e","__esModule","default","CIO_SDK_APP_DELEGATE_HANDLER_CLASS","CIO_SDK_APP_DELEGATE_HANDLER_FILENAME","copyAndConfigureAppDelegateHandler","config","sdkConfig","props","location","projectName","modRequest","logger","warn","xcodeProject","modResults","projectRoot","iosProjectRoot","path","join","group","getOrCreateCustomerIOGroup","pushNotification","copyAndConfigurePushAppDelegateHandler","copyAndConfigureNativeSDKInitializer","_props$pushNotificati","_props$pushNotificati2","_props$pushNotificati3","_props$pushNotificati4","_props$pushNotificati5","useFcm","isFcmPushProvider","handlerSourcePath","getIosNativeFilesPath","handlerDestPath","FileManagement","copyFile","addSourceFile","handlerFileContent","readFile","disableNotificationRegistration","snippet","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET_v2","replaceCodeByRegex","CIO_REGISTER_PUSH_NOTIFICATION_PLACEHOLDER","autoTrackPushEvents","toString","autoFetchDeviceToken","showPushAppInForeground","appGroupId","appGroupIdBuilderLine","JSON","stringify","replace","CIO_MESSAGING_PUSH_APP_DELEGATE_INIT_REGEX","CIO_NATIVE_SDK_INITIALIZE_SNIPPET","writeFile","_sdkConfig$location","locationOptions","enabled","trackingMode","undefined","filename","sourcePath","copyFileToXcode","sourceFilePath","targetFileName","transform","content","patchNativeSDKInitializer","PLATFORM","IOS","customerIOGroup","withCIOIosSwift","configOuter","withXcodeProject","withAppDelegate","contents","modifyAppDelegateForPushHandler","modifyAppDelegateForNativeSDKInitializer","exports","_props$pushNotificati6","includes","info","next","addHandlerPropertyDeclaration","modifyDidFinishLaunchingWithOptions","addDidRegisterForRemoteNotificationsWithDeviceToken","addDidFailToRegisterForRemoteNotificationsWithError","handleDeeplinkInKilledState","addHandleDeeplinkInKilledState","CIO_NATIVE_SDK_INITIALIZE_CALL","methodExistsInAppDelegate","methodSignature","classDeclarationRegex","match","position","index","length","substring","codeToInject","returnStatementRegex","returnStatementMatch","insertPosition","methodRegex","methodContent","openBraceIndex","indexOf","modifiedMethod","classEndRegex","classEndMatch","deepLinkMarker","modifiedReturnStatement","factoryStartRegex","test","result","CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET","replacementCode"],"sources":["withCIOIosSwift.ts"],"sourcesContent":["import type {\n ExportedConfigWithProps,\n XcodeProject,\n} from '@expo/config-plugins';\nimport { withAppDelegate, withXcodeProject } from '@expo/config-plugins';\nimport type { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\nimport { PLATFORM } from '../helpers/constants/common';\nimport {\n CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET,\n CIO_MESSAGING_PUSH_APP_DELEGATE_INIT_REGEX,\n CIO_NATIVE_SDK_INITIALIZE_CALL,\n CIO_NATIVE_SDK_INITIALIZE_SNIPPET,\n CIO_REGISTER_PUSHNOTIFICATION_SNIPPET_v2,\n CIO_REGISTER_PUSH_NOTIFICATION_PLACEHOLDER,\n} from '../helpers/constants/ios';\nimport { replaceCodeByRegex } from '../helpers/utils/codeInjection';\nimport { FileManagement } from '../helpers/utils/fileManagement';\nimport { patchNativeSDKInitializer } from '../helpers/utils/patchPluginNativeCode';\nimport type {\n CustomerIOPluginOptionsIOS,\n CustomerIOPluginLocationOptions,\n NativeSDKConfig,\n} from '../types/cio-types';\nimport { logger } from '../utils/logger';\nimport { getIosNativeFilesPath } from '../utils/plugin';\nimport { copyFileToXcode, getOrCreateCustomerIOGroup } from '../utils/xcode';\nimport { isFcmPushProvider } from './utils';\n\n// Constants\nconst CIO_SDK_APP_DELEGATE_HANDLER_CLASS = 'CioSdkAppDelegateHandler';\nconst CIO_SDK_APP_DELEGATE_HANDLER_FILENAME = `${CIO_SDK_APP_DELEGATE_HANDLER_CLASS}.swift`;\n\n/**\n * Copy and configure the CioSdkAppDelegateHandler.swift file\n */\nconst copyAndConfigureAppDelegateHandler = (\n config: ExportedConfigWithProps<XcodeProject>,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsIOS,\n location?: CustomerIOPluginLocationOptions,\n): ExportedConfigWithProps<XcodeProject> => {\n // Destination path in the iOS project\n const projectName = config.modRequest.projectName || '';\n if (!projectName) {\n logger.warn(\n 'Project name is undefined, cannot copy CustomerIO files'\n );\n return config;\n }\n\n // Add files to the Xcode project\n const xcodeProject = config.modResults;\n const projectRoot = config.modRequest.projectRoot;\n const iosProjectRoot = path.join(projectRoot, 'ios');\n\n const group = getOrCreateCustomerIOGroup(xcodeProject, projectName);\n if (props?.pushNotification) {\n // Copy CioSdkAppDelegateHandler.swift for full push notification + auto-init support\n copyAndConfigurePushAppDelegateHandler({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n props,\n location,\n });\n } else if (sdkConfig) {\n // Copy only CustomerIOSDKInitializer.swift for auto-init without push notifications\n copyAndConfigureNativeSDKInitializer({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n location,\n });\n }\n\n return config;\n};\n\nconst copyAndConfigurePushAppDelegateHandler = ({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n props,\n location,\n}: {\n xcodeProject: XcodeProject;\n group: XcodeProject['pbxCreateGroup'];\n iosProjectRoot: string;\n projectName: string;\n sdkConfig: NativeSDKConfig | undefined;\n props: CustomerIOPluginOptionsIOS;\n location?: CustomerIOPluginLocationOptions;\n}) => {\n const useFcm = isFcmPushProvider(props);\n\n // Source path for the handler file\n const handlerSourcePath = path.join(\n getIosNativeFilesPath(),\n useFcm ? 'fcm' : 'apn',\n CIO_SDK_APP_DELEGATE_HANDLER_FILENAME\n );\n\n const handlerDestPath = path.join(\n iosProjectRoot,\n projectName,\n CIO_SDK_APP_DELEGATE_HANDLER_FILENAME\n );\n\n FileManagement.copyFile(handlerSourcePath, handlerDestPath);\n\n // Add the file to the Xcode project\n xcodeProject.addSourceFile(\n `${projectName}/${CIO_SDK_APP_DELEGATE_HANDLER_FILENAME}`,\n null,\n group\n );\n\n let handlerFileContent = FileManagement.readFile(handlerDestPath);\n\n const disableNotificationRegistration =\n props.pushNotification?.disableNotificationRegistration;\n let snippet = '';\n // unless this property is explicity set to true, push notification\n // registration will be added to the AppDelegate\n if (disableNotificationRegistration !== true) {\n snippet = CIO_REGISTER_PUSHNOTIFICATION_SNIPPET_v2;\n }\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n CIO_REGISTER_PUSH_NOTIFICATION_PLACEHOLDER,\n snippet\n );\n\n const autoTrackPushEvents =\n props.pushNotification?.autoTrackPushEvents !== false;\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{AUTO_TRACK_PUSH_EVENTS\\}\\}/,\n autoTrackPushEvents.toString()\n );\n\n const autoFetchDeviceToken =\n props.pushNotification?.autoFetchDeviceToken !== false;\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{AUTO_FETCH_DEVICE_TOKEN\\}\\}/,\n autoFetchDeviceToken.toString()\n );\n\n const showPushAppInForeground =\n props.pushNotification?.showPushAppInForeground !== false;\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{SHOW_PUSH_APP_IN_FOREGROUND\\}\\}/,\n showPushAppInForeground.toString()\n );\n\n const appGroupId = props.pushNotification?.appGroupId;\n const appGroupIdBuilderLine = appGroupId\n ? ` .appGroupId(${JSON.stringify(appGroupId)})\\n`\n : '';\n handlerFileContent = replaceCodeByRegex(\n handlerFileContent,\n /\\{\\{APP_GROUP_ID_BUILDER_LINE\\}\\}/,\n appGroupIdBuilderLine\n );\n\n // Add auto initialization if sdkConfig is provided\n if (sdkConfig) {\n // Also copy CustomerIOSDKInitializer.swift for auto-initialization\n copyAndConfigureNativeSDKInitializer({ xcodeProject, group, iosProjectRoot, projectName, sdkConfig, location });\n\n // Inject auto initialization call before MessagingPush initialization\n handlerFileContent = handlerFileContent.replace(CIO_MESSAGING_PUSH_APP_DELEGATE_INIT_REGEX, CIO_NATIVE_SDK_INITIALIZE_SNIPPET + '$1');\n }\n\n FileManagement.writeFile(handlerDestPath, handlerFileContent);\n};\n\nconst copyAndConfigureNativeSDKInitializer = ({\n xcodeProject,\n group,\n iosProjectRoot,\n projectName,\n sdkConfig,\n location,\n}: {\n xcodeProject: XcodeProject;\n group: XcodeProject['pbxCreateGroup'];\n iosProjectRoot: string;\n projectName: string;\n sdkConfig: NativeSDKConfig;\n location?: CustomerIOPluginLocationOptions;\n}) => {\n const locationOptions = location\n ? { enabled: location.enabled === true, trackingMode: sdkConfig?.location?.trackingMode }\n : undefined;\n const filename = 'CustomerIOSDKInitializer.swift';\n const sourcePath = path.join(getIosNativeFilesPath(), filename);\n // Add the CustomerIOSDKInitializer.swift file to the same Xcode group as CioSdkAppDelegateHandler\n copyFileToXcode({\n xcodeProject,\n iosProjectRoot,\n projectName,\n sourceFilePath: sourcePath,\n targetFileName: filename,\n transform: (content) =>\n patchNativeSDKInitializer(content, PLATFORM.IOS, sdkConfig, locationOptions),\n customerIOGroup: group,\n });\n};\n\nexport const withCIOIosSwift = (\n configOuter: ExpoConfig,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsIOS,\n location?: CustomerIOPluginLocationOptions,\n) => {\n // First, copy required swift files to iOS folder and add it to Xcode project\n configOuter = withXcodeProject(configOuter, async (config) => {\n return copyAndConfigureAppDelegateHandler(config, sdkConfig, props, location);\n });\n\n // Modify the AppDelegate based on configuration\n if (props?.pushNotification) {\n // With push notifications: delegate to CioSdkAppDelegateHandler for both push and auto-init\n return withAppDelegate(configOuter, async (config) => {\n config.modResults.contents = modifyAppDelegateForPushHandler(\n config.modResults.contents,\n props\n );\n return config;\n });\n } else if (sdkConfig) {\n // Without push notifications: directly inject auto initialization into AppDelegate\n return withAppDelegate(configOuter, async (config) => {\n config.modResults.contents = modifyAppDelegateForNativeSDKInitializer(\n config.modResults.contents\n );\n return config;\n });\n } else {\n return configOuter;\n }\n};\n\n/**\n * Pure string transform: produces the Swift AppDelegate contents wired to delegate to\n * `CioSdkAppDelegateHandler` for both push notifications and (when configured) auto-init.\n * Idempotent — returns `contents` unchanged when the handler is already present.\n */\nexport function modifyAppDelegateForPushHandler(\n contents: string,\n props: CustomerIOPluginOptionsIOS\n): string {\n if (contents.includes(CIO_SDK_APP_DELEGATE_HANDLER_CLASS)) {\n logger.info(\n 'CustomerIO Swift AppDelegate changes already exist. Skipping...'\n );\n return contents;\n }\n\n let next = addHandlerPropertyDeclaration(contents);\n next = modifyDidFinishLaunchingWithOptions(\n next,\n ` cioSdkHandler.application(application, didFinishLaunchingWithOptions: launchOptions)\\n\\n `\n );\n next = addDidRegisterForRemoteNotificationsWithDeviceToken(next);\n next = addDidFailToRegisterForRemoteNotificationsWithError(next);\n\n if (props.pushNotification?.handleDeeplinkInKilledState === true) {\n next = addHandleDeeplinkInKilledState(next);\n }\n\n return next;\n}\n\n/**\n * Pure string transform: injects the auto-init snippet into the Swift AppDelegate's\n * didFinishLaunchingWithOptions for the no-push path. Idempotent.\n */\nexport function modifyAppDelegateForNativeSDKInitializer(contents: string): string {\n if (contents.includes(CIO_NATIVE_SDK_INITIALIZE_CALL)) {\n logger.info(\n 'CustomerIO Swift AppDelegate changes already exist. Skipping...'\n );\n return contents;\n }\n\n return modifyDidFinishLaunchingWithOptions(\n contents,\n CIO_NATIVE_SDK_INITIALIZE_SNIPPET,\n );\n}\n\n/**\n * Check if a method exists in the AppDelegate content\n * @param content The AppDelegate content\n * @param methodSignature The method signature to check for\n * @returns true if the method exists, false otherwise\n */\nconst methodExistsInAppDelegate = (\n content: string,\n methodSignature: string\n): boolean => {\n return content.includes(methodSignature);\n};\n\n/**\n * Add handler property declaration to the AppDelegate class\n * This adds the line: let cioSdkHandler = CioSdkAppDelegateHandler()\n * to the AppDelegate class\n */\nconst addHandlerPropertyDeclaration = (content: string): string => {\n // Look for the AppDelegate class declaration\n const classDeclarationRegex = /class\\s+AppDelegate\\s*:\\s*.*\\s*{/;\n const match = content.match(classDeclarationRegex);\n\n if (!match) {\n logger.warn('Could not find AppDelegate class declaration');\n return content;\n }\n\n const position = (match.index ?? 0) + match[0].length;\n return (\n content.substring(0, position) +\n `\\n let cioSdkHandler = ${CIO_SDK_APP_DELEGATE_HANDLER_CLASS}()\\n` +\n content.substring(position)\n );\n};\n\n/**\n * Modify didFinishLaunchingWithOptions to inject Customer.io code\n * Injects the provided code (either handler call or auto initialization) before the return statement\n */\nconst modifyDidFinishLaunchingWithOptions = (content: string, codeToInject: string): string => {\n // Find the return statement in didFinishLaunchingWithOptions\n // Always look for launchOptions since modifiedLaunchOptions is only set later\n const returnStatementRegex =\n /return\\s+super\\.application\\s*\\(\\s*application\\s*,\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\)/;\n\n const returnStatementMatch = content.match(returnStatementRegex);\n\n if (!returnStatementMatch) {\n logger.warn(\n 'Could not find return statement with super.application in didFinishLaunchingWithOptions'\n );\n return content;\n }\n\n // Inject Customer.io code before the return statement\n const insertPosition = returnStatementMatch.index ?? 0;\n\n return (\n content.substring(0, insertPosition) +\n codeToInject +\n content.substring(insertPosition)\n );\n};\n\n/**\n * Add or modify didRegisterForRemoteNotificationsWithDeviceToken implementation\n * If the method already exists, it adds the handler call to the existing method\n * If the method doesn't exist, it adds a new method implementation\n */\nconst addDidRegisterForRemoteNotificationsWithDeviceToken = (\n content: string\n): string => {\n const methodSignature =\n 'func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken:';\n\n // Check if method already exists\n if (methodExistsInAppDelegate(content, methodSignature)) {\n // Method exists, modify it to call our handler\n const methodRegex =\n /func\\s+application\\s*\\(\\s*_\\s+application\\s*:\\s*UIApplication\\s*,\\s*didRegisterForRemoteNotificationsWithDeviceToken\\s+deviceToken\\s*:\\s*Data\\s*\\)\\s*{[\\s\\S]*?}/;\n const match = content.match(methodRegex);\n\n if (match) {\n // Add our handler call to the existing method\n const methodContent = match[0];\n const openBraceIndex = methodContent.indexOf('{') + 1;\n const modifiedMethod =\n methodContent.substring(0, openBraceIndex) +\n '\\n // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)\\n' +\n methodContent.substring(openBraceIndex);\n\n return content.replace(methodRegex, modifiedMethod);\n }\n\n return content;\n } else {\n // Method doesn't exist, add it inside the AppDelegate class\n // Find the end of the AppDelegate class\n const classEndRegex = /^}(\\s*$|\\s*\\/\\/)/m;\n const classEndMatch = content.match(classEndRegex);\n\n if (!classEndMatch) {\n logger.warn('Could not find end of AppDelegate class');\n return content;\n }\n\n // Insert the method inside the class\n const position = classEndMatch.index ?? 0;\n return (\n content.substring(0, position) +\n '\\n // Handle device token registration\\n' +\n ' public override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\\n' +\n ' // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)\\n' +\n ' super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)\\n' +\n ' }\\n' +\n content.substring(position)\n );\n }\n};\n\n/**\n * Add or modify didFailToRegisterForRemoteNotificationsWithError implementation\n * If the method already exists, it adds the handler call to the existing method\n * If the method doesn't exist, it adds a new method implementation\n */\nconst addDidFailToRegisterForRemoteNotificationsWithError = (\n content: string\n): string => {\n const methodSignature =\n 'func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error:';\n\n // Check if method already exists\n if (methodExistsInAppDelegate(content, methodSignature)) {\n // Method exists, modify it to call our handler\n const methodRegex =\n /func\\s+application\\s*\\(\\s*_\\s+application\\s*:\\s*UIApplication\\s*,\\s*didFailToRegisterForRemoteNotificationsWithError\\s+error\\s*:\\s*Error\\s*\\)\\s*{[\\s\\S]*?}/;\n const match = content.match(methodRegex);\n\n if (match) {\n // Add our handler call to the existing method\n const methodContent = match[0];\n const openBraceIndex = methodContent.indexOf('{') + 1;\n const modifiedMethod =\n methodContent.substring(0, openBraceIndex) +\n '\\n // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didFailToRegisterForRemoteNotificationsWithError: error)\\n' +\n methodContent.substring(openBraceIndex);\n\n return content.replace(methodRegex, modifiedMethod);\n }\n\n return content;\n } else {\n // Method doesn't exist, add it inside the AppDelegate class\n // Find the end of the AppDelegate class\n const classEndRegex = /^}(\\s*$|\\s*\\/\\/)/m;\n const classEndMatch = content.match(classEndRegex);\n\n if (!classEndMatch) {\n logger.warn('Could not find end of AppDelegate class');\n return content;\n }\n\n // Insert the method inside the class\n const position = classEndMatch.index ?? 0;\n return (\n content.substring(0, position) +\n '\\n // Handle remote notification registration errors\\n' +\n ' public override func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {\\n' +\n ' // Call CustomerIO SDK handler\\n' +\n ' cioSdkHandler.application(application, didFailToRegisterForRemoteNotificationsWithError: error)\\n' +\n ' super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)\\n' +\n ' }\\n' +\n content.substring(position)\n );\n }\n};\n\n/**\n * Add deep link handling for killed state\n *\n * On modern Expo Swift templates, RN is bootstrapped by `factory.startReactNative(...)`\n * inside an `#if os(iOS) || os(tvOS)` guard, *before* the trailing `return super.application(...)`.\n * The deep-link block must run before that call so `modifiedLaunchOptions` flows into RN's\n * initial launchOptions; otherwise the workaround is a no-op.\n *\n * For older templates (no `factory.startReactNative` — `super.application(...)` is what\n * starts RN), the snippet is injected before the return statement as before.\n */\nconst addHandleDeeplinkInKilledState = (content: string): string => {\n const deepLinkMarker = 'Deep link workaround for app killed state start';\n if (content.includes(deepLinkMarker)) {\n return content;\n }\n\n const returnStatementRegex =\n /return\\s+super\\.application\\s*\\(\\s*application\\s*,\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\)/;\n const modifiedReturnStatement =\n 'return super.application(application, didFinishLaunchingWithOptions: modifiedLaunchOptions)';\n\n const factoryStartRegex =\n /(\\s*)#if\\s+os\\(iOS\\)\\s*\\|\\|\\s*os\\(tvOS\\)([\\s\\S]*?factory\\.startReactNative\\s*\\([\\s\\S]*?launchOptions:\\s*)launchOptions(\\s*\\)[\\s\\S]*?#endif)/;\n\n if (factoryStartRegex.test(content)) {\n let result = content.replace(\n factoryStartRegex,\n `\\n${CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET}\\n#if os(iOS) || os(tvOS)$2modifiedLaunchOptions$3`\n );\n if (returnStatementRegex.test(result)) {\n result = result.replace(returnStatementRegex, modifiedReturnStatement);\n }\n return result;\n }\n\n if (!returnStatementRegex.test(content)) {\n logger.warn('Could not find return statement with launchOptions');\n return content;\n }\n const replacementCode =\n CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SWIFT_SNIPPET +\n '\\n\\n ' +\n modifiedReturnStatement;\n return content.replace(returnStatementRegex, replacementCode);\n};\n"],"mappings":";;;;;;;;AAIA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAQA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAP,OAAA;AAMA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAA4C,SAAAE,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C;AACA,MAAMG,kCAAkC,GAAG,0BAA0B;AACrE,MAAMC,qCAAqC,GAAG,GAAGD,kCAAkC,QAAQ;;AAE3F;AACA;AACA;AACA,MAAME,kCAAkC,GAAGA,CACzCC,MAA6C,EAC7CC,SAA2B,EAC3BC,KAAkC,EAClCC,QAA0C,KACA;EAC1C;EACA,MAAMC,WAAW,GAAGJ,MAAM,CAACK,UAAU,CAACD,WAAW,IAAI,EAAE;EACvD,IAAI,CAAC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,IAAIf,oBAAoB,CAACa,IAAI,CAACC,MAAM,CAAC,EAAE;MACrCA,MAAM,GAAGA,MAAM,CAAC9D,OAAO,CAACgD,oBAAoB,EAAEW,uBAAuB,CAAC;IACxE;IACA,OAAOG,MAAM;EACf;EAEA,IAAI,CAACd,oBAAoB,CAACa,IAAI,CAAC9C,OAAO,CAAC,EAAE;IACvCxD,cAAM,CAACC,IAAI,CAAC,oDAAoD,CAAC;IACjE,OAAOuD,OAAO;EAChB;EACA,MAAMiD,eAAe,GACnBD,oDAA+C,GAC/C,UAAU,GACVJ,uBAAuB;EACzB,OAAO5C,OAAO,CAACf,OAAO,CAACgD,oBAAoB,EAAEgB,eAAe,CAAC;AAC/D,CAAC","ignoreList":[]}
@@ -3,49 +3,65 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.copyGoogleServicePlistFile = copyGoogleServicePlistFile;
6
7
  exports.withGoogleServicesJsonFile = void 0;
7
8
  var _configPlugins = require("@expo/config-plugins");
8
9
  var _logger = require("../utils/logger");
9
10
  var _fileManagement = require("./../helpers/utils/fileManagement");
10
11
  var _utils = require("./utils");
12
+ /**
13
+ * Copies the FCM GoogleService-Info.plist into the iOS project (when needed) and registers it
14
+ * in the Xcode project's Resources group. Idempotent — no-ops if a plist is already present
15
+ * at either of the two well-known locations Expo / RN Firebase use.
16
+ */
17
+ function copyGoogleServicePlistFile({
18
+ iosPath,
19
+ appName,
20
+ googleServicesFile,
21
+ expoIosGoogleServicesFileSet,
22
+ xcodeProject
23
+ }) {
24
+ const destination = `${iosPath}/GoogleService-Info.plist`;
25
+ if (_fileManagement.FileManagement.exists(destination)) {
26
+ _logger.logger.info(`File already exists: ${destination}. Skipping...`);
27
+ return;
28
+ }
29
+ if (appName && _fileManagement.FileManagement.exists(`${iosPath}/${appName}/GoogleService-Info.plist`)) {
30
+ // This is where RN Firebase potentially copies GoogleService-Info.plist
31
+ // Do not copy if it's already done by Firebase to avoid conflict in Resources
32
+ _logger.logger.info(`File already exists: ${iosPath}/${appName}/GoogleService-Info.plist. Skipping...`);
33
+ return;
34
+ }
35
+ if (googleServicesFile && _fileManagement.FileManagement.exists(googleServicesFile)) {
36
+ if (expoIosGoogleServicesFileSet) {
37
+ _logger.logger.warn('Specifying both Expo ios.googleServicesFile and Customer.io ios.pushNotification.googleServicesFile can cause a conflict' + ' duplicating GoogleService-Info.plist in the iOS project resources. Please remove Customer.io ios.pushNotification.googleServicesFile');
38
+ }
39
+ try {
40
+ _fileManagement.FileManagement.copyFile(googleServicesFile, destination);
41
+ addFileToXcodeProject(xcodeProject, 'GoogleService-Info.plist');
42
+ } catch {
43
+ _logger.logger.error(`There was an error copying your GoogleService-Info.plist file. You can copy it manually into ${destination}`);
44
+ }
45
+ } else {
46
+ _logger.logger.error(`The Google Services file provided in ${googleServicesFile} doesn't seem to exist. You can copy it manually into ${destination}`);
47
+ }
48
+ }
11
49
  const withGoogleServicesJsonFile = (config, cioProps) => {
12
50
  return (0, _configPlugins.withXcodeProject)(config, async props => {
13
- var _cioProps$pushNotific;
51
+ var _cioProps$pushNotific, _config$ios;
14
52
  const useFcm = (0, _utils.isFcmPushProvider)(cioProps);
15
53
  if (!useFcm) {
16
54
  // Nothing to do, for providers other than FCM, the Google services JSON file isn't needed
17
55
  return props;
18
56
  }
19
57
  _logger.logger.info('Only specify Customer.io ios.pushNotification.googleServicesFile config if you are not already including' + ' GoogleService-Info.plist as part of Firebase integration');
20
-
21
- // googleServicesFile
22
- const iosPath = props.modRequest.platformProjectRoot;
23
- const googleServicesFile = (_cioProps$pushNotific = cioProps.pushNotification) === null || _cioProps$pushNotific === void 0 ? void 0 : _cioProps$pushNotific.googleServicesFile;
24
- const appName = props.modRequest.projectName;
25
- if (_fileManagement.FileManagement.exists(`${iosPath}/GoogleService-Info.plist`)) {
26
- _logger.logger.info(`File already exists: ${iosPath}/GoogleService-Info.plist. Skipping...`);
27
- return props;
28
- }
29
- if (_fileManagement.FileManagement.exists(`${iosPath}/${appName}/GoogleService-Info.plist`)) {
30
- // This is where RN Firebase potentially copies GoogleService-Info.plist
31
- // Do not copy if it's already done by Firebase to avoid conflict in Resources
32
- _logger.logger.info(`File already exists: ${iosPath}/${appName}/GoogleService-Info.plist. Skipping...`);
33
- return props;
34
- }
35
- if (googleServicesFile && _fileManagement.FileManagement.exists(googleServicesFile)) {
36
- var _config$ios;
37
- if ((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.googleServicesFile) {
38
- _logger.logger.warn('Specifying both Expo ios.googleServicesFile and Customer.io ios.pushNotification.googleServicesFile can cause a conflict' + ' duplicating GoogleService-Info.plist in the iOS project resources. Please remove Customer.io ios.pushNotification.googleServicesFile');
39
- }
40
- try {
41
- _fileManagement.FileManagement.copyFile(googleServicesFile, `${iosPath}/GoogleService-Info.plist`);
42
- addFileToXcodeProject(props.modResults, 'GoogleService-Info.plist');
43
- } catch {
44
- _logger.logger.error(`There was an error copying your GoogleService-Info.plist file. You can copy it manually into ${iosPath}/GoogleService-Info.plist`);
45
- }
46
- } else {
47
- _logger.logger.error(`The Google Services file provided in ${googleServicesFile} doesn't seem to exist. You can copy it manually into ${iosPath}/GoogleService-Info.plist`);
48
- }
58
+ copyGoogleServicePlistFile({
59
+ iosPath: props.modRequest.platformProjectRoot,
60
+ appName: props.modRequest.projectName,
61
+ googleServicesFile: (_cioProps$pushNotific = cioProps.pushNotification) === null || _cioProps$pushNotific === void 0 ? void 0 : _cioProps$pushNotific.googleServicesFile,
62
+ expoIosGoogleServicesFileSet: Boolean((_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.googleServicesFile),
63
+ xcodeProject: props.modResults
64
+ });
49
65
  return props;
50
66
  });
51
67
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_configPlugins","require","_logger","_fileManagement","_utils","withGoogleServicesJsonFile","config","cioProps","withXcodeProject","props","_cioProps$pushNotific","useFcm","isFcmPushProvider","logger","info","iosPath","modRequest","platformProjectRoot","googleServicesFile","pushNotification","appName","projectName","FileManagement","exists","_config$ios","ios","warn","copyFile","addFileToXcodeProject","modResults","error","exports","project","fileName","groupName","filepath","IOSConfig","XcodeUtils","ensureGroupRecursively","addResourceFileToGroup","isBuildFile"],"sources":["withGoogleServicesJsonFile.ts"],"sourcesContent":["import type { ConfigPlugin, XcodeProject } from '@expo/config-plugins';\nimport { IOSConfig, withXcodeProject } from '@expo/config-plugins';\n\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { logger } from '../utils/logger';\nimport { FileManagement } from './../helpers/utils/fileManagement';\nimport { isFcmPushProvider } from './utils';\n\nexport const withGoogleServicesJsonFile: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (config, cioProps) => {\n return withXcodeProject(config, async (props) => {\n const useFcm = isFcmPushProvider(cioProps);\n if (!useFcm) {\n // Nothing to do, for providers other than FCM, the Google services JSON file isn't needed\n return props;\n }\n\n logger.info(\n 'Only specify Customer.io ios.pushNotification.googleServicesFile config if you are not already including' +\n ' GoogleService-Info.plist as part of Firebase integration'\n );\n\n // googleServicesFile\n const iosPath = props.modRequest.platformProjectRoot;\n const googleServicesFile = cioProps.pushNotification?.googleServicesFile;\n const appName = props.modRequest.projectName;\n\n if (FileManagement.exists(`${iosPath}/GoogleService-Info.plist`)) {\n logger.info(\n `File already exists: ${iosPath}/GoogleService-Info.plist. Skipping...`\n );\n return props;\n }\n\n if (\n FileManagement.exists(`${iosPath}/${appName}/GoogleService-Info.plist`)\n ) {\n // This is where RN Firebase potentially copies GoogleService-Info.plist\n // Do not copy if it's already done by Firebase to avoid conflict in Resources\n logger.info(\n `File already exists: ${iosPath}/${appName}/GoogleService-Info.plist. Skipping...`\n );\n return props;\n }\n\n if (googleServicesFile && FileManagement.exists(googleServicesFile)) {\n if (config.ios?.googleServicesFile) {\n logger.warn(\n 'Specifying both Expo ios.googleServicesFile and Customer.io ios.pushNotification.googleServicesFile can cause a conflict' +\n ' duplicating GoogleService-Info.plist in the iOS project resources. Please remove Customer.io ios.pushNotification.googleServicesFile'\n );\n }\n\n try {\n FileManagement.copyFile(\n googleServicesFile,\n `${iosPath}/GoogleService-Info.plist`\n );\n\n addFileToXcodeProject(props.modResults, 'GoogleService-Info.plist');\n } catch {\n logger.error(\n `There was an error copying your GoogleService-Info.plist file. You can copy it manually into ${iosPath}/GoogleService-Info.plist`\n );\n }\n } else {\n logger.error(\n `The Google Services file provided in ${googleServicesFile} doesn't seem to exist. You can copy it manually into ${iosPath}/GoogleService-Info.plist`\n );\n }\n\n return props;\n });\n};\n\nfunction addFileToXcodeProject(project: XcodeProject, fileName: string) {\n const groupName = 'Resources';\n const filepath = fileName;\n\n if (!IOSConfig.XcodeUtils.ensureGroupRecursively(project, groupName)) {\n logger.error(\n `Error copying GoogleService-Info.plist. Failed to find or create '${groupName}' group in Xcode.`\n );\n return;\n }\n\n // Add GoogleService-Info.plist to the Xcode project\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n project,\n filepath,\n groupName,\n isBuildFile: true,\n });\n}\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,MAAMI,0BAEZ,GAAGA,CAACC,MAAM,EAAEC,QAAQ,KAAK;EACxB,OAAO,IAAAC,+BAAgB,EAACF,MAAM,EAAE,MAAOG,KAAK,IAAK;IAAA,IAAAC,qBAAA;IAC/C,MAAMC,MAAM,GAAG,IAAAC,wBAAiB,EAACL,QAAQ,CAAC;IAC1C,IAAI,CAACI,MAAM,EAAE;MACX;MACA,OAAOF,KAAK;IACd;IAEAI,cAAM,CAACC,IAAI,CACT,0GAA0G,GAC1G,2DACF,CAAC;;IAED;IACA,MAAMC,OAAO,GAAGN,KAAK,CAACO,UAAU,CAACC,mBAAmB;IACpD,MAAMC,kBAAkB,IAAAR,qBAAA,GAAGH,QAAQ,CAACY,gBAAgB,cAAAT,qBAA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,QAAQ;EAEzB,IAAI,CAACG,wBAAS,CAACC,UAAU,CAACC,sBAAsB,CAACN,OAAO,EAAEE,SAAS,CAAC,EAAE;IACpErB,cAAM,CAACiB,KAAK,CACV,qEAAqEI,SAAS,mBAChF,CAAC;IACD;EACF;;EAEA;EACAE,wBAAS,CAACC,UAAU,CAACE,sBAAsB,CAAC;IAC1CP,OAAO;IACPG,QAAQ;IACRD,SAAS;IACTM,WAAW,EAAE;EACf,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_configPlugins","require","_logger","_fileManagement","_utils","copyGoogleServicePlistFile","iosPath","appName","googleServicesFile","expoIosGoogleServicesFileSet","xcodeProject","destination","FileManagement","exists","logger","info","warn","copyFile","addFileToXcodeProject","error","withGoogleServicesJsonFile","config","cioProps","withXcodeProject","props","_cioProps$pushNotific","_config$ios","useFcm","isFcmPushProvider","modRequest","platformProjectRoot","projectName","pushNotification","Boolean","ios","modResults","exports","project","fileName","groupName","filepath","IOSConfig","XcodeUtils","ensureGroupRecursively","addResourceFileToGroup","isBuildFile"],"sources":["withGoogleServicesJsonFile.ts"],"sourcesContent":["import type { ConfigPlugin, XcodeProject } from '@expo/config-plugins';\nimport { IOSConfig, withXcodeProject } from '@expo/config-plugins';\n\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { logger } from '../utils/logger';\nimport { FileManagement } from './../helpers/utils/fileManagement';\nimport { isFcmPushProvider } from './utils';\n\nexport type CopyGoogleServicePlistOptions = {\n iosPath: string;\n appName: string | undefined;\n googleServicesFile: string | undefined;\n expoIosGoogleServicesFileSet: boolean;\n xcodeProject: XcodeProject;\n};\n\n/**\n * Copies the FCM GoogleService-Info.plist into the iOS project (when needed) and registers it\n * in the Xcode project's Resources group. Idempotent no-ops if a plist is already present\n * at either of the two well-known locations Expo / RN Firebase use.\n */\nexport function copyGoogleServicePlistFile({\n iosPath,\n appName,\n googleServicesFile,\n expoIosGoogleServicesFileSet,\n xcodeProject,\n}: CopyGoogleServicePlistOptions): void {\n const destination = `${iosPath}/GoogleService-Info.plist`;\n\n if (FileManagement.exists(destination)) {\n logger.info(`File already exists: ${destination}. Skipping...`);\n return;\n }\n\n if (appName && FileManagement.exists(`${iosPath}/${appName}/GoogleService-Info.plist`)) {\n // This is where RN Firebase potentially copies GoogleService-Info.plist\n // Do not copy if it's already done by Firebase to avoid conflict in Resources\n logger.info(\n `File already exists: ${iosPath}/${appName}/GoogleService-Info.plist. Skipping...`\n );\n return;\n }\n\n if (googleServicesFile && FileManagement.exists(googleServicesFile)) {\n if (expoIosGoogleServicesFileSet) {\n logger.warn(\n 'Specifying both Expo ios.googleServicesFile and Customer.io ios.pushNotification.googleServicesFile can cause a conflict' +\n ' duplicating GoogleService-Info.plist in the iOS project resources. Please remove Customer.io ios.pushNotification.googleServicesFile'\n );\n }\n\n try {\n FileManagement.copyFile(googleServicesFile, destination);\n addFileToXcodeProject(xcodeProject, 'GoogleService-Info.plist');\n } catch {\n logger.error(\n `There was an error copying your GoogleService-Info.plist file. You can copy it manually into ${destination}`\n );\n }\n } else {\n logger.error(\n `The Google Services file provided in ${googleServicesFile} doesn't seem to exist. You can copy it manually into ${destination}`\n );\n }\n}\n\nexport const withGoogleServicesJsonFile: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (config, cioProps) => {\n return withXcodeProject(config, async (props) => {\n const useFcm = isFcmPushProvider(cioProps);\n if (!useFcm) {\n // Nothing to do, for providers other than FCM, the Google services JSON file isn't needed\n return props;\n }\n\n logger.info(\n 'Only specify Customer.io ios.pushNotification.googleServicesFile config if you are not already including' +\n ' GoogleService-Info.plist as part of Firebase integration'\n );\n\n copyGoogleServicePlistFile({\n iosPath: props.modRequest.platformProjectRoot,\n appName: props.modRequest.projectName,\n googleServicesFile: cioProps.pushNotification?.googleServicesFile,\n expoIosGoogleServicesFileSet: Boolean(config.ios?.googleServicesFile),\n xcodeProject: props.modResults,\n });\n\n return props;\n });\n};\n\nfunction addFileToXcodeProject(project: XcodeProject, fileName: string) {\n const groupName = 'Resources';\n const filepath = fileName;\n\n if (!IOSConfig.XcodeUtils.ensureGroupRecursively(project, groupName)) {\n logger.error(\n `Error copying GoogleService-Info.plist. Failed to find or create '${groupName}' group in Xcode.`\n );\n return;\n }\n\n // Add GoogleService-Info.plist to the Xcode project\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n project,\n filepath,\n groupName,\n isBuildFile: true,\n });\n}\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAUA;AACA;AACA;AACA;AACA;AACO,SAASI,0BAA0BA,CAAC;EACzCC,OAAO;EACPC,OAAO;EACPC,kBAAkB;EAClBC,4BAA4B;EAC5BC;AAC6B,CAAC,EAAQ;EACtC,MAAMC,WAAW,GAAG,GAAGL,OAAO,2BAA2B;EAEzD,IAAIM,8BAAc,CAACC,MAAM,CAACF,WAAW,CAAC,EAAE;IACtCG,cAAM,CAACC,IAAI,CAAC,wBAAwBJ,WAAW,eAAe,CAAC;IAC/D;EACF;EAEA,IAAIJ,OAAO,IAAIK,8BAAc,CAACC,MAAM,CAAC,GAAGP,OAAO,IAAIC,OAAO,2BAA2B,CAAC,EAAE;IACtF;IACA;IACAO,cAAM,CAACC,IAAI,CACT,wBAAwBT,OAAO,IAAIC,OAAO,wCAC5C,CAAC;IACD;EACF;EAEA,IAAIC,kBAAkB,IAAII,8BAAc,CAACC,MAAM,CAACL,kBAAkB,CAAC,EAAE;IACnE,IAAIC,4BAA4B,EAAE;MAChCK,cAAM,CAACE,IAAI,CACT,0HAA0H,GAC1H,uIACF,CAAC;IACH;IAEA,IAAI;MACFJ,8BAAc,CAACK,QAAQ,CAACT,kBAAkB,EAAEG,WAAW,CAAC;MACxDO,qBAAqB,CAACR,YAAY,EAAE,0BAA0B,CAAC;IACjE,CAAC,CAAC,MAAM;MACNI,c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