customerio-expo-plugin 3.1.0 → 3.2.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 (71) hide show
  1. package/package.json +3 -2
  2. package/plugin/lib/commonjs/android/withCIOAndroid.js +13 -2
  3. package/plugin/lib/commonjs/android/withCIOAndroid.js.map +1 -1
  4. package/plugin/lib/commonjs/android/withLocationGradleProperties.js +37 -0
  5. package/plugin/lib/commonjs/android/withLocationGradleProperties.js.map +1 -0
  6. package/plugin/lib/commonjs/android/withMainApplicationModifications.js +21 -5
  7. package/plugin/lib/commonjs/android/withMainApplicationModifications.js.map +1 -1
  8. package/plugin/lib/commonjs/helpers/native-files/android/CustomerIOSDKInitializer.kt +2 -0
  9. package/plugin/lib/commonjs/helpers/native-files/ios/CustomerIOSDKInitializer.swift +2 -0
  10. package/plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js +19 -2
  11. package/plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map +1 -1
  12. package/plugin/lib/commonjs/helpers/utils/patchLocationCode.js +50 -0
  13. package/plugin/lib/commonjs/helpers/utils/patchLocationCode.js.map +1 -0
  14. package/plugin/lib/commonjs/helpers/utils/patchPluginNativeCode.js +3 -1
  15. package/plugin/lib/commonjs/helpers/utils/patchPluginNativeCode.js.map +1 -1
  16. package/plugin/lib/commonjs/index.js +2 -2
  17. package/plugin/lib/commonjs/index.js.map +1 -1
  18. package/plugin/lib/commonjs/ios/withCIOIos.js +29 -4
  19. package/plugin/lib/commonjs/ios/withCIOIos.js.map +1 -1
  20. package/plugin/lib/commonjs/ios/withCIOIosSwift.js +19 -9
  21. package/plugin/lib/commonjs/ios/withCIOIosSwift.js.map +1 -1
  22. package/plugin/lib/commonjs/ios/withXcodeProject.js +4 -1
  23. package/plugin/lib/commonjs/ios/withXcodeProject.js.map +1 -1
  24. package/plugin/lib/commonjs/types/cio-types.js.map +1 -1
  25. package/plugin/lib/module/android/withCIOAndroid.js +13 -2
  26. package/plugin/lib/module/android/withCIOAndroid.js.map +1 -1
  27. package/plugin/lib/module/android/withLocationGradleProperties.js +30 -0
  28. package/plugin/lib/module/android/withLocationGradleProperties.js.map +1 -0
  29. package/plugin/lib/module/android/withMainApplicationModifications.js +20 -4
  30. package/plugin/lib/module/android/withMainApplicationModifications.js.map +1 -1
  31. package/plugin/lib/module/helpers/native-files/android/CustomerIOSDKInitializer.kt +2 -0
  32. package/plugin/lib/module/helpers/native-files/ios/CustomerIOSDKInitializer.swift +2 -0
  33. package/plugin/lib/module/helpers/utils/injectCIOPodfileCode.js +18 -2
  34. package/plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map +1 -1
  35. package/plugin/lib/module/helpers/utils/patchLocationCode.js +44 -0
  36. package/plugin/lib/module/helpers/utils/patchLocationCode.js.map +1 -0
  37. package/plugin/lib/module/helpers/utils/patchPluginNativeCode.js +3 -2
  38. package/plugin/lib/module/helpers/utils/patchPluginNativeCode.js.map +1 -1
  39. package/plugin/lib/module/index.js +2 -2
  40. package/plugin/lib/module/index.js.map +1 -1
  41. package/plugin/lib/module/ios/withCIOIos.js +29 -4
  42. package/plugin/lib/module/ios/withCIOIos.js.map +1 -1
  43. package/plugin/lib/module/ios/withCIOIosSwift.js +19 -9
  44. package/plugin/lib/module/ios/withCIOIosSwift.js.map +1 -1
  45. package/plugin/lib/module/ios/withXcodeProject.js +5 -1
  46. package/plugin/lib/module/ios/withXcodeProject.js.map +1 -1
  47. package/plugin/lib/module/types/cio-types.js.map +1 -1
  48. package/plugin/lib/typescript/android/withCIOAndroid.d.ts +2 -2
  49. package/plugin/lib/typescript/android/withLocationGradleProperties.d.ts +9 -0
  50. package/plugin/lib/typescript/android/withMainApplicationModifications.d.ts +7 -2
  51. package/plugin/lib/typescript/helpers/utils/injectCIOPodfileCode.d.ts +9 -1
  52. package/plugin/lib/typescript/helpers/utils/patchLocationCode.d.ts +12 -0
  53. package/plugin/lib/typescript/helpers/utils/patchPluginNativeCode.d.ts +3 -1
  54. package/plugin/lib/typescript/index.d.ts +2 -1
  55. package/plugin/lib/typescript/ios/withCIOIos.d.ts +2 -2
  56. package/plugin/lib/typescript/ios/withCIOIosSwift.d.ts +2 -2
  57. package/plugin/lib/typescript/ios/withXcodeProject.d.ts +8 -1
  58. package/plugin/lib/typescript/types/cio-types.d.ts +28 -0
  59. package/plugin/src/android/withCIOAndroid.ts +13 -2
  60. package/plugin/src/android/withLocationGradleProperties.ts +41 -0
  61. package/plugin/src/android/withMainApplicationModifications.ts +26 -4
  62. package/plugin/src/helpers/native-files/android/CustomerIOSDKInitializer.kt +2 -0
  63. package/plugin/src/helpers/native-files/ios/CustomerIOSDKInitializer.swift +2 -0
  64. package/plugin/src/helpers/utils/injectCIOPodfileCode.ts +35 -3
  65. package/plugin/src/helpers/utils/patchLocationCode.ts +80 -0
  66. package/plugin/src/helpers/utils/patchPluginNativeCode.ts +10 -1
  67. package/plugin/src/index.ts +9 -3
  68. package/plugin/src/ios/withCIOIos.ts +24 -3
  69. package/plugin/src/ios/withCIOIosSwift.ts +20 -4
  70. package/plugin/src/ios/withXcodeProject.ts +20 -3
  71. package/plugin/src/types/cio-types.ts +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customerio-expo-plugin",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Expo config plugin for the Customer IO React Native SDK",
5
5
  "main": "plugin/lib/commonjs/index",
6
6
  "module": "plugin/lib/module/index",
@@ -55,9 +55,10 @@
55
55
  "registry": "https://registry.npmjs.org/"
56
56
  },
57
57
  "peerDependencies": {
58
- "customerio-reactnative": "6.2.0"
58
+ "customerio-reactnative": "6.3.1"
59
59
  },
60
60
  "devDependencies": {
61
+ "dotenv": "^16.4.5",
61
62
  "@eslint/js": "^9.33.0",
62
63
  "@expo/config-plugins": "^10.0.0",
63
64
  "@expo/config-types": "^53.0.0",
@@ -7,12 +7,13 @@ exports.withCIOAndroid = withCIOAndroid;
7
7
  var _withAndroidManifestUpdates = require("./withAndroidManifestUpdates");
8
8
  var _withAppGoogleServices = require("./withAppGoogleServices");
9
9
  var _withGoogleServicesJSON = require("./withGoogleServicesJSON");
10
+ var _withLocationGradleProperties = require("./withLocationGradleProperties");
10
11
  var _withMainApplicationModifications = require("./withMainApplicationModifications");
11
12
  var _withNotificationChannelMetadata = require("./withNotificationChannelMetadata");
12
13
  var _withProjectBuildGradle = require("./withProjectBuildGradle");
13
14
  var _withProjectGoogleServices = require("./withProjectGoogleServices");
14
15
  var _withProjectStrings = require("./withProjectStrings");
15
- function withCIOAndroid(config, sdkConfig, props) {
16
+ function withCIOAndroid(config, sdkConfig, props, location) {
16
17
  // Only run notification setup if props are provided
17
18
  if (props) {
18
19
  var _props$pushNotificati;
@@ -29,7 +30,10 @@ function withCIOAndroid(config, sdkConfig, props) {
29
30
 
30
31
  // Add auto initialization if sdkConfig is provided
31
32
  if (sdkConfig) {
32
- config = (0, _withMainApplicationModifications.withMainApplicationModifications)(config, sdkConfig);
33
+ config = (0, _withMainApplicationModifications.withMainApplicationModifications)(config, {
34
+ sdkConfig,
35
+ location
36
+ });
33
37
  }
34
38
 
35
39
  // Update project strings for user agent metadata
@@ -38,6 +42,13 @@ function withCIOAndroid(config, sdkConfig, props) {
38
42
  // Add dependency resolution strategy for Expo SDK 53 compatibility
39
43
  // This prevents androidx versions that require API 36 from being pulled in
40
44
  config = (0, _withProjectBuildGradle.withProjectBuildGradle)(config, props);
45
+
46
+ // Enable SDK location module when location.enabled is true
47
+ if ((location === null || location === void 0 ? void 0 : location.enabled) === true) {
48
+ config = (0, _withLocationGradleProperties.withLocationGradleProperties)(config, {
49
+ location
50
+ });
51
+ }
41
52
  return config;
42
53
  }
43
54
  //# sourceMappingURL=withCIOAndroid.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_withAndroidManifestUpdates","require","_withAppGoogleServices","_withGoogleServicesJSON","_withMainApplicationModifications","_withNotificationChannelMetadata","_withProjectBuildGradle","_withProjectGoogleServices","_withProjectStrings","withCIOAndroid","config","sdkConfig","props","_props$pushNotificati","withProjectGoogleServices","withAppGoogleServices","withGoogleServicesJSON","setHighPriorityPushHandler","undefined","withAndroidManifestUpdates","pushNotification","channel","withNotificationChannelMetadata","withMainApplicationModifications","withProjectStrings","withProjectBuildGradle"],"sources":["withCIOAndroid.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { CustomerIOPluginOptionsAndroid, NativeSDKConfig } from '../types/cio-types';\nimport { withAndroidManifestUpdates } from './withAndroidManifestUpdates';\nimport { withAppGoogleServices } from './withAppGoogleServices';\nimport { withGoogleServicesJSON } from './withGoogleServicesJSON';\nimport { withMainApplicationModifications } from './withMainApplicationModifications';\nimport { withNotificationChannelMetadata } from './withNotificationChannelMetadata';\nimport { withProjectBuildGradle } from './withProjectBuildGradle';\nimport { withProjectGoogleServices } from './withProjectGoogleServices';\nimport { withProjectStrings } from './withProjectStrings';\n\nexport function withCIOAndroid(\n config: ExpoConfig,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsAndroid,\n): ExpoConfig {\n // Only run notification setup if props are provided\n if (props) {\n config = withProjectGoogleServices(config, props);\n config = withAppGoogleServices(config, props);\n config = withGoogleServicesJSON(config, props);\n if (props.setHighPriorityPushHandler !== undefined) {\n config = withAndroidManifestUpdates(config, props);\n }\n if (props.pushNotification?.channel) {\n config = withNotificationChannelMetadata(config, props);\n }\n }\n\n // Add auto initialization if sdkConfig is provided\n if (sdkConfig) {\n config = withMainApplicationModifications(config, sdkConfig);\n }\n\n // Update project strings for user agent metadata\n config = withProjectStrings(config);\n\n // Add dependency resolution strategy for Expo SDK 53 compatibility\n // This prevents androidx versions that require API 36 from being pulled in\n config = withProjectBuildGradle(config, props);\n\n return config;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,2BAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,iCAAA,GAAAH,OAAA;AACA,IAAAI,gCAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AACA,IAAAM,0BAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAP,OAAA;AAEO,SAASQ,cAAcA,CAC5BC,MAAkB,EAClBC,SAA2B,EAC3BC,KAAsC,EAC1B;EACZ;EACA,IAAIA,KAAK,EAAE;IAAA,IAAAC,qBAAA;IACTH,MAAM,GAAG,IAAAI,oDAAyB,EAACJ,MAAM,EAAEE,KAAK,CAAC;IACjDF,MAAM,GAAG,IAAAK,4CAAqB,EAACL,MAAM,EAAEE,KAAK,CAAC;IAC7CF,MAAM,GAAG,IAAAM,8CAAsB,EAACN,MAAM,EAAEE,KAAK,CAAC;IAC9C,IAAIA,KAAK,CAACK,0BAA0B,KAAKC,SAAS,EAAE;MAClDR,MAAM,GAAG,IAAAS,sDAA0B,EAACT,MAAM,EAAEE,KAAK,CAAC;IACpD;IACA,KAAAC,qBAAA,GAAID,KAAK,CAACQ,gBAAgB,cAAAP,qBAAA,eAAtBA,qBAAA,CAAwBQ,OAAO,EAAE;MACnCX,MAAM,GAAG,IAAAY,gEAA+B,EAACZ,MAAM,EAAEE,KAAK,CAAC;IACzD;EACF;;EAEA;EACA,IAAID,SAAS,EAAE;IACbD,MAAM,GAAG,IAAAa,kEAAgC,EAACb,MAAM,EAAEC,SAAS,CAAC;EAC9D;;EAEA;EACAD,MAAM,GAAG,IAAAc,sCAAkB,EAACd,MAAM,CAAC;;EAEnC;EACA;EACAA,MAAM,GAAG,IAAAe,8CAAsB,EAACf,MAAM,EAAEE,KAAK,CAAC;EAE9C,OAAOF,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"names":["_withAndroidManifestUpdates","require","_withAppGoogleServices","_withGoogleServicesJSON","_withLocationGradleProperties","_withMainApplicationModifications","_withNotificationChannelMetadata","_withProjectBuildGradle","_withProjectGoogleServices","_withProjectStrings","withCIOAndroid","config","sdkConfig","props","location","_props$pushNotificati","withProjectGoogleServices","withAppGoogleServices","withGoogleServicesJSON","setHighPriorityPushHandler","undefined","withAndroidManifestUpdates","pushNotification","channel","withNotificationChannelMetadata","withMainApplicationModifications","withProjectStrings","withProjectBuildGradle","enabled","withLocationGradleProperties"],"sources":["withCIOAndroid.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type {\n CustomerIOPluginOptionsAndroid,\n CustomerIOPluginLocationOptions,\n NativeSDKConfig,\n} from '../types/cio-types';\nimport { withAndroidManifestUpdates } from './withAndroidManifestUpdates';\nimport { withAppGoogleServices } from './withAppGoogleServices';\nimport { withGoogleServicesJSON } from './withGoogleServicesJSON';\nimport { withLocationGradleProperties } from './withLocationGradleProperties';\nimport { withMainApplicationModifications } from './withMainApplicationModifications';\nimport { withNotificationChannelMetadata } from './withNotificationChannelMetadata';\nimport { withProjectBuildGradle } from './withProjectBuildGradle';\nimport { withProjectGoogleServices } from './withProjectGoogleServices';\nimport { withProjectStrings } from './withProjectStrings';\n\nexport function withCIOAndroid(\n config: ExpoConfig,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsAndroid,\n location?: CustomerIOPluginLocationOptions,\n): ExpoConfig {\n // Only run notification setup if props are provided\n if (props) {\n config = withProjectGoogleServices(config, props);\n config = withAppGoogleServices(config, props);\n config = withGoogleServicesJSON(config, props);\n if (props.setHighPriorityPushHandler !== undefined) {\n config = withAndroidManifestUpdates(config, props);\n }\n if (props.pushNotification?.channel) {\n config = withNotificationChannelMetadata(config, props);\n }\n }\n\n // Add auto initialization if sdkConfig is provided\n if (sdkConfig) {\n config = withMainApplicationModifications(config, { sdkConfig, location });\n }\n\n // Update project strings for user agent metadata\n config = withProjectStrings(config);\n\n // Add dependency resolution strategy for Expo SDK 53 compatibility\n // This prevents androidx versions that require API 36 from being pulled in\n config = withProjectBuildGradle(config, props);\n\n // Enable SDK location module when location.enabled is true\n if (location?.enabled === true) {\n config = withLocationGradleProperties(config,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,CAAC;;EAE9C;EACA,IAAI,CAAAC,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEc,OAAO,MAAK,IAAI,EAAE;IAC9BjB,MAAM,GAAG,IAAAkB,0DAA4B,EAAClB,MAAM,EAAE;MAAEG;IAAS,CAAC,CAAC;EAC7D;EAEA,OAAOH,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withLocationGradleProperties = void 0;
7
+ var _configPlugins = require("@expo/config-plugins");
8
+ const CUSTOMERIO_LOCATION_ENABLED_KEY = 'customerio_location_enabled';
9
+
10
+ /**
11
+ * Adds or updates customerio_location_enabled in android/gradle.properties when location.enabled is true.
12
+ * The Customer.io React Native SDK reads this to enable the location native module.
13
+ */
14
+ const withLocationGradleProperties = (config, props) => {
15
+ var _props$location;
16
+ if ((props === null || props === void 0 || (_props$location = props.location) === null || _props$location === void 0 ? void 0 : _props$location.enabled) !== true) {
17
+ return config;
18
+ }
19
+ return (0, _configPlugins.withGradleProperties)(config, config => {
20
+ const items = config.modResults;
21
+ const existingIndex = items.findIndex(item => item.type === 'property' && item.key === CUSTOMERIO_LOCATION_ENABLED_KEY);
22
+ const newItem = {
23
+ type: 'property',
24
+ key: CUSTOMERIO_LOCATION_ENABLED_KEY,
25
+ value: 'true'
26
+ };
27
+ if (existingIndex >= 0) {
28
+ items[existingIndex] = newItem;
29
+ } else {
30
+ items.push(newItem);
31
+ }
32
+ config.modResults = items;
33
+ return config;
34
+ });
35
+ };
36
+ exports.withLocationGradleProperties = withLocationGradleProperties;
37
+ //# sourceMappingURL=withLocationGradleProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_configPlugins","require","CUSTOMERIO_LOCATION_ENABLED_KEY","withLocationGradleProperties","config","props","_props$location","location","enabled","withGradleProperties","items","modResults","existingIndex","findIndex","item","type","key","newItem","value","push","exports"],"sources":["withLocationGradleProperties.ts"],"sourcesContent":["import type { ConfigPlugin } from '@expo/config-plugins';\nimport { withGradleProperties } from '@expo/config-plugins';\nimport type { PropertiesItem } from '@expo/config-plugins/build/android/Properties';\n\nimport type { CustomerIOPluginLocationOptions } from '../types/cio-types';\n\nconst CUSTOMERIO_LOCATION_ENABLED_KEY = 'customerio_location_enabled';\n\n/**\n * Adds or updates customerio_location_enabled in android/gradle.properties when location.enabled is true.\n * The Customer.io React Native SDK reads this to enable the location native module.\n */\nexport const withLocationGradleProperties: ConfigPlugin<{\n location?: CustomerIOPluginLocationOptions;\n}> = (config, props) => {\n if (props?.location?.enabled !== true) {\n return config;\n }\n\n return withGradleProperties(config, (config) => {\n const items = config.modResults as PropertiesItem[];\n const existingIndex = items.findIndex(\n (item) => item.type === 'property' && item.key === CUSTOMERIO_LOCATION_ENABLED_KEY\n );\n\n const newItem: PropertiesItem = {\n type: 'property',\n key: CUSTOMERIO_LOCATION_ENABLED_KEY,\n value: 'true',\n };\n\n if (existingIndex >= 0) {\n items[existingIndex] = newItem;\n } else {\n items.push(newItem);\n }\n\n config.modResults = items;\n return config;\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAKA,MAAMC,+BAA+B,GAAG,6BAA6B;;AAErE;AACA;AACA;AACA;AACO,MAAMC,4BAEX,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EAAA,IAAAC,eAAA;EACtB,IAAI,CAAAD,KAAK,aAALA,KAAK,gBAAAC,eAAA,GAALD,KAAK,CAAEE,QAAQ,cAAAD,eAAA,uBAAfA,eAAA,CAAiBE,OAAO,MAAK,IAAI,EAAE;IACrC,OAAOJ,MAAM;EACf;EAEA,OAAO,IAAAK,mCAAoB,EAACL,MAAM,EAAGA,MAAM,IAAK;IAC9C,MAAMM,KAAK,GAAGN,MAAM,CAACO,UAA8B;IACnD,MAAMC,aAAa,GAAGF,KAAK,CAACG,SAAS,CAClCC,IAAI,IAAKA,IAAI,CAACC,IAAI,KAAK,UAAU,IAAID,IAAI,CAACE,GAAG,KAAKd,+BACrD,CAAC;IAED,MAAMe,OAAuB,GAAG;MAC9BF,IAAI,EAAE,UAAU;MAChBC,GAAG,EAAEd,+BAA+B;MACpCgB,KAAK,EAAE;IACT,CAAC;IAED,IAAIN,aAAa,IAAI,CAAC,EAAE;MACtBF,KAAK,CAACE,aAAa,CAAC,GAAGK,OAAO;IAChC,CAAC,MAAM;MACLP,KAAK,CAACS,IAAI,CAACF,OAAO,CAAC;IACrB;IAEAb,MAAM,CAACO,UAAU,GAAGD,KAAK;IACzB,OAAON,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACgB,OAAA,CAAAjB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -10,27 +10,43 @@ var _common = require("../helpers/constants/common");
10
10
  var _patchPluginNativeCode = require("../helpers/utils/patchPluginNativeCode");
11
11
  var _android2 = require("../utils/android");
12
12
  var _logger = require("../utils/logger");
13
- const withMainApplicationModifications = (configOuter, sdkConfig) => {
13
+ const withMainApplicationModifications = (configOuter, {
14
+ sdkConfig,
15
+ location
16
+ }) => {
14
17
  return (0, _configPlugins.withMainApplication)(configOuter, async config => {
15
- const content = setupCustomerIOSDKInitializer(config, sdkConfig);
18
+ const content = setupCustomerIOSDKInitializer(config, sdkConfig, location);
16
19
  config.modResults.contents = content;
17
20
  return config;
18
21
  });
19
22
  };
20
23
 
21
24
  /**
22
- * Setup CustomerIOSDKInitializer for Android auto initialization
25
+ * Build location options for native initializer from plugin config.
26
+ * trackingMode comes from config.location.trackingMode (only used when location.enabled is true).
23
27
  */
24
28
  exports.withMainApplicationModifications = withMainApplicationModifications;
25
- const setupCustomerIOSDKInitializer = (config, sdkConfig) => {
29
+ const getLocationInitOptions = (location, sdkConfig) => {
30
+ var _sdkConfig$location;
31
+ return {
32
+ enabled: (location === null || location === void 0 ? void 0 : location.enabled) === true,
33
+ trackingMode: sdkConfig === null || sdkConfig === void 0 || (_sdkConfig$location = sdkConfig.location) === null || _sdkConfig$location === void 0 ? void 0 : _sdkConfig$location.trackingMode
34
+ };
35
+ };
36
+
37
+ /**
38
+ * Setup CustomerIOSDKInitializer for Android auto initialization
39
+ */
40
+ const setupCustomerIOSDKInitializer = (config, sdkConfig, location) => {
26
41
  const SDK_INITIALIZER_CLASS = 'CustomerIOSDKInitializer';
27
42
  const SDK_INITIALIZER_PACKAGE = 'io.customer.sdk.expo';
28
43
  const SDK_INITIALIZER_FILE = `${SDK_INITIALIZER_CLASS}.kt`;
29
44
  const SDK_INITIALIZER_IMPORT = `import ${SDK_INITIALIZER_PACKAGE}.${SDK_INITIALIZER_CLASS}`;
45
+ const locationOptions = getLocationInitOptions(location, sdkConfig);
30
46
  let content = config.modResults.contents;
31
47
  try {
32
48
  // Always regenerate the CustomerIOSDKInitializer file to reflect config changes
33
- (0, _android2.copyTemplateFile)(config, SDK_INITIALIZER_FILE, SDK_INITIALIZER_PACKAGE, content => (0, _patchPluginNativeCode.patchNativeSDKInitializer)(content, _common.PLATFORM.ANDROID, sdkConfig));
49
+ (0, _android2.copyTemplateFile)(config, SDK_INITIALIZER_FILE, SDK_INITIALIZER_PACKAGE, content => (0, _patchPluginNativeCode.patchNativeSDKInitializer)(content, _common.PLATFORM.ANDROID, sdkConfig, locationOptions));
34
50
  // Add import if not already present
35
51
  content = (0, _android2.addImportToFile)(content, SDK_INITIALIZER_IMPORT);
36
52
  // Add initialization code to onCreate if not already present
@@ -1 +1 @@
1
- {"version":3,"names":["_configPlugins","require","_android","_common","_patchPluginNativeCode","_android2","_logger","withMainApplicationModifications","configOuter","sdkConfig","withMainApplication","config","content","setupCustomerIOSDKInitializer","modResults","contents","exports","SDK_INITIALIZER_CLASS","SDK_INITIALIZER_PACKAGE","SDK_INITIALIZER_FILE","SDK_INITIALIZER_IMPORT","copyTemplateFile","patchNativeSDKInitializer","PLATFORM","ANDROID","addImportToFile","includes","CIO_NATIVE_SDK_INITIALIZE_CALL","addCodeToMethod","CIO_MAINAPPLICATION_ONCREATE_REGEX","CIO_NATIVE_SDK_INITIALIZE_SNIPPET","error","logger","warn"],"sources":["withMainApplicationModifications.ts"],"sourcesContent":["import type { ConfigPlugin, ExportedConfigWithProps } from '@expo/config-plugins';\nimport { withMainApplication } from '@expo/config-plugins';\nimport type { ApplicationProjectFile } from '@expo/config-plugins/build/android/Paths';\nimport { CIO_MAINAPPLICATION_ONCREATE_REGEX, CIO_NATIVE_SDK_INITIALIZE_CALL, CIO_NATIVE_SDK_INITIALIZE_SNIPPET } from '../helpers/constants/android';\nimport { PLATFORM } from '../helpers/constants/common';\nimport { patchNativeSDKInitializer } from '../helpers/utils/patchPluginNativeCode';\nimport type { NativeSDKConfig } from '../types/cio-types';\nimport { addCodeToMethod, addImportToFile, copyTemplateFile } from '../utils/android';\nimport { logger } from '../utils/logger';\n\nexport const withMainApplicationModifications: ConfigPlugin<NativeSDKConfig> = (configOuter, sdkConfig) => {\n return withMainApplication(configOuter, async (config) => {\n const content = setupCustomerIOSDKInitializer(config, sdkConfig);\n config.modResults.contents = content;\n return config;\n });\n};\n\n/**\n * Setup CustomerIOSDKInitializer for Android auto initialization\n */\nconst setupCustomerIOSDKInitializer = (\n config: ExportedConfigWithProps<ApplicationProjectFile>,\n sdkConfig: NativeSDKConfig,\n): string => {\n const SDK_INITIALIZER_CLASS = 'CustomerIOSDKInitializer';\n const SDK_INITIALIZER_PACKAGE = 'io.customer.sdk.expo';\n\n const SDK_INITIALIZER_FILE = `${SDK_INITIALIZER_CLASS}.kt`;\n const SDK_INITIALIZER_IMPORT = `import ${SDK_INITIALIZER_PACKAGE}.${SDK_INITIALIZER_CLASS}`;\n\n let content = config.modResults.contents;\n\n try {\n // Always regenerate the CustomerIOSDKInitializer file to reflect config changes\n copyTemplateFile(config, SDK_INITIALIZER_FILE, SDK_INITIALIZER_PACKAGE, (content) =>\n patchNativeSDKInitializer(content, PLATFORM.ANDROID, sdkConfig)\n );\n // Add import if not already present\n content = addImportToFile(content, SDK_INITIALIZER_IMPORT);\n // Add initialization code to onCreate if not already present\n if (!content.includes(CIO_NATIVE_SDK_INITIALIZE_CALL)) {\n content = addCodeToMethod(content, CIO_MAINAPPLICATION_ONCREATE_REGEX, CIO_NATIVE_SDK_INITIALIZE_SNIPPET);\n }\n } catch (error) {\n logger.warn(`Could not setup ${SDK_INITIALIZER_CLASS}:`, error);\n return config.modResults.contents;\n }\n\n return content;\n};\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEO,MAAMM,gCAA+D,GAAGA,CAACC,WAAW,EAAEC,SAAS,KAAK;EACzG,OAAO,IAAAC,kCAAmB,EAACF,WAAW,EAAE,MAAOG,MAAM,IAAK;IACxD,MAAMC,OAAO,GAAGC,6BAA6B,CAACF,MAAM,EAAEF,SAAS,CAAC;IAChEE,MAAM,CAACG,UAAU,CAACC,QAAQ,GAAGH,OAAO;IACpC,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AAFAK,OAAA,CAAAT,gCAAA,GAAAA,gCAAA;AAGA,MAAMM,6BAA6B,GAAGA,CACpCF,MAAuD,EACvDF,SAA0B,KACf;EACX,MAAMQ,qBAAqB,GAAG,0BAA0B;EACxD,MAAMC,uBAAuB,GAAG,sBAAsB;EAEtD,MAAMC,oBAAoB,GAAG,GAAGF,qBAAqB,KAAK;EAC1D,MAAMG,sBAAsB,GAAG,UAAUF,uBAAuB,IAAID,qBAAqB,EAAE;EAE3F,IAAIL,OAAO,GAAGD,MAAM,CAACG,UAAU,CAACC,QAAQ;EAExC,IAAI;IACF;IACA,IAAAM,0BAAgB,EAACV,MAAM,EAAEQ,oBAAoB,EAAED,uBAAuB,EAAGN,OAAO,IAC9E,IAAAU,gDAAyB,EAACV,OAAO,EAAEW,gBAAQ,CAACC,OAAO,EAAEf,SAAS,CAChE,CAAC;IACD;IACAG,OAAO,GAAG,IAAAa,yBAAe,EAACb,OAAO,EAAEQ,sBAAsB,CAAC;IAC1D;IACA,IAAI,CAACR,OAAO,CAACc,QAAQ,CAACC,uCAA8B,CAAC,EAAE;MACrDf,OAAO,GAAG,IAAAgB,yBAAe,EAAChB,OAAO,EAAEiB,2CAAkC,EAAEC,0CAAiC,CAAC;IAC3G;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdC,cAAM,CAACC,IAAI,CAAC,mBAAmBhB,qBAAqB,GAAG,EAAEc,KAAK,CAAC;IAC/D,OAAOpB,MAAM,CAACG,UAAU,CAACC,QAAQ;EACnC;EAEA,OAAOH,OAAO;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_configPlugins","require","_android","_common","_patchPluginNativeCode","_android2","_logger","withMainApplicationModifications","configOuter","sdkConfig","location","withMainApplication","config","content","setupCustomerIOSDKInitializer","modResults","contents","exports","getLocationInitOptions","_sdkConfig$location","enabled","trackingMode","SDK_INITIALIZER_CLASS","SDK_INITIALIZER_PACKAGE","SDK_INITIALIZER_FILE","SDK_INITIALIZER_IMPORT","locationOptions","copyTemplateFile","patchNativeSDKInitializer","PLATFORM","ANDROID","addImportToFile","includes","CIO_NATIVE_SDK_INITIALIZE_CALL","addCodeToMethod","CIO_MAINAPPLICATION_ONCREATE_REGEX","CIO_NATIVE_SDK_INITIALIZE_SNIPPET","error","logger","warn"],"sources":["withMainApplicationModifications.ts"],"sourcesContent":["import type { ConfigPlugin, ExportedConfigWithProps } from '@expo/config-plugins';\nimport { withMainApplication } from '@expo/config-plugins';\nimport type { ApplicationProjectFile } from '@expo/config-plugins/build/android/Paths';\nimport { CIO_MAINAPPLICATION_ONCREATE_REGEX, CIO_NATIVE_SDK_INITIALIZE_CALL, CIO_NATIVE_SDK_INITIALIZE_SNIPPET } from '../helpers/constants/android';\nimport { PLATFORM } from '../helpers/constants/common';\nimport { patchNativeSDKInitializer } from '../helpers/utils/patchPluginNativeCode';\nimport type {\n CustomerIOPluginLocationOptions,\n NativeSDKConfig,\n} from '../types/cio-types';\nimport { addCodeToMethod, addImportToFile, copyTemplateFile } from '../utils/android';\nimport { logger } from '../utils/logger';\n\ntype MainApplicationModParams = {\n sdkConfig: NativeSDKConfig;\n location?: CustomerIOPluginLocationOptions;\n};\n\nexport const withMainApplicationModifications: ConfigPlugin<MainApplicationModParams> = (configOuter, { sdkConfig, location }) => {\n return withMainApplication(configOuter, async (config) => {\n const content = setupCustomerIOSDKInitializer(config, sdkConfig, location);\n config.modResults.contents = content;\n return config;\n });\n};\n\n/**\n * Build location options for native initializer from plugin config.\n * trackingMode comes from config.location.trackingMode (only used when location.enabled is true).\n */\nconst getLocationInitOptions = (\n location?: CustomerIOPluginLocationOptions,\n sdkConfig?: NativeSDKConfig\n) => ({\n enabled: location?.enabled === true,\n trackingMode: sdkConfig?.location?.trackingMode,\n});\n\n/**\n * Setup CustomerIOSDKInitializer for Android auto initialization\n */\nconst setupCustomerIOSDKInitializer = (\n config: ExportedConfigWithProps<ApplicationProjectFile>,\n sdkConfig: NativeSDKConfig,\n location?: CustomerIOPluginLocationOptions,\n): string => {\n const SDK_INITIALIZER_CLASS = 'CustomerIOSDKInitializer';\n const SDK_INITIALIZER_PACKAGE = 'io.customer.sdk.expo';\n\n const SDK_INITIALIZER_FILE = `${SDK_INITIALIZER_CLASS}.kt`;\n const SDK_INITIALIZER_IMPORT = `import ${SDK_INITIALIZER_PACKAGE}.${SDK_INITIALIZER_CLASS}`;\n\n const locationOptions = getLocationInitOptions(location, sdkConfig);\n let content = config.modResults.contents;\n\n try {\n // Always regenerate the CustomerIOSDKInitializer file to reflect config changes\n copyTemplateFile(config, SDK_INITIALIZER_FILE, SDK_INITIALIZER_PACKAGE, (content) =>\n patchNativeSDKInitializer(content, PLATFORM.ANDROID, sdkConfig, locationOptions)\n );\n // Add import if not already present\n content = addImportToFile(content, SDK_INITIALIZER_IMPORT);\n // Add initialization code to onCreate if not already present\n if (!content.includes(CIO_NATIVE_SDK_INITIALIZE_CALL)) {\n content = addCodeToMethod(content, CIO_MAINAPPLICATION_ONCREATE_REGEX, CIO_NATIVE_SDK_INITIALIZE_SNIPPET);\n }\n } catch (error) {\n logger.warn(`Could not setup ${SDK_INITIALIZER_CLASS}:`, error);\n return config.modResults.contents;\n }\n\n return content;\n};\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AAKA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAOO,MAAMM,gCAAwE,GAAGA,CAACC,WAAW,EAAE;EAAEC,SAAS;EAAEC;AAAS,CAAC,KAAK;EAChI,OAAO,IAAAC,kCAAmB,EAACH,WAAW,EAAE,MAAOI,MAAM,IAAK;IACxD,MAAMC,OAAO,GAAGC,6BAA6B,CAACF,MAAM,EAAEH,SAAS,EAAEC,QAAQ,CAAC;IAC1EE,MAAM,CAACG,UAAU,CAACC,QAAQ,GAAGH,OAAO;IACpC,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AAHAK,OAAA,CAAAV,gCAAA,GAAAA,gCAAA;AAIA,MAAMW,sBAAsB,GAAGA,CAC7BR,QAA0C,EAC1CD,SAA2B;EAAA,IAAAU,mBAAA;EAAA,OACvB;IACJC,OAAO,EAAE,CAAAV,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEU,OAAO,MAAK,IAAI;IACnCC,YAAY,EAAEZ,SAAS,aAATA,SAAS,gBAAAU,mBAAA,GAATV,SAAS,CAAEC,QAAQ,cAAAS,mBAAA,uBAAnBA,mBAAA,CAAqBE;EACrC,CAAC;AAAA,CAAC;;AAEF;AACA;AACA;AACA,MAAMP,6BAA6B,GAAGA,CACpCF,MAAuD,EACvDH,SAA0B,EAC1BC,QAA0C,KAC/B;EACX,MAAMY,qBAAqB,GAAG,0BAA0B;EACxD,MAAMC,uBAAuB,GAAG,sBAAsB;EAEtD,MAAMC,oBAAoB,GAAG,GAAGF,qBAAqB,KAAK;EAC1D,MAAMG,sBAAsB,GAAG,UAAUF,uBAAuB,IAAID,qBAAqB,EAAE;EAE3F,MAAMI,eAAe,GAAGR,sBAAsB,CAACR,QAAQ,EAAED,SAAS,CAAC;EACnE,IAAII,OAAO,GAAGD,MAAM,CAACG,UAAU,CAACC,QAAQ;EAExC,IAAI;IACF;IACA,IAAAW,0BAAgB,EAACf,MAAM,EAAEY,oBAAoB,EAAED,uBAAuB,EAAGV,OAAO,IAC9E,IAAAe,gDAAyB,EAACf,OAAO,EAAEgB,gBAAQ,CAACC,OAAO,EAAErB,SAAS,EAAEiB,eAAe,CACjF,CAAC;IACD;IACAb,OAAO,GAAG,IAAAkB,yBAAe,EAAClB,OAAO,EAAEY,sBAAsB,CAAC;IAC1D;IACA,IAAI,CAACZ,OAAO,CAACmB,QAAQ,CAACC,uCAA8B,CAAC,EAAE;MACrDpB,OAAO,GAAG,IAAAqB,yBAAe,EAACrB,OAAO,EAAEsB,2CAAkC,EAAEC,0CAAiC,CAAC;IAC3G;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdC,cAAM,CAACC,IAAI,CAAC,mBAAmBjB,qBAAqB,GAAG,EAAEe,KAAK,CAAC;IAC/D,OAAOzB,MAAM,CAACG,UAAU,CAACC,QAAQ;EACnC;EAEA,OAAOH,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -7,6 +7,7 @@ import io.customer.messaginginapp.ModuleMessagingInApp
7
7
  import io.customer.messagingpush.MessagingPushModuleConfig
8
8
  import io.customer.messagingpush.ModuleMessagingPushFCM
9
9
  import io.customer.reactnative.sdk.messaginginapp.ReactInAppEventListener
10
+ {{LOCATION_MODULE_IMPORT}}
10
11
  import io.customer.sdk.CustomerIOBuilder
11
12
  import io.customer.sdk.core.util.CioLogLevel
12
13
  import io.customer.sdk.data.model.Region
@@ -41,6 +42,7 @@ object CustomerIOSDKInitializer {
41
42
  MessagingPushModuleConfig.Builder().build()
42
43
  )
43
44
  )
45
+ {{LOCATION_MODULE_INIT}}
44
46
 
45
47
  build()
46
48
  }
@@ -1,6 +1,7 @@
1
1
  import CioDataPipelines
2
2
  import CioInternalCommon
3
3
  import CioMessagingInApp
4
+ {{LOCATION_MODULE_IMPORT}}
4
5
 
5
6
  class CustomerIOSDKInitializer {
6
7
  static func initialize() {
@@ -23,6 +24,7 @@ class CustomerIOSDKInitializer {
23
24
  setIfDefined(value: {{SCREEN_VIEW_USE}}, thenPassItTo: builder.screenViewUse) { ScreenView.getScreenView($0) }
24
25
  setIfDefined(value: {{MIGRATION_SITE_ID}}, thenPassItTo: builder.migrationSiteId)
25
26
 
27
+ {{LOCATION_MODULE_INIT}}
26
28
  CustomerIO.initialize(withConfig: builder.build())
27
29
 
28
30
  if let siteId = siteId {
@@ -3,13 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.buildHostAppPodSnippet = buildHostAppPodSnippet;
6
7
  exports.injectCIONotificationPodfileCode = injectCIONotificationPodfileCode;
7
8
  exports.injectCIOPodfileCode = injectCIOPodfileCode;
8
9
  var _logger = require("../../utils/logger");
9
10
  var _ios = require("../constants/ios");
10
11
  var _codeInjection = require("./codeInjection");
11
12
  var _fileManagement = require("./fileManagement");
12
- async function injectCIOPodfileCode(iosPath, isFcmPushProvider) {
13
+ /** Builds the host app pod line for the Podfile (single subspec or :subspecs with location). Exported for tests. */
14
+ function buildHostAppPodSnippet(iosPath, isFcmPushProvider, options) {
15
+ const path = (0, _ios.getRelativePathToRNSDK)(iosPath);
16
+ const locationEnabled = (options === null || options === void 0 ? void 0 : options.locationEnabled) === true;
17
+ const hasPush = (options === null || options === void 0 ? void 0 : options.hasPush) !== false;
18
+ if (!locationEnabled) {
19
+ const subspec = isFcmPushProvider ? 'fcm' : 'apn';
20
+ return `pod 'customerio-reactnative/${subspec}', :path => '${path}'`;
21
+ }
22
+ if (!hasPush) {
23
+ return `pod 'customerio-reactnative', :subspecs => ['location'], :path => '${path}'`;
24
+ }
25
+ const pushSubspec = isFcmPushProvider ? 'fcm' : 'apn';
26
+ return `pod 'customerio-reactnative', :subspecs => ['${pushSubspec}', 'location'], :path => '${path}'`;
27
+ }
28
+ async function injectCIOPodfileCode(iosPath, isFcmPushProvider, options) {
13
29
  const blockStart = '# --- CustomerIO Host App START ---';
14
30
  const blockEnd = '# --- CustomerIO Host App END ---';
15
31
  const filename = `${iosPath}/Podfile`;
@@ -20,9 +36,10 @@ async function injectCIOPodfileCode(iosPath, isFcmPushProvider) {
20
36
  // The "post_install" line is always present in an Expo project Podfile so it's reliable.
21
37
  // Find that line in the Podfile and then we will insert our code above that line.
22
38
  const lineInPodfileToInjectSnippetBefore = /post_install do \|installer\|/;
39
+ const podLine = buildHostAppPodSnippet(iosPath, isFcmPushProvider, options);
23
40
  const snippetToInjectInPodfile = `
24
41
  ${blockStart}
25
- pod 'customerio-reactnative/${isFcmPushProvider ? 'fcm' : 'apn'}', :path => '${(0, _ios.getRelativePathToRNSDK)(iosPath)}'
42
+ ${podLine}
26
43
  ${blockEnd}
27
44
  `.trim();
28
45
  _fileManagement.FileManagement.write(filename, (0, _codeInjection.injectCodeByRegex)(podfile, lineInPodfileToInjectSnippetBefore, snippetToInjectInPodfile).join('\n'));
@@ -1 +1 @@
1
- {"version":3,"names":["_logger","require","_ios","_codeInjection","_fileManagement","injectCIOPodfileCode","iosPath","isFcmPushProvider","blockStart","blockEnd","filename","podfile","FileManagement","read","matches","match","RegExp","lineInPodfileToInjectSnippetBefore","snippetToInjectInPodfile","getRelativePathToRNSDK","trim","write","injectCodeByRegex","join","logger","info","injectCIONotificationPodfileCode","useFrameworks","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport { logger } from '../../utils/logger';\nimport { getRelativePathToRNSDK } from '../constants/ios';\nimport { injectCodeByRegex } from './codeInjection';\nimport { FileManagement } from './fileManagement';\n\nexport async function injectCIOPodfileCode(\n iosPath: string,\n isFcmPushProvider: boolean\n) {\n const blockStart = '# --- CustomerIO Host App START ---';\n const blockEnd = '# --- CustomerIO Host App END ---';\n\n const filename = `${iosPath}/Podfile`;\n const podfile = await FileManagement.read(filename);\n const matches = podfile.match(new RegExp(blockStart));\n\n if (!matches) {\n // We need to decide what line of code in the Podfile to insert our native code.\n // The \"post_install\" line is always present in an Expo project Podfile so it's reliable.\n // Find that line in the Podfile and then we will insert our code above that line.\n const lineInPodfileToInjectSnippetBefore = /post_install do \\|installer\\|/;\n\n const snippetToInjectInPodfile = `\n${blockStart}\n pod 'customerio-reactnative/${isFcmPushProvider ? 'fcm' : 'apn'\n }', :path => '${getRelativePathToRNSDK(iosPath)}'\n${blockEnd}\n`.trim();\n\n FileManagement.write(\n filename,\n injectCodeByRegex(\n podfile,\n lineInPodfileToInjectSnippetBefore,\n snippetToInjectInPodfile\n ).join('\\n')\n );\n } else {\n logger.info('CustomerIO Podfile snippets already exists. Skipping...');\n }\n}\n\nexport async function injectCIONotificationPodfileCode(\n iosPath: string,\n useFrameworks: CustomerIOPluginOptionsIOS['useFrameworks'],\n isFcmPushProvider: boolean\n) {\n const filename = `${iosPath}/Podfile`;\n const podfile = await FileManagement.read(filename);\n\n const blockStart = '# --- CustomerIO Notification START ---';\n const blockEnd = '# --- CustomerIO Notification END ---';\n\n const matches = podfile.match(new RegExp(blockStart));\n\n if (!matches) {\n const snippetToInjectInPodfile = `\n${blockStart}\ntarget 'NotificationService' do\n ${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}\n pod 'customerio-reactnative-richpush/${isFcmPushProvider ? 'fcm' : 'apn'\n }', :path => '${getRelativePathToRNSDK(iosPath)}'\nend\n${blockEnd}\n`.trim();\n\n FileManagement.append(filename, snippetToInj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AAG,uCAAuC;EAExD,MAAMK,OAAO,GAAGH,OAAO,CAACI,KAAK,CAAC,IAAIC,MAAM,CAACR,UAAU,CAAC,CAAC;EAErD,IAAI,CAACM,OAAO,EAAE;IACZ,MAAMI,wBAAwB,GAAG;AACrC,EAAEV,UAAU;AACZ;AACA,IAAImB,aAAa,KAAK,QAAQ,GAAG,qCAAqC,GAAG,EAAE;AAC3E,yCAAyCpB,iBAAiB,GAAG,KAAK,GAAG,KAAK,gBACpD,IAAAY,2BAAsB,EAACb,OAAO,CAAC;AACrD;AACA,EAAEG,QAAQ;AACV,CAAC,CAACW,IAAI,CAAC,CAAC;IAEJR,8BAAc,CAACgB,MAAM,CAAClB,QAAQ,EAAEQ,wBAAwB,CAAC;EAC3D;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_logger","require","_ios","_codeInjection","_fileManagement","buildHostAppPodSnippet","iosPath","isFcmPushProvider","options","path","getRelativePathToRNSDK","locationEnabled","hasPush","subspec","pushSubspec","injectCIOPodfileCode","blockStart","blockEnd","filename","podfile","FileManagement","read","matches","match","RegExp","lineInPodfileToInjectSnippetBefore","podLine","snippetToInjectInPodfile","trim","write","injectCodeByRegex","join","logger","info","injectCIONotificationPodfileCode","useFrameworks","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport { logger } from '../../utils/logger';\nimport { getRelativePathToRNSDK } from '../constants/ios';\nimport { injectCodeByRegex } from './codeInjection';\nimport { FileManagement } from './fileManagement';\n\nexport type InjectCIOPodfileOptions = {\n /** When true, add the location subspec. When false/omit, use single push subspec only. */\n locationEnabled?: boolean;\n /** When false and locationEnabled, inject only :subspecs => ['location']. When true, use push + location. */\n hasPush?: boolean;\n};\n\n/** Builds the host app pod line for the Podfile (single subspec or :subspecs with location). Exported for tests. */\nexport function buildHostAppPodSnippet(\n iosPath: string,\n isFcmPushProvider: boolean,\n options?: InjectCIOPodfileOptions\n): string {\n const path = getRelativePathToRNSDK(iosPath);\n const locationEnabled = options?.locationEnabled === true;\n const hasPush = options?.hasPush !== false;\n\n if (!locationEnabled) {\n const subspec = isFcmPushProvider ? 'fcm' : 'apn';\n return `pod 'customerio-reactnative/${subspec}', :path => '${path}'`;\n }\n\n if (!hasPush) {\n return `pod 'customerio-reactnative', :subspecs => ['location'], :path => '${path}'`;\n }\n\n const pushSubspec = isFcmPushProvider ? 'fcm' : 'apn';\n return `pod 'customerio-reactnative', :subspecs => ['${pushSubspec}', 'location'], :path => '${path}'`;\n}\n\nexport async function injectCIOPodfileCode(\n iosPath: string,\n isFcmPushProvider: boolean,\n options?: InjectCIOPodfileOptions\n) {\n const blockStart = '# --- CustomerIO Host App START ---';\n const blockEnd = '# --- CustomerIO Host App END ---';\n\n const filename = `${iosPath}/Podfile`;\n const podfile = await FileManagement.read(filename);\n const matches = podfile.match(new RegExp(blockStart));\n\n if (!matches) {\n // We need to decide what line of code in the Podfile to insert our native code.\n // The \"post_install\" line is always present in an Expo project Podfile so it's reliable.\n // Find that line in the Podfile and then we will insert our code above that line.\n const lineInPodfileToInjectSnippetBefore = /post_install do \\|installer\\|/;\n\n const podLine = buildHostAppPodSnippet(iosPath, isFcmPushProvider, options);\n\n const snippetToInjectInPodfile = `\n${blockStart}\n ${podLine}\n${blockEnd}\n`.trim();\n\n FileManagement.write(\n filename,\n injectCodeByRegex(\n podfile,\n lineInPodfileToInjectSnippetBefore,\n snippetToInjectInPodfile\n ).join('\\n')\n );\n } else {\n logger.info('CustomerIO Podfile snippets already exists. Skipping...');\n }\n}\n\nexport async function injectCIONotificationPodfileCode(\n iosPath: string,\n useFrameworks: CustomerIOPluginOptionsIOS['useFrameworks'],\n isFcmPushProvider: boolean\n) {\n const filename = `${iosPath}/Podfile`;\n const podfile = await FileManagement.read(filename);\n\n const blockStart = '# --- CustomerIO Notification START ---';\n const blockEnd = '# --- CustomerIO Notification END ---';\n\n const matches = podfile.match(new RegExp(blockStart));\n\n if (!matches) {\n const snippetToInjectInPodfile = `\n${blockStart}\ntarget 'NotificationService' do\n ${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}\n pod 'customerio-reactnative-richpush/${isFcmPushProvider ? 'fcm' : 'apn'\n }', :path => '${getRelativePathToRNSDK(iosPath)}'\nend\n${blockEnd}\n`.trim();\n\n FileManagement.append(filename, snippetToInjectInPodfile);\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AASA;AACO,SAASI,sBAAsBA,CACpCC,OAAe,EACfC,iBAA0B,EAC1BC,OAAiC,EACzB;EACR,MAAMC,IAAI,GAAG,IAAAC,2BAAsB,EAACJ,OAAO,CAAC;EAC5C,MAAMK,eAAe,GAAG,CAAAH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,eAAe,MAAK,IAAI;EACzD,MAAMC,OAAO,GAAG,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,OAAO,MAAK,KAAK;EAE1C,IAAI,CAACD,eAAe,EAAE;IACpB,MAAME,OAAO,GAAGN,iBAAiB,GAAG,KAAK,GAAG,KAAK;IACjD,OAAO,+BAA+BM,OAAO,gBAAgBJ,IAAI,GAAG;EACtE;EAEA,IAAI,CAACG,OAAO,EAAE;IACZ,OAAO,sEAAsEH,IAAI,GAAG;EACtF;EAEA,MAAMK,WAAW,GAAGP,iBAAiB,GAAG,KAAK,GAAG,KAAK;EACrD,OAAO,gDAAgDO,WAAW,6BAA6BL,IAAI,GAAG;AACxG;AAEO,eAAeM,oBAAoBA,CACxCT,OAAe,EACfC,iBAA0B,EAC1BC,OAAiC,EACjC;EACA,MAAMQ,UAAU,GAAG,qCAAqC;EACxD,MAAMC,QAAQ,GAAG,mCAAmC;EAEpD,MAAMC,QAAQ,GAAG,GAAGZ,OAAO,UAAU;EACrC,MAAMa,OAAO,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AACA,EAAEW,QAAQ;AACV,CAAC,CAACW,IAAI,CAAC,CAAC;IAEJR,8BAAc,CAACgB,MAAM,CAAClB,QAAQ,EAAES,wBAAwB,CAAC;EAC3D;AACF","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.patchLocationPlaceholders = patchLocationPlaceholders;
7
+ var _common = require("../constants/common");
8
+ const VALID_TRACKING_MODES = ['OFF', 'MANUAL', 'ON_APP_START'];
9
+
10
+ /** Options for location module in generated native initializer */
11
+
12
+ function normalizeTrackingMode(rawMode) {
13
+ const upper = rawMode === null || rawMode === void 0 ? void 0 : rawMode.toUpperCase();
14
+ return upper && VALID_TRACKING_MODES.includes(upper) ? upper : 'MANUAL';
15
+ }
16
+
17
+ /**
18
+ * Replaces {{LOCATION_MODULE_IMPORT}} and {{LOCATION_MODULE_INIT}} placeholders
19
+ * in SDK initializer template content for the given platform.
20
+ */
21
+ function patchLocationPlaceholders(content, platform, locationOptions) {
22
+ const locationEnabled = (locationOptions === null || locationOptions === void 0 ? void 0 : locationOptions.enabled) === true;
23
+ const trackingMode = normalizeTrackingMode(locationOptions === null || locationOptions === void 0 ? void 0 : locationOptions.trackingMode);
24
+ if (platform === _common.PLATFORM.ANDROID) {
25
+ if (locationEnabled) {
26
+ return content.replace(/\{\{LOCATION_MODULE_IMPORT\}\}/g, `import io.customer.location.LocationModuleConfig
27
+ import io.customer.location.LocationTrackingMode
28
+ import io.customer.location.ModuleLocation
29
+ `).replace(/\{\{LOCATION_MODULE_INIT\}\}/g, `if (io.customer.reactnative.sdk.BuildConfig.CIO_LOCATION_ENABLED) {
30
+ addCustomerIOModule(
31
+ ModuleLocation(
32
+ LocationModuleConfig.Builder()
33
+ .setLocationTrackingMode(LocationTrackingMode.${trackingMode})
34
+ .build()
35
+ )
36
+ )
37
+ }
38
+ `);
39
+ }
40
+ return content.replace(/\n\{\{LOCATION_MODULE_IMPORT\}\}\n/g, '\n').replace(/\n\s*\{\{LOCATION_MODULE_INIT\}\}\n/g, '\n');
41
+ }
42
+
43
+ // iOS
44
+ if (locationEnabled) {
45
+ const modeSwift = trackingMode === 'OFF' ? '.off' : trackingMode === 'ON_APP_START' ? '.onAppStart' : '.manual';
46
+ return content.replace(/\{\{LOCATION_MODULE_IMPORT\}\}/g, 'import CioLocation\n').replace(/\{\{LOCATION_MODULE_INIT\}\}/g, `_ = builder.addModule(LocationModule(config: LocationConfig(mode: ${modeSwift})))`);
47
+ }
48
+ return content.replace(/\n\{\{LOCATION_MODULE_IMPORT\}\}\n/g, '\n').replace(/\n\s*\{\{LOCATION_MODULE_INIT\}\}\n/g, '\n\n');
49
+ }
50
+ //# sourceMappingURL=patchLocationCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_common","require","VALID_TRACKING_MODES","normalizeTrackingMode","rawMode","upper","toUpperCase","includes","patchLocationPlaceholders","content","platform","locationOptions","locationEnabled","enabled","trackingMode","PLATFORM","ANDROID","replace","modeSwift"],"sources":["patchLocationCode.ts"],"sourcesContent":["import type { LocationTrackingMode } from '../../types/cio-types';\nimport { PLATFORM, type Platform } from '../constants/common';\n\nconst VALID_TRACKING_MODES: LocationTrackingMode[] = ['OFF', 'MANUAL', 'ON_APP_START'];\n\n/** Options for location module in generated native initializer */\nexport type LocationInitOptions = {\n enabled: boolean;\n trackingMode?: LocationTrackingMode;\n};\n\nfunction normalizeTrackingMode(\n rawMode: string | undefined\n): LocationTrackingMode {\n const upper = rawMode?.toUpperCase();\n return upper && VALID_TRACKING_MODES.includes(upper as LocationTrackingMode)\n ? (upper as LocationTrackingMode)\n : 'MANUAL';\n}\n\n/**\n * Replaces {{LOCATION_MODULE_IMPORT}} and {{LOCATION_MODULE_INIT}} placeholders\n * in SDK initializer template content for the given platform.\n */\nexport function patchLocationPlaceholders(\n content: string,\n platform: Platform,\n locationOptions?: LocationInitOptions\n): string {\n const locationEnabled = locationOptions?.enabled === true;\n const trackingMode = normalizeTrackingMode(locationOptions?.trackingMode);\n\n if (platform === PLATFORM.ANDROID) {\n if (locationEnabled) {\n return content\n .replace(\n /\\{\\{LOCATION_MODULE_IMPORT\\}\\}/g,\n `import io.customer.location.LocationModuleConfig\nimport io.customer.location.LocationTrackingMode\nimport io.customer.location.ModuleLocation\n`\n )\n .replace(\n /\\{\\{LOCATION_MODULE_INIT\\}\\}/g,\n `if (io.customer.reactnative.sdk.BuildConfig.CIO_LOCATION_ENABLED) {\n addCustomerIOModule(\n ModuleLocation(\n LocationModuleConfig.Builder()\n .setLocationTrackingMode(LocationTrackingMode.${trackingMode})\n .build()\n )\n )\n }\n `\n );\n }\n return content\n .replace(/\\n\\{\\{LOCATION_MODULE_IMPORT\\}\\}\\n/g, '\\n')\n .replace(/\\n\\s*\\{\\{LOCATION_MODULE_INIT\\}\\}\\n/g, '\\n');\n }\n\n // iOS\n if (locationEnabled) {\n const modeSwift =\n trackingMode === 'OFF'\n ? '.off'\n : trackingMode === 'ON_APP_START'\n ? '.onAppStart'\n : '.manual';\n return content\n .replace(/\\{\\{LOCATION_MODULE_IMPORT\\}\\}/g, 'import CioLocation\\n')\n .replace(\n /\\{\\{LOCATION_MODULE_INIT\\}\\}/g,\n `_ = builder.addModule(LocationModule(config: LocationConfig(mode: ${modeSwift})))`\n );\n }\n return content\n .replace(/\\n\\{\\{LOCATION_MODULE_IMPORT\\}\\}\\n/g, '\\n')\n .replace(/\\n\\s*\\{\\{LOCATION_MODULE_INIT\\}\\}\\n/g, '\\n\\n');\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,oBAA4C,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC;;AAEtF;;AAMA,SAASC,qBAAqBA,CAC5BC,OAA2B,EACL;EACtB,MAAMC,KAAK,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,WAAW,CAAC,CAAC;EACpC,OAAOD,KAAK,IAAIH,oBAAoB,CAACK,QAAQ,CAACF,KAA6B,CAAC,GACvEA,KAAK,GACN,QAAQ;AACd;;AAEA;AACA;AACA;AACA;AACO,SAASG,yBAAyBA,CACvCC,OAAe,EACfC,QAAkB,EAClBC,eAAqC,EAC7B;EACR,MAAMC,eAAe,GAAG,CAAAD,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAEE,OAAO,MAAK,IAAI;EACzD,MAAMC,YAAY,GAAGX,qBAAqB,CAACQ,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAEG,YAAY,CAAC;EAEzE,IAAIJ,QAAQ,KAAKK,gBAAQ,CAACC,OAAO,EAAE;IACjC,IAAIJ,eAAe,EAAE;MACnB,OAAOH,OAAO,CACXQ,OAAO,CACN,iCAAiC,EACjC;AACV;AACA;AACA,CACQ,CAAC,CACAA,OAAO,CACN,+BAA+B,EAC/B;AACV;AACA;AACA;AACA,wEAAwEH,YAAY;AACpF;AACA;AACA;AACA;AACA,SACQ,CAAC;IACL;IACA,OAAOL,OAAO,CACXQ,OAAO,CAAC,qCAAqC,EAAE,IAAI,CAAC,CACpDA,OAAO,CAAC,sCAAsC,EAAE,IAAI,CAAC;EAC1D;;EAEA;EACA,IAAIL,eAAe,EAAE;IACnB,MAAMM,SAAS,GACbJ,YAAY,KAAK,KAAK,GAClB,MAAM,GACNA,YAAY,KAAK,cAAc,GAC7B,aAAa,GACb,SAAS;IACjB,OAAOL,OAAO,CACXQ,OAAO,CAAC,iCAAiC,EAAE,sBAAsB,CAAC,CAClEA,OAAO,CACN,+BAA+B,EAC/B,qEAAqEC,SAAS,KAChF,CAAC;EACL;EACA,OAAOT,OAAO,CACXQ,OAAO,CAAC,qCAAqC,EAAE,IAAI,CAAC,CACpDA,OAAO,CAAC,sCAAsC,EAAE,MAAM,CAAC;AAC5D","ignoreList":[]}
@@ -7,11 +7,12 @@ exports.patchNativeSDKInitializer = patchNativeSDKInitializer;
7
7
  var _plugin = require("../../utils/plugin");
8
8
  var _validation = require("../../utils/validation");
9
9
  var _common = require("../constants/common");
10
+ var _patchLocationCode = require("./patchLocationCode");
10
11
  /**
11
12
  * Shared utility function to perform common SDK config replacements
12
13
  * for both iOS and Android template files
13
14
  */
14
- function patchNativeSDKInitializer(rawContent, platform, sdkConfig) {
15
+ function patchNativeSDKInitializer(rawContent, platform, sdkConfig, locationOptions) {
15
16
  var _siteId, _migrationSiteId;
16
17
  // Validate SDK configuration to ensure all fields are present and
17
18
  // correct at the time of patching in prebuild
@@ -61,6 +62,7 @@ function patchNativeSDKInitializer(rawContent, platform, sdkConfig) {
61
62
  // Replace siteId and migrationSiteId placeholders (trim whitespace and handle empty strings)
62
63
  replaceValue(/\{\{SITE_ID\}\}/g, ((_siteId = siteId) === null || _siteId === void 0 ? void 0 : _siteId.trim()) || undefined, configValue => `"${configValue}"`);
63
64
  replaceValue(/\{\{MIGRATION_SITE_ID\}\}/g, ((_migrationSiteId = migrationSiteId) === null || _migrationSiteId === void 0 ? void 0 : _migrationSiteId.trim()) || undefined, configValue => `"${configValue}"`);
65
+ content = (0, _patchLocationCode.patchLocationPlaceholders)(content, platform, locationOptions);
64
66
  return content;
65
67
  }
66
68
  //# sourceMappingURL=patchPluginNativeCode.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_plugin","require","_validation","_common","patchNativeSDKInitializer","rawContent","platform","sdkConfig","_siteId","_migrationSiteId","validateNativeSDKConfig","content","replaceValue","placeholder","value","transform","fallback","PLATFORM","ANDROID","undefined","replace","pluginVersion","getPluginVersion","cdpApiKey","region","configValue","logLevel","autoTrackDeviceAttributes","toString","trackApplicationLifecycleEvents","screenViewUse","siteId","migrationSiteId","trim"],"sources":["patchPluginNativeCode.ts"],"sourcesContent":["import type { NativeSDKConfig } from '../../types/cio-types';\nimport { getPluginVersion } from '../../utils/plugin';\nimport { validateNativeSDKConfig } from '../../utils/validation';\nimport { PLATFORM, type Platform } from '../constants/common';\n\n/**\n * Shared utility function to perform common SDK config replacements\n * for both iOS and Android template files\n */\nexport function patchNativeSDKInitializer(\n rawContent: string,\n platform: Platform,\n sdkConfig: NativeSDKConfig\n): string {\n // Validate SDK configuration to ensure all fields are present and \n // correct at the time of patching in prebuild\n validateNativeSDKConfig(sdkConfig);\n\n let content = rawContent;\n\n // Helper function to replace placeholders with platform-specific fallback values\n const replaceValue = <T>(\n placeholder: RegExp,\n value: T | undefined,\n transform: (configValue: T) => string,\n fallback: string = platform === PLATFORM.ANDROID ? 'null' : 'nil'\n ) => {\n if (value !== undefined && value !== null) {\n content = content.replace(placeholder, transform(value));\n } else {\n content = content.replace(placeholder, fallback);\n }\n };\n\n // Replace EXPO_PLUGIN_VERSION with actual plugin version\n const pluginVersion = getPluginVersion();\n content = content.replace(/\\{\\{EXPO_PLUGIN_VERSION\\}\\}/g, pluginVersion);\n\n // Replace CDP API Key (required field)\n content = content.replace(/\\{\\{CDP_API_KEY\\}\\}/g, sdkConfig.cdpApiKey);\n\n // Handle region - use empty string as fallback (nil not supported for region)\n replaceValue(\n /\\{\\{REGION\\}\\}/g,\n sdkConfig.region,\n (configValue) => `\"${configValue}\"`,\n '\"\"'\n );\n\n // Handle logLevel - use nil/null as fallback\n replaceValue(\n /\\{\\{LOG_LEVEL\\}\\}/g,\n sdkConfig.logLevel,\n (configValue) => `\"${configValue}\"`\n );\n\n // Handle optional boolean configurations\n replaceValue(\n /\\{\\{AUTO_TRACK_DEVICE_ATTRIBUTES\\}\\}/g,\n sdkConfig.autoTrackDeviceAttributes,\n (configValue) => configValue.toString()\n );\n\n replaceValue(\n /\\{\\{TRACK_APPLICATION_LIFECYCLE_EVENTS\\}\\}/g,\n sdkConfig.trackApplicationLifecycleEvents,\n (configValue) => configValue.toString()\n );\n\n // Handle screenViewUse - use nil/null as fallback\n replaceValue(\n /\\{\\{SCREEN_VIEW_USE\\}\\}/g,\n sdkConfig.screenViewUse,\n (configValue) => `\"${configValue}\"`\n );\n\n // Handle siteId/migrationSiteId business logic\n let siteId = sdkConfig.siteId;\n let migrationSiteId = sdkConfig.migrationSiteId;\n\n // Business rule: if only siteId provided, copy to migrationSiteId; if only migrationSiteId provided, set siteId to undefined\n if (siteId && !migrationSiteId) {\n migrationSiteId = siteId;\n } else if (migrationSiteId && !siteId) {\n siteId = undefined;\n }\n\n // Replace siteId and migrationSiteId placeholders (trim whitespace and handle empty strings)\n replaceValue(\n /\\{\\{SITE_ID\\}\\}/g,\n siteId?.trim() || undefined,\n (configValue) => `\"${configValue}\"`\n );\n\n replaceValue(\n /\\{\\{MIGRATION_SITE_ID\\}\\}/g,\n migrationSiteId?.trim() || undefined,\n (configValue) => `\"${configValue}\"`\n );\n\n return content;\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACO,SAASG,yBAAyBA,CACvCC,UAAkB,EAClBC,QAAkB,EAClBC,SAA0B,EAClB;EAAA,IAAAC,OAAA,EAAAC,gBAAA;EACR;EACA;EACA,IAAAC,mCAAuB,EAACH,SAAS,CAAC;EAElC,IAAII,OAAO,GAAGN,UAAU;;EAExB;EACA,MAAMO,YAAY,GAAGA,CACnBC,WAAmB,EACnBC,KAAoB,EACpBC,SAAqC,EACrCC,QAAgB,GAAGV,QAAQ,KAAKW,gBAAQ,CAACC,OAAO,GAAG,MAAM,GAAG,KAAK,KAC9D;IACH,IAAIJ,KAAK,KAAKK,SAAS,IAAIL,KAAK,KAAK,IAAI,EAAE;MACzCH,OAAO,GAAGA,OAAO,CAACS,OAAO,CAACP,WAAW,EAAEE,SAAS,CAACD,KAAK,CAAC,CAAC;IAC1D,CAAC,MAAM;MACLH,OAAO,GAAGA,OAAO,CAACS,OAAO,CAACP,WAAW,EAAEG,QAAQ,CAAC;IAClD;EACF,CAAC;;EAED;EACA,MAAMK,aAAa,GAAG,IAAAC,wBAAgB,EAAC,CAAC;EACxCX,OAAO,GAAGA,OAAO,CAACS,OAAO,CAAC,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CAAC,CAAC,KAAId,SAAS,EACnCM,WAAW,IAAK,IAAIA,WAAW,GAClC,CAAC;EAED,OAAOd,OAAO;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_plugin","require","_validation","_common","_patchLocationCode","patchNativeSDKInitializer","rawContent","platform","sdkConfig","locationOptions","_siteId","_migrationSiteId","validateNativeSDKConfig","content","replaceValue","placeholder","value","transform","fallback","PLATFORM","ANDROID","undefined","replace","pluginVersion","getPluginVersion","cdpApiKey","region","configValue","logLevel","autoTrackDeviceAttributes","toString","trackApplicationLifecycleEvents","screenViewUse","siteId","migrationSiteId","trim","patchLocationPlaceholders"],"sources":["patchPluginNativeCode.ts"],"sourcesContent":["import type { NativeSDKConfig } from '../../types/cio-types';\nimport { getPluginVersion } from '../../utils/plugin';\nimport { validateNativeSDKConfig } from '../../utils/validation';\nimport { PLATFORM, type Platform } from '../constants/common';\nimport {\n type LocationInitOptions,\n patchLocationPlaceholders,\n} from './patchLocationCode';\n\nexport type { LocationInitOptions };\n\n/**\n * Shared utility function to perform common SDK config replacements\n * for both iOS and Android template files\n */\nexport function patchNativeSDKInitializer(\n rawContent: string,\n platform: Platform,\n sdkConfig: NativeSDKConfig,\n locationOptions?: LocationInitOptions\n): string {\n // Validate SDK configuration to ensure all fields are present and \n // correct at the time of patching in prebuild\n validateNativeSDKConfig(sdkConfig);\n\n let content = rawContent;\n\n // Helper function to replace placeholders with platform-specific fallback values\n const replaceValue = <T>(\n placeholder: RegExp,\n value: T | undefined,\n transform: (configValue: T) => string,\n fallback: string = platform === PLATFORM.ANDROID ? 'null' : 'nil'\n ) => {\n if (value !== undefined && value !== null) {\n content = content.replace(placeholder, transform(value));\n } else {\n content = content.replace(placeholder, fallback);\n }\n };\n\n // Replace EXPO_PLUGIN_VERSION with actual plugin version\n const pluginVersion = getPluginVersion();\n content = content.replace(/\\{\\{EXPO_PLUGIN_VERSION\\}\\}/g, pluginVersion);\n\n // Replace CDP API Key (required field)\n content = content.replace(/\\{\\{CDP_API_KEY\\}\\}/g, sdkConfig.cdpApiKey);\n\n // Handle region - use empty string as fallback (nil not supported for region)\n replaceValue(\n /\\{\\{REGION\\}\\}/g,\n sdkConfig.region,\n (configValue) => `\"${configValue}\"`,\n '\"\"'\n );\n\n // Handle logLevel - use nil/null as fallback\n replaceValue(\n /\\{\\{LOG_LEVEL\\}\\}/g,\n sdkConfig.logLevel,\n (configValue) => `\"${configValue}\"`\n );\n\n // Handle optional boolean configurations\n replaceValue(\n /\\{\\{AUTO_TRACK_DEVICE_ATTRIBUTES\\}\\}/g,\n sdkConfig.autoTrackDeviceAttributes,\n (configValue) => configValue.toString()\n );\n\n replaceValue(\n /\\{\\{TRACK_APPLICATION_LIFECYCLE_EVENTS\\}\\}/g,\n sdkConfig.trackApplicationLifecycleEvents,\n (configValue) => configValue.toString()\n );\n\n // Handle screenViewUse - use nil/null as fallback\n replaceValue(\n /\\{\\{SCREEN_VIEW_USE\\}\\}/g,\n sdkConfig.screenViewUse,\n (configValue) => `\"${configValue}\"`\n );\n\n // Handle siteId/migrationSiteId business logic\n let siteId = sdkConfig.siteId;\n let migrationSiteId = sdkConfig.migrationSiteId;\n\n // Business rule: if only siteId provided, copy to migrationSiteId; if only migrationSiteId provided, set siteId to undefined\n if (siteId && !migrationSiteId) {\n migrationSiteId = siteId;\n } else if (migrationSiteId && !siteId) {\n siteId = undefined;\n }\n\n // Replace siteId and migrationSiteId placeholders (trim whitespace and handle empty strings)\n replaceValue(\n /\\{\\{SITE_ID\\}\\}/g,\n siteId?.trim() || undefined,\n (configValue) => `\"${configValue}\"`\n );\n\n replaceValue(\n /\\{\\{MIGRATION_SITE_ID\\}\\}/g,\n migrationSiteId?.trim() || undefined,\n (configValue) => `\"${configValue}\"`\n );\n\n content = patchLocationPlaceholders(content, platform, locationOptions);\n\n return content;\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAA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AAC;EAEDhB,YAAY,CACV,6CAA6C,EAC7CN,SAAS,CAACuB,+BAA+B,EACxCJ,WAAW,IAAKA,WAAW,CAACG,QAAQ,CAAC,CACxC,CAAC;;EAED;EACAhB,YAAY,CACV,0BAA0B,EAC1BN,SAAS,CAACwB,aAAa,EACtBL,WAAW,IAAK,IAAIA,WAAW,GAClC,CAAC;;EAED;EACA,IAAIM,MAAM,GAAGzB,SAAS,CAACyB,MAAM;EAC7B,IAAIC,eAAe,GAAG1B,SAAS,CAAC0B,eAAe;;EAE/C;EACA,IAAID,MAAM,IAAI,CAACC,eAAe,EAAE;IAC9BA,eAAe,GAAGD,MAAM;EAC1B,CAAC,MAAM,IAAIC,eAAe,IAAI,CAACD,MAAM,EAAE;IACrCA,MAAM,GAAGZ,SAAS;EACpB;;EAEA;EACAP,YAAY,CACV,kBAAkB,EAClB,EAAAJ,OAAA,GAAAuB,MAAM,cAAAvB,OAAA,uBAANA,OAAA,CAAQyB,IAAI,CAAC,CAAC,KAAId,SAAS,EAC1BM,WAAW,IAAK,IAAIA,WAAW,GAClC,CAAC;EAEDb,YAAY,CACV,4BAA4B,EAC5B,EAAAH,gBAAA,GAAAuB,eAAe,cAAAvB,gBAAA,uBAAfA,gBAAA,CAAiBwB,IAAI,CAAC,CAAC,KAAId,SAAS,EACnCM,WAAW,IAAK,IAAIA,WAAW,GAClC,CAAC;EAEDd,OAAO,GAAG,IAAAuB,4CAAyB,EAACvB,OAAO,EAAEN,QAAQ,EAAEE,eAAe,CAAC;EAEvE,OAAOI,OAAO;AAChB","ignoreList":[]}
@@ -15,8 +15,8 @@ function withCustomerIOPlugin(config, props) {
15
15
  }
16
16
 
17
17
  // Apply platform specific modifications
18
- config = (0, _withCIOIos.withCIOIos)(config, props.config, props.ios);
19
- config = (0, _withCIOAndroid.withCIOAndroid)(config, props.config, props.android);
18
+ config = (0, _withCIOIos.withCIOIos)(config, props.config, props.ios, props.location);
19
+ config = (0, _withCIOAndroid.withCIOAndroid)(config, props.config, props.android, props.location);
20
20
  return config;
21
21
  }
22
22
  var _default = exports.default = withCustomerIOPlugin;
@@ -1 +1 @@
1
- {"version":3,"names":["_withCIOAndroid","require","_utils","_withCIOIos","withCustomerIOPlugin","config","props","isExpoVersion53OrHigher","Error","withCIOIos","ios","withCIOAndroid","android","_default","exports","default"],"sources":["index.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport { withCIOAndroid } from './android/withCIOAndroid';\nimport { isExpoVersion53OrHigher } from './ios/utils';\nimport { withCIOIos } from './ios/withCIOIos';\nimport type { CustomerIOPluginOptions } from './types/cio-types';\n\n// Entry point for config plugin\nfunction withCustomerIOPlugin(\n config: ExpoConfig,\n props: CustomerIOPluginOptions\n) {\n // Check if config is being used with unsupported Expo version\n if (props.config && !isExpoVersion53OrHigher(config)) {\n throw new Error(\n 'CustomerIO auto initialization (config property) requires Expo SDK 53 or higher. ' +\n 'Please upgrade to Expo SDK 53+ or use manual initialization instead. ' +\n 'See documentation for manual setup instructions.'\n );\n }\n\n // Apply platform specific modifications\n config = withCIOIos(config, props.config, props.ios);\n config = withCIOAndroid(config, props.config, props.android);\n\n return config;\n}\n\nexport default withCustomerIOPlugin;\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAGA;AACA,SAASG,oBAAoBA,CAC3BC,MAAkB,EAClBC,KAA8B,EAC9B;EACA;EACA,IAAIA,KAAK,CAACD,MAAM,IAAI,CAAC,IAAAE,8BAAuB,EAACF,MAAM,CAAC,EAAE;IACpD,MAAM,IAAIG,KAAK,CACb,mFAAmF,GACnF,uEAAuE,GACvE,kDACF,CAAC;EACH;;EAEA;EACAH,MAAM,GAAG,IAAAI,sBAAU,EAACJ,MAAM,EAAEC,KAAK,CAACD,MAAM,EAAEC,KAAK,CAACI,GAAG,CAAC;EACpDL,MAAM,GAAG,IAAAM,8BAAc,EAACN,MAAM,EAAEC,KAAK,CAACD,MAAM,EAAEC,KAAK,CAACM,OAAO,CAAC;EAE5D,OAAOP,MAAM;AACf;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcX,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["_withCIOAndroid","require","_utils","_withCIOIos","withCustomerIOPlugin","config","props","isExpoVersion53OrHigher","Error","withCIOIos","ios","location","withCIOAndroid","android","_default","exports","default"],"sources":["index.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport { withCIOAndroid } from './android/withCIOAndroid';\nimport { isExpoVersion53OrHigher } from './ios/utils';\nimport { withCIOIos } from './ios/withCIOIos';\nimport type {\n CustomerIOPluginOptions,\n LocationTrackingMode,\n NativeSDKConfig,\n} from './types/cio-types';\n\nexport type { LocationTrackingMode, NativeSDKConfig };\n\n// Entry point for config plugin\nfunction withCustomerIOPlugin(\n config: ExpoConfig,\n props: CustomerIOPluginOptions\n) {\n // Check if config is being used with unsupported Expo version\n if (props.config && !isExpoVersion53OrHigher(config)) {\n throw new Error(\n 'CustomerIO auto initialization (config property) requires Expo SDK 53 or higher. ' +\n 'Please upgrade to Expo SDK 53+ or use manual initialization instead. ' +\n 'See documentation for manual setup instructions.'\n );\n }\n\n // Apply platform specific modifications\n config = withCIOIos(config, props.config, props.ios, props.location);\n config = withCIOAndroid(config, props.config, props.android, props.location);\n\n return config;\n}\n\nexport default withCustomerIOPlugin;\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA;AACA,SAASG,oBAAoBA,CAC3BC,MAAkB,EAClBC,KAA8B,EAC9B;EACA;EACA,IAAIA,KAAK,CAACD,MAAM,IAAI,CAAC,IAAAE,8BAAuB,EAACF,MAAM,CAAC,EAAE;IACpD,MAAM,IAAIG,KAAK,CACb,mFAAmF,GACnF,uEAAuE,GACvE,kDACF,CAAC;EACH;;EAEA;EACAH,MAAM,GAAG,IAAAI,sBAAU,EAACJ,MAAM,EAAEC,KAAK,CAACD,MAAM,EAAEC,KAAK,CAACI,GAAG,EAAEJ,KAAK,CAACK,QAAQ,CAAC;EACpEN,MAAM,GAAG,IAAAO,8BAAc,EAACP,MAAM,EAAEC,KAAK,CAACD,MAAM,EAAEC,KAAK,CAACO,OAAO,EAAEP,KAAK,CAACK,QAAQ,CAAC;EAE5E,OAAON,MAAM;AACf;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,oBAAoB","ignoreList":[]}
@@ -12,12 +12,13 @@ var _withCIOIosSwift = require("./withCIOIosSwift");
12
12
  var _withGoogleServicesJsonFile = require("./withGoogleServicesJsonFile");
13
13
  var _withNotificationsXcodeProject = require("./withNotificationsXcodeProject");
14
14
  var _withXcodeProject = require("./withXcodeProject");
15
- function withCIOIos(config, sdkConfig, props) {
15
+ function withCIOIos(config, sdkConfig, props, location) {
16
16
  const isSwiftProject = (0, _utils.isExpoVersion53OrHigher)(config);
17
17
  const platformConfig = mergeDeprecatedPropertiesAndLogWarnings(props);
18
+ const locationEnabled = (location === null || location === void 0 ? void 0 : location.enabled) === true;
18
19
  if (platformConfig !== null && platformConfig !== void 0 && platformConfig.pushNotification) {
19
20
  if (isSwiftProject) {
20
- config = (0, _withCIOIosSwift.withCIOIosSwift)(config, sdkConfig, platformConfig);
21
+ config = (0, _withCIOIosSwift.withCIOIosSwift)(config, sdkConfig, platformConfig, location);
21
22
  } else {
22
23
  // Auto initialization is only supported in Swift projects (Expo SDK 53+)
23
24
  // Legacy Objective-C projects only support push notifications
@@ -25,10 +26,34 @@ function withCIOIos(config, sdkConfig, props) {
25
26
  }
26
27
  platformConfig.pushNotification.env = platformConfig.pushNotification.env || (0, _config.mergeConfigWithEnvValues)(platformConfig, sdkConfig);
27
28
  config = (0, _withNotificationsXcodeProject.withCioNotificationsXcodeProject)(config, platformConfig);
28
- config = (0, _withXcodeProject.withCioXcodeProject)(config, platformConfig);
29
+ config = (0, _withXcodeProject.withCioXcodeProject)(config, {
30
+ ...platformConfig,
31
+ podfileOptions: {
32
+ locationEnabled,
33
+ hasPush: true
34
+ }
35
+ });
29
36
  config = (0, _withGoogleServicesJsonFile.withGoogleServicesJsonFile)(config, platformConfig);
30
37
  } else if (sdkConfig && isSwiftProject) {
31
- config = (0, _withCIOIosSwift.withCIOIosSwift)(config, sdkConfig, platformConfig);
38
+ config = (0, _withCIOIosSwift.withCIOIosSwift)(config, sdkConfig, platformConfig, location);
39
+ if (locationEnabled) {
40
+ config = (0, _withXcodeProject.withCioXcodeProject)(config, {
41
+ ...platformConfig,
42
+ podfileOptions: {
43
+ locationEnabled: true,
44
+ hasPush: false
45
+ }
46
+ });
47
+ }
48
+ } else if (locationEnabled) {
49
+ // Location-only: no push, no config. Still add Podfile location subspec so CIO_LOCATION_ENABLED is set and native location code is included.
50
+ config = (0, _withXcodeProject.withCioXcodeProject)(config, {
51
+ ...platformConfig,
52
+ podfileOptions: {
53
+ locationEnabled: true,
54
+ hasPush: false
55
+ }
56
+ });
32
57
  }
33
58
  return config;
34
59
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_config","require","_logger","_utils","_withAppDelegateModifications","_withCIOIosSwift","_withGoogleServicesJsonFile","_withNotificationsXcodeProject","_withXcodeProject","withCIOIos","config","sdkConfig","props","isSwiftProject","isExpoVersion53OrHigher","platformConfig","mergeDeprecatedPropertiesAndLogWarnings","pushNotification","withCIOIosSwift","withAppDelegateModifications","env","mergeConfigWithEnvValues","withCioNotificationsXcodeProject","withCioXcodeProject","withGoogleServicesJsonFile","deprecatedTopLevelProperties","showPushAppInForeground","autoTrackPushEvents","handleDeeplinkInKilledState","disableNotificationRegistration","autoFetchDeviceToken","Object","entries","forEach","key","value","undefined","logger","warn","propKey"],"sources":["withCIOIos.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type {\n CustomerIOPluginOptionsIOS,\n CustomerIOPluginPushNotificationOptions,\n NativeSDKConfig,\n} from '../types/cio-types';\nimport { mergeConfigWithEnvValues } from '../utils/config';\nimport { logger } from '../utils/logger';\nimport { isExpoVersion53OrHigher } from './utils';\nimport { withAppDelegateModifications } from './withAppDelegateModifications';\nimport { withCIOIosSwift } from './withCIOIosSwift';\nimport { withGoogleServicesJsonFile } from './withGoogleServicesJsonFile';\nimport { withCioNotificationsXcodeProject } from './withNotificationsXcodeProject';\nimport { withCioXcodeProject } from './withXcodeProject';\n\nexport function withCIOIos(\n config: ExpoConfig,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsIOS,\n) {\n const isSwiftProject = isExpoVersion53OrHigher(config);\n const platformConfig = mergeDeprecatedPropertiesAndLogWarnings(props);\n\n if (platformConfig?.pushNotification) {\n if (isSwiftProject) {\n config = withCIOIosSwift(config, sdkConfig, platformConfig);\n } else {\n // Auto initialization is only supported in Swift projects (Expo SDK 53+)\n // Legacy Objective-C projects only support push notifications\n config = withAppDelegateModifications(config, platformConfig);\n }\n\n platformConfig.pushNotification.env = platformConfig.pushNotification.env\n || mergeConfigWithEnvValues(platformConfig, sdkConfig);\n config = withCioNotificationsXcodeProject(config, platformConfig);\n config = withCioXcodeProject(config, platformConfig);\n config = withGoogleServicesJsonFile(config, platformConfig);\n } else if (sdkConfig && isSwiftProject) {\n config = withCIOIosSwift(config, sdkConfig, platformConfig);\n }\n\n return config;\n}\n\n/** The basic purpose of this function is to centralize where we handle the deprecation\n by merging the deprecated properties into the new ios.pushNotification.* properties\n and logging a warning if they are set. This way, we can remove the deprecated properties\n from the top level of the ios object in the future, and update this function\n while the rest of the plugin code remains unchanged.\n*/\nconst mergeDeprecatedPropertiesAndLogWarnings = (\n props?: CustomerIOPluginOptionsIOS,\n): CustomerIOPluginOptionsIOS | undefined => {\n // The deprecatedTopLevelProperties maps the top level properties\n // that are deprecated to the new ios.pushNotification.* properties\n // that should be used instead. The deprecated properties are\n // still available for backwards compatibility, but they will\n // be removed in the future.\n\n if (!props) {\n return props\n }\n\n const deprecatedTopLevelProperties = {\n showPushAppInForeground: props.showPushAppInForeground,\n autoTrackPushEvents: props.autoTrackPushEvents,\n handleDeeplinkInKilledState: props.handleDeeplinkInKilledState,\n disableNotificationRegistration: props.disableNotificationRegistration,\n autoFetchDeviceToken: props.autoFetchDeviceToken,\n };\n\n // loop over all the deprecated properties and log a warning if they are set\n Object.entries(deprecatedTopLevelProperties).forEach(([key, value]) => {\n if (value !== undefined) {\n logger.warn(\n `The ios.${key} property is deprecated. Please use ios.pushNotification.${key} instead.`\n );\n\n if (props.pushNotification === undefined) {\n props.pushNotification = {} as CustomerIOPluginPushNotificationOptions;\n }\n const propKey = key as keyof CustomerIOPluginPushNotificationOptions;\n if (props.pushNotification[propKey] === undefined) {\n props.pushNotification = {\n ...props.pushNotification,\n [propKey]: value,\n };\n } else {\n logger.warn(\n `The ios.${key} property is deprecated. Since the value of ios.pushNotification.${key} is set, it will be used.`\n );\n }\n }\n });\n\n return props;\n};\n"],"mappings":";;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AACA,IAAAM,8BAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAEO,SAASQ,UAAUA,CACxBC,MAAkB,EAClBC,SAA2B,EAC3BC,KAAkC,EAClC;EACA,MAAMC,cAAc,GAAG,IAAAC,8BAAuB,EAACJ,MAAM,CAAC;EACtD,MAAMK,cAAc,GAAGC,uCAAuC,CAACJ,KAAK,CAAC;EAErE,IAAIG,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAEE,gBAAgB,EAAE;IACpC,IAAIJ,cAAc,EAAE;MAClBH,MAAM,GAAG,IAAAQ,gCAAe,EAACR,MAAM,EAAEC,SAAS,EA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GAAG,WAC/E,CAAC;MAED,IAAItB,KAAK,CAACK,gBAAgB,KAAKmB,SAAS,EAAE;QACxCxB,KAAK,CAACK,gBAAgB,GAAG,CAAC,CAA4C;MACxE;MACA,MAAMsB,OAAO,GAAGL,GAAoD;MACpE,IAAItB,KAAK,CAACK,gBAAgB,CAACsB,OAAO,CAAC,KAAKH,SAAS,EAAE;QACjDxB,KAAK,CAACK,gBAAgB,GAAG;UACvB,GAAGL,KAAK,CAACK,gBAAgB;UACzB,CAACsB,OAAO,GAAGJ;QACb,CAAC;MACH,CAAC,MAAM;QACLE,cAAM,CAACC,IAAI,CACT,WAAWJ,GAAG,oEAAoEA,GAAG,2BACvF,CAAC;MACH;IACF;EACF,CAAC,CAAC;EAEF,OAAOtB,KAAK;AACd,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_config","require","_logger","_utils","_withAppDelegateModifications","_withCIOIosSwift","_withGoogleServicesJsonFile","_withNotificationsXcodeProject","_withXcodeProject","withCIOIos","config","sdkConfig","props","location","isSwiftProject","isExpoVersion53OrHigher","platformConfig","mergeDeprecatedPropertiesAndLogWarnings","locationEnabled","enabled","pushNotification","withCIOIosSwift","withAppDelegateModifications","env","mergeConfigWithEnvValues","withCioNotificationsXcodeProject","withCioXcodeProject","podfileOptions","hasPush","withGoogleServicesJsonFile","deprecatedTopLevelProperties","showPushAppInForeground","autoTrackPushEvents","handleDeeplinkInKilledState","disableNotificationRegistration","autoFetchDeviceToken","Object","entries","forEach","key","value","undefined","logger","warn","propKey"],"sources":["withCIOIos.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type {\n CustomerIOPluginOptionsIOS,\n CustomerIOPluginPushNotificationOptions,\n CustomerIOPluginLocationOptions,\n NativeSDKConfig,\n} from '../types/cio-types';\nimport { mergeConfigWithEnvValues } from '../utils/config';\nimport { logger } from '../utils/logger';\nimport { isExpoVersion53OrHigher } from './utils';\nimport { withAppDelegateModifications } from './withAppDelegateModifications';\nimport { withCIOIosSwift } from './withCIOIosSwift';\nimport { withGoogleServicesJsonFile } from './withGoogleServicesJsonFile';\nimport { withCioNotificationsXcodeProject } from './withNotificationsXcodeProject';\nimport { withCioXcodeProject } from './withXcodeProject';\n\nexport function withCIOIos(\n config: ExpoConfig,\n sdkConfig?: NativeSDKConfig,\n props?: CustomerIOPluginOptionsIOS,\n location?: CustomerIOPluginLocationOptions,\n) {\n const isSwiftProject = isExpoVersion53OrHigher(config);\n const platformConfig = mergeDeprecatedPropertiesAndLogWarnings(props);\n const locationEnabled = location?.enabled === true;\n\n if (platformConfig?.pushNotification) {\n if (isSwiftProject) {\n config = withCIOIosSwift(config, sdkConfig, platformConfig, location);\n } else {\n // Auto initialization is only supported in Swift projects (Expo SDK 53+)\n // Legacy Objective-C projects only support push notifications\n config = withAppDelegateModifications(config, platformConfig);\n }\n\n platformConfig.pushNotification.env = platformConfig.pushNotification.env\n || mergeConfigWithEnvValues(platformConfig, sdkConfig);\n config = withCioNotificationsXcodeProject(config, platformConfig);\n config = withCioXcodeProject(config, {\n ...platformConfig,\n podfileOptions: {\n locationEnabled,\n hasPush: true,\n },\n });\n config = withGoogleServicesJsonFile(config, platformConfig);\n } else if (sdkConfig && isSwiftProject) {\n config = withCIOIosSwift(config, sdkConfig, platformConfig, location);\n if (locationEnabled) {\n config = withCioXcodeProject(config, {\n ...platformConfig,\n podfileOptions: { locationEnabled: true, hasPush: false },\n });\n }\n } else if (locationEnabled) {\n // Location-only: no push, no config. Still add Podfile location subspec so CIO_LOCATION_ENABLED is set and native location code is included.\n config = withCioXcodeProject(config, {\n ...platformConfig,\n podfileOptions: { locationEnabled: true, hasPush: false },\n });\n }\n\n return config;\n}\n\n/** The basic purpose of this function is to centralize where we handle the deprecation\n by merging the deprecated properties into the new ios.pushNotification.* properties\n and logging a warning if they are set. This way, we can remove the deprecated properties\n from the top level of the ios object in the future, and update this function\n while the rest of the plugin code remains unchanged.\n*/\nconst mergeDeprecatedPropertiesAndLogWarnings = (\n props?: CustomerIOPluginOptionsIOS,\n): CustomerIOPluginOptionsIOS | undefined => {\n // The deprecatedTopLevelProperties maps the top level properties\n // that are deprecated to the new ios.pushNotification.* properties\n // that should be used instead. The deprecated properties are\n // still available for backwards compatibility, but they will\n // be removed in the future.\n\n if (!props) {\n return props\n }\n\n const deprecatedTopLevelProperties = {\n showPushAppInForeground: props.showPushAppInForeground,\n autoTrackPushEvents: props.autoTrackPushEvents,\n handleDeeplinkInKilledState: props.handleDeeplinkInKilledState,\n disableNotificationRegistration: props.disableNotificationRegistration,\n autoFetchDeviceToken: props.autoFetchDeviceToken,\n };\n\n // loop over all the deprecated properties and log a warning if they are set\n Object.entries(deprecatedTopLevelProperties).forEach(([key, value]) => {\n if (value !== undefined) {\n logger.warn(\n `The ios.${key} property is deprecated. Please use ios.pushNotification.${key} instead.`\n );\n\n if (props.pushNotification === undefined) {\n props.pushNotification = {} as CustomerIOPluginPushNotificationOptions;\n }\n const propKey = key as keyof CustomerIOPluginPushNotificationOptions;\n if (props.pushNotification[propKey] === undefined) {\n props.pushNotification = {\n ...props.pushNotification,\n [propKey]: value,\n };\n } else {\n logger.warn(\n `The ios.${key} property is deprecated. Since the value of ios.pushNotification.${key} is set, it will be used.`\n );\n }\n }\n });\n\n return props;\n};\n"],"mappings":";;;;;;AAOA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AACA,IAAAM,8BAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAEO,SAASQ,UAAUA,CACxBC,MAAkB,EAClBC,SAA2B,EAC3BC,KAAkC,EAClCC,QAA0C,EAC1C;EACA,MAAMC,cAAc,GAAG,IAAAC,8BAAuB,EAACL,MAAM,CAAC;EACtD,MAAMM,cAAc,GAAGC,uCAAuC,CA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