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.
- package/package.json +2 -2
- package/plugin/lib/commonjs/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
- package/plugin/lib/commonjs/helpers/native-files/ios/apn/NotificationService.swift +1 -1
- package/plugin/lib/commonjs/helpers/native-files/ios/apn/PushService.swift +1 -1
- package/plugin/lib/commonjs/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
- package/plugin/lib/commonjs/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
- package/plugin/lib/commonjs/helpers/native-files/ios/fcm/PushService.swift +1 -1
- package/plugin/lib/commonjs/ios/withCIOIos.js +17 -0
- package/plugin/lib/commonjs/ios/withCIOIos.js.map +1 -1
- package/plugin/lib/commonjs/ios/withCIOIosSwift.js +6 -3
- package/plugin/lib/commonjs/ios/withCIOIosSwift.js.map +1 -1
- package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js +45 -11
- package/plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -1
- package/plugin/lib/commonjs/types/cio-types.js.map +1 -1
- package/plugin/lib/commonjs/utils/validation.js +13 -0
- package/plugin/lib/commonjs/utils/validation.js.map +1 -1
- package/plugin/lib/module/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
- package/plugin/lib/module/helpers/native-files/ios/apn/NotificationService.swift +1 -1
- package/plugin/lib/module/helpers/native-files/ios/apn/PushService.swift +1 -1
- package/plugin/lib/module/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
- package/plugin/lib/module/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
- package/plugin/lib/module/helpers/native-files/ios/fcm/PushService.swift +1 -1
- package/plugin/lib/module/ios/withCIOIos.js +17 -0
- package/plugin/lib/module/ios/withCIOIos.js.map +1 -1
- package/plugin/lib/module/ios/withCIOIosSwift.js +6 -3
- package/plugin/lib/module/ios/withCIOIosSwift.js.map +1 -1
- package/plugin/lib/module/ios/withNotificationsXcodeProject.js +45 -11
- package/plugin/lib/module/ios/withNotificationsXcodeProject.js.map +1 -1
- package/plugin/lib/module/types/cio-types.js.map +1 -1
- package/plugin/lib/module/utils/validation.js +13 -1
- package/plugin/lib/module/utils/validation.js.map +1 -1
- package/plugin/lib/typescript/types/cio-types.d.ts +7 -0
- package/plugin/lib/typescript/utils/validation.d.ts +3 -2
- package/plugin/src/helpers/native-files/ios/apn/CioSdkAppDelegateHandler.swift +1 -1
- package/plugin/src/helpers/native-files/ios/apn/NotificationService.swift +1 -1
- package/plugin/src/helpers/native-files/ios/apn/PushService.swift +1 -1
- package/plugin/src/helpers/native-files/ios/fcm/CioSdkAppDelegateHandler.swift +1 -1
- package/plugin/src/helpers/native-files/ios/fcm/NotificationService.swift +1 -1
- package/plugin/src/helpers/native-files/ios/fcm/PushService.swift +1 -1
- package/plugin/src/ios/withCIOIos.ts +16 -0
- package/plugin/src/ios/withCIOIosSwift.ts +10 -0
- package/plugin/src/ios/withNotificationsXcodeProject.ts +56 -1
- package/plugin/src/types/cio-types.ts +8 -0
- 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
|