customerio-expo-plugin 3.2.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 (44) hide show
  1. package/package.json +2 -2
  2. package/plugin/lib/commonjs/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
  3. package/plugin/lib/commonjs/helpers/native-files/ios/apn/NotificationService.swift +1 -1
  4. package/plugin/lib/commonjs/helpers/native-files/ios/apn/PushService.swift +1 -1
  5. package/plugin/lib/commonjs/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
  6. package/plugin/lib/commonjs/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
  7. package/plugin/lib/commonjs/helpers/native-files/ios/fcm/PushService.swift +1 -1
  8. package/plugin/lib/commonjs/ios/withCIOIos.js +17 -0
  9. package/plugin/lib/commonjs/ios/withCIOIos.js.map +1 -1
  10. package/plugin/lib/commonjs/ios/withCIOIosSwift.js +6 -3
  11. package/plugin/lib/commonjs/ios/withCIOIosSwift.js.map +1 -1
  12. package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js +45 -11
  13. package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -1
  14. package/plugin/lib/commonjs/types/cio-types.js.map +1 -1
  15. package/plugin/lib/commonjs/utils/validation.js +13 -0
  16. package/plugin/lib/commonjs/utils/validation.js.map +1 -1
  17. package/plugin/lib/module/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
  18. package/plugin/lib/module/helpers/native-files/ios/apn/NotificationService.swift +1 -1
  19. package/plugin/lib/module/helpers/native-files/ios/apn/PushService.swift +1 -1
  20. package/plugin/lib/module/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
  21. package/plugin/lib/module/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
  22. package/plugin/lib/module/helpers/native-files/ios/fcm/PushService.swift +1 -1
  23. package/plugin/lib/module/ios/withCIOIos.js +17 -0
  24. package/plugin/lib/module/ios/withCIOIos.js.map +1 -1
  25. package/plugin/lib/module/ios/withCIOIosSwift.js +6 -3
  26. package/plugin/lib/module/ios/withCIOIosSwift.js.map +1 -1
  27. package/plugin/lib/module/ios/withNotificationsXcodeProject.js +45 -11
  28. package/plugin/lib/module/ios/withNotificationsXcodeProject.js.map +1 -1
  29. package/plugin/lib/module/types/cio-types.js.map +1 -1
  30. package/plugin/lib/module/utils/validation.js +13 -1
  31. package/plugin/lib/module/utils/validation.js.map +1 -1
  32. package/plugin/lib/typescript/types/cio-types.d.ts +7 -0
  33. package/plugin/lib/typescript/utils/validation.d.ts +3 -2
  34. package/plugin/src/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
  35. package/plugin/src/helpers/native-files/ios/apn/NotificationService.swift +1 -1
  36. package/plugin/src/helpers/native-files/ios/apn/PushService.swift +1 -1
  37. package/plugin/src/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
  38. package/plugin/src/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
  39. package/plugin/src/helpers/native-files/ios/fcm/PushService.swift +1 -1
  40. package/plugin/src/ios/withCIOIos.ts +16 -0
  41. package/plugin/src/ios/withCIOIosSwift.ts +10 -0
  42. package/plugin/src/ios/withNotificationsXcodeProject.ts +56 -1
  43. package/plugin/src/types/cio-types.ts +8 -0
  44. 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