customerio-expo-plugin 3.1.0 → 3.3.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 (100) 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/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
  11. package/plugin/lib/commonjs/helpers/native-files/ios/apn/NotificationService.swift +1 -1
  12. package/plugin/lib/commonjs/helpers/native-files/ios/apn/PushService.swift +1 -1
  13. package/plugin/lib/commonjs/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
  14. package/plugin/lib/commonjs/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
  15. package/plugin/lib/commonjs/helpers/native-files/ios/fcm/PushService.swift +1 -1
  16. package/plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js +19 -2
  17. package/plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map +1 -1
  18. package/plugin/lib/commonjs/helpers/utils/patchLocationCode.js +50 -0
  19. package/plugin/lib/commonjs/helpers/utils/patchLocationCode.js.map +1 -0
  20. package/plugin/lib/commonjs/helpers/utils/patchPluginNativeCode.js +3 -1
  21. package/plugin/lib/commonjs/helpers/utils/patchPluginNativeCode.js.map +1 -1
  22. package/plugin/lib/commonjs/index.js +2 -2
  23. package/plugin/lib/commonjs/index.js.map +1 -1
  24. package/plugin/lib/commonjs/ios/withCIOIos.js +46 -4
  25. package/plugin/lib/commonjs/ios/withCIOIos.js.map +1 -1
  26. package/plugin/lib/commonjs/ios/withCIOIosSwift.js +25 -12
  27. package/plugin/lib/commonjs/ios/withCIOIosSwift.js.map +1 -1
  28. package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js +45 -11
  29. package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -1
  30. package/plugin/lib/commonjs/ios/withXcodeProject.js +4 -1
  31. package/plugin/lib/commonjs/ios/withXcodeProject.js.map +1 -1
  32. package/plugin/lib/commonjs/types/cio-types.js.map +1 -1
  33. package/plugin/lib/commonjs/utils/validation.js +13 -0
  34. package/plugin/lib/commonjs/utils/validation.js.map +1 -1
  35. package/plugin/lib/module/android/withCIOAndroid.js +13 -2
  36. package/plugin/lib/module/android/withCIOAndroid.js.map +1 -1
  37. package/plugin/lib/module/android/withLocationGradleProperties.js +30 -0
  38. package/plugin/lib/module/android/withLocationGradleProperties.js.map +1 -0
  39. package/plugin/lib/module/android/withMainApplicationModifications.js +20 -4
  40. package/plugin/lib/module/android/withMainApplicationModifications.js.map +1 -1
  41. package/plugin/lib/module/helpers/native-files/android/CustomerIOSDKInitializer.kt +2 -0
  42. package/plugin/lib/module/helpers/native-files/ios/CustomerIOSDKInitializer.swift +2 -0
  43. package/plugin/lib/module/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
  44. package/plugin/lib/module/helpers/native-files/ios/apn/NotificationService.swift +1 -1
  45. package/plugin/lib/module/helpers/native-files/ios/apn/PushService.swift +1 -1
  46. package/plugin/lib/module/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
  47. package/plugin/lib/module/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
  48. package/plugin/lib/module/helpers/native-files/ios/fcm/PushService.swift +1 -1
  49. package/plugin/lib/module/helpers/utils/injectCIOPodfileCode.js +18 -2
  50. package/plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map +1 -1
  51. package/plugin/lib/module/helpers/utils/patchLocationCode.js +44 -0
  52. package/plugin/lib/module/helpers/utils/patchLocationCode.js.map +1 -0
  53. package/plugin/lib/module/helpers/utils/patchPluginNativeCode.js +3 -2
  54. package/plugin/lib/module/helpers/utils/patchPluginNativeCode.js.map +1 -1
  55. package/plugin/lib/module/index.js +2 -2
  56. package/plugin/lib/module/index.js.map +1 -1
  57. package/plugin/lib/module/ios/withCIOIos.js +46 -4
  58. package/plugin/lib/module/ios/withCIOIos.js.map +1 -1
  59. package/plugin/lib/module/ios/withCIOIosSwift.js +25 -12
  60. package/plugin/lib/module/ios/withCIOIosSwift.js.map +1 -1
  61. package/plugin/lib/module/ios/withNotificationsXcodeProject.js +45 -11
  62. package/plugin/lib/module/ios/withNotificationsXcodeProject.js.map +1 -1
  63. package/plugin/lib/module/ios/withXcodeProject.js +5 -1
  64. package/plugin/lib/module/ios/withXcodeProject.js.map +1 -1
  65. package/plugin/lib/module/types/cio-types.js.map +1 -1
  66. package/plugin/lib/module/utils/validation.js +13 -1
  67. package/plugin/lib/module/utils/validation.js.map +1 -1
  68. package/plugin/lib/typescript/android/withCIOAndroid.d.ts +2 -2
  69. package/plugin/lib/typescript/android/withLocationGradleProperties.d.ts +9 -0
  70. package/plugin/lib/typescript/android/withMainApplicationModifications.d.ts +7 -2
  71. package/plugin/lib/typescript/helpers/utils/injectCIOPodfileCode.d.ts +9 -1
  72. package/plugin/lib/typescript/helpers/utils/patchLocationCode.d.ts +12 -0
  73. package/plugin/lib/typescript/helpers/utils/patchPluginNativeCode.d.ts +3 -1
  74. package/plugin/lib/typescript/index.d.ts +2 -1
  75. package/plugin/lib/typescript/ios/withCIOIos.d.ts +2 -2
  76. package/plugin/lib/typescript/ios/withCIOIosSwift.d.ts +2 -2
  77. package/plugin/lib/typescript/ios/withXcodeProject.d.ts +8 -1
  78. package/plugin/lib/typescript/types/cio-types.d.ts +35 -0
  79. package/plugin/lib/typescript/utils/validation.d.ts +3 -2
  80. package/plugin/src/android/withCIOAndroid.ts +13 -2
  81. package/plugin/src/android/withLocationGradleProperties.ts +41 -0
  82. package/plugin/src/android/withMainApplicationModifications.ts +26 -4
  83. package/plugin/src/helpers/native-files/android/CustomerIOSDKInitializer.kt +2 -0
  84. package/plugin/src/helpers/native-files/ios/CustomerIOSDKInitializer.swift +2 -0
  85. package/plugin/src/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
  86. package/plugin/src/helpers/native-files/ios/apn/NotificationService.swift +1 -1
  87. package/plugin/src/helpers/native-files/ios/apn/PushService.swift +1 -1
  88. package/plugin/src/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
  89. package/plugin/src/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
  90. package/plugin/src/helpers/native-files/ios/fcm/PushService.swift +1 -1
  91. package/plugin/src/helpers/utils/injectCIOPodfileCode.ts +35 -3
  92. package/plugin/src/helpers/utils/patchLocationCode.ts +80 -0
  93. package/plugin/src/helpers/utils/patchPluginNativeCode.ts +10 -1
  94. package/plugin/src/index.ts +9 -3
  95. package/plugin/src/ios/withCIOIos.ts +40 -3
  96. package/plugin/src/ios/withCIOIosSwift.ts +30 -4
  97. package/plugin/src/ios/withNotificationsXcodeProject.ts +56 -1
  98. package/plugin/src/ios/withXcodeProject.ts +20 -3
  99. package/plugin/src/types/cio-types.ts +38 -0
  100. package/plugin/src/utils/validation.ts +18 -1
@@ -1,4 +1,4 @@
1
- import type { NativeSDKConfig, RichPushConfig } from '../types/cio-types';
1
+ import type { CustomerIOPluginPushNotificationOptions, NativeSDKConfig, RichPushConfig } from '../types/cio-types';
2
2
  import { logger } from './logger';
3
3
 
4
4
  /**
@@ -109,8 +109,25 @@ function validateRichPushConfig(config: RichPushConfig | undefined): boolean {
109
109
  return isValid;
110
110
  }
111
111
 
112
+ function validatePushNotificationOptions(options: CustomerIOPluginPushNotificationOptions): boolean {
113
+ const context = 'PushNotification';
114
+
115
+ let isValid = true;
116
+
117
+ const appGroupId = options.appGroupId;
118
+ if (appGroupId !== undefined) {
119
+ isValid = validateString(appGroupId, 'appGroupId', context) && isValid;
120
+ if (isValid && !appGroupId.startsWith('group.')) {
121
+ logger.warn(`${context}: appGroupId "${appGroupId}" does not start with "group." — ensure this matches your Apple App Group entitlement.`);
122
+ }
123
+ }
124
+
125
+ return isValid;
126
+ }
127
+
112
128
  export {
113
129
  validateNativeSDKConfig,
130
+ validatePushNotificationOptions,
114
131
  validateRequired,
115
132
  validateRichPushConfig,
116
133
  validateString