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
@@ -88,6 +88,13 @@ export type CustomerIOPluginOptionsAndroid = {
88
88
  disableAndroid16Support?: boolean;
89
89
  };
90
90
 
91
+ /**
92
+ * Location tracking mode for the Customer.io SDK location module.
93
+ * Location is off by default. Only used when location is enabled (plugin option location.enabled: true).
94
+ * @public
95
+ */
96
+ export type LocationTrackingMode = 'OFF' | 'MANUAL' | 'ON_APP_START';
97
+
91
98
  /**
92
99
  * SDK configuration options for auto initialization
93
100
  * @public
@@ -101,6 +108,24 @@ export type NativeSDKConfig = {
101
108
  logLevel?: 'none' | 'error' | 'info' | 'debug'; // Default: 'debug'. Controls SDK logging verbosity
102
109
  siteId?: string; // Optional, if only siteId defined, migrationSiteId = siteId
103
110
  migrationSiteId?: string; // Optional, if only migrationSiteId defined, siteId should be null
111
+ /**
112
+ * Location module config. Location is off by default; only applied when plugin option location.enabled is true.
113
+ * trackingMode: 'MANUAL' (host app controls when location is captured, default),
114
+ * 'ON_APP_START' (SDK captures once per launch when app becomes active), or 'OFF'.
115
+ */
116
+ location?: {
117
+ trackingMode?: LocationTrackingMode;
118
+ };
119
+ };
120
+
121
+ /**
122
+ * Location is off by default. When true, enables the Customer.io SDK location native module (iOS Podfile location subspec,
123
+ * Android gradle.properties flag). Permissions and privacy keys (Info.plist, AndroidManifest)
124
+ * remain the host app's responsibility.
125
+ * @public
126
+ */
127
+ export type CustomerIOPluginLocationOptions = {
128
+ enabled?: boolean;
104
129
  };
105
130
 
106
131
  /**
@@ -111,6 +136,11 @@ export type CustomerIOPluginOptions = {
111
136
  config?: NativeSDKConfig; // If defined, enables auto initialization of native SDK
112
137
  android: CustomerIOPluginOptionsAndroid;
113
138
  ios: CustomerIOPluginOptionsIOS;
139
+ /**
140
+ * Location is off by default. When location.enabled is true, the plugin adds SDK build-time setup (Podfile location subspec,
141
+ * gradle.properties). Host apps must add their own location permissions and privacy usage strings.
142
+ */
143
+ location?: CustomerIOPluginLocationOptions;
114
144
  };
115
145
 
116
146
  /**