Skip to content

Instantly share code, notes, and snippets.

@darnfish
Created December 14, 2023 21:34
Show Gist options
  • Save darnfish/a93abf72fc1bacd453dad778dd149e7c to your computer and use it in GitHub Desktop.
Save darnfish/a93abf72fc1bacd453dad778dd149e7c to your computer and use it in GitHub Desktop.
diff --git a/node_modules/customerio-expo-plugin/.DS_Store b/node_modules/customerio-expo-plugin/.DS_Store
new file mode 100644
index 0000000..f5ec1db
Binary files /dev/null and b/node_modules/customerio-expo-plugin/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/.DS_Store b/node_modules/customerio-expo-plugin/lib/.DS_Store
new file mode 100644
index 0000000..dd26f62
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/.DS_Store b/node_modules/customerio-expo-plugin/lib/commonjs/.DS_Store
new file mode 100644
index 0000000..be53b7f
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/commonjs/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/.DS_Store b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/.DS_Store
new file mode 100644
index 0000000..8f97ff0
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js
index 5426e1f..5486469 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js
@@ -50,7 +50,7 @@ const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';
exports.DEFAULT_BUNDLE_SHORT_VERSION = DEFAULT_BUNDLE_SHORT_VERSION;
const CIO_TARGET_NAME = 'CustomerIOSDK';
exports.CIO_TARGET_NAME = CIO_TARGET_NAME;
-const CIO_NOTIFICATION_TARGET_NAME = 'NotificationService';
+const CIO_NOTIFICATION_TARGET_NAME = 'CIONotificationService';
exports.CIO_NOTIFICATION_TARGET_NAME = CIO_NOTIFICATION_TARGET_NAME;
const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;
exports.CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = CIO_APPDELEGATEHEADER_IMPORT_SNIPPET;
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js.map b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js.map
index 0f7a70c..d8c495e 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js.map
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/constants/ios.js.map
@@ -1 +1 @@
-{"version":3,"names":["finder","require","path","f","__dirname","pluginPackageRoot","next","filename","dirname","LOCAL_PATH_TO_RN_SDK","join","exports","LOCAL_PATH_TO_CIO_NSE_FILES","getRelativePathToRNSDK","currentFile","relative","IOS_DEPLOYMENT_TARGET","GROUP_IDENTIFIER_TEMPLATE_REGEX","BUNDLE_SHORT_VERSION_TEMPLATE_REGEX","BUNDLE_VERSION_TEMPLATE_REGEX","CIO_DIDFINISHLAUNCHINGMETHOD_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX","CIO_APPDELEGATEDECLARATION_REGEX","CIO_APPDELEGATEHEADER_REGEX","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_DEEPLINK_COMMENT_REGEX","DEFAULT_BUNDLE_VERSION","DEFAULT_BUNDLE_SHORT_VERSION","CIO_TARGET_NAME","CIO_NOTIFICATION_TARGET_NAME","CIO_APPDELEGATEHEADER_IMPORT_SNIPPET","CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET","CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET","CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET","CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET","CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET","CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET","CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET","CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET"],"sources":["ios.ts"],"sourcesContent":["const finder = require('find-package-json');\nconst path = require('path');\n\nconst f = finder(__dirname);\nlet pluginPackageRoot = f.next().filename;\n// This is the path to the root of the customerio-expo-plugin package\npluginPackageRoot = path.dirname(pluginPackageRoot);\n\nexport const LOCAL_PATH_TO_RN_SDK = path.join(\n pluginPackageRoot,\n '../customerio-reactnative'\n)\n\nexport const LOCAL_PATH_TO_CIO_NSE_FILES = path.join(\n pluginPackageRoot,\n 'src/helpers/native-files/ios'\n);\n\nexport function getRelativePathToRNSDK(currentFile: string) {\n return path.relative(path.dirname(currentFile), LOCAL_PATH_TO_RN_SDK);\n}\n\nexport const IOS_DEPLOYMENT_TARGET = '13.0';\nexport const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;\nexport const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;\nexport const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;\nexport const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX =\n /.*\\[super(\\s)application:application(\\s)didFinishLaunchingWithOptions:launchOptions\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX =\n /return \\[super application:application didFailToRegisterForRemoteNotificationsWithError:error\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX =\n /(- \\(void\\)application:\\(UIApplication \\*\\)application didFailToRegisterForRemoteNotificationsWithError:\\(NSError \\*\\)error(\\s|\\n)*?\\{)(.|\\n){2}.*\\n\\}/;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX =\n /return \\[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken\\];/;\n\nexport const CIO_APPDELEGATEDECLARATION_REGEX =\n /@implementation AppDelegate(.|\\n)/;\n\nexport const CIO_APPDELEGATEHEADER_REGEX =\n /(@interface AppDelegate\\s*:\\s*EXAppDelegateWrapper\\s*)(<([^>]+)>)?/;\n\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*RCTBridge\\s*\\*\\s*\\w+\\s*=\\s*\\[\\s*self\\.reactDelegate\\s+createBridgeWithDelegate:self\\s+launchOptions:launchOptions\\s*\\];\\s*$/gm;\n\nexport const CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*return\\s\\[\\s*super\\s*application:\\s*application\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\];/gm;\n\nexport const CIO_DEEPLINK_COMMENT_REGEX = /\\sDeep link workaround for app killed state start/gm;\nexport const DEFAULT_BUNDLE_VERSION = '1';\nexport const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';\nexport const CIO_TARGET_NAME = 'CustomerIOSDK';\nexport const CIO_NOTIFICATION_TARGET_NAME = 'NotificationService';\n\nexport const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;\nexport const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = 'UNUserNotificationCenterDelegate';\nexport const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `\nCIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];\n`;\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET = `\nRCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:modifiedLaunchOptions];\n`;\n\nexport const CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET = `\nreturn [super application:application didFinishLaunchingWithOptions:modifiedLaunchOptions];`\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `\n [super application:application didFailToRegisterForRemoteNotificationsWithError:error];\n [pnHandlerObj application:application error:error];\n`;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `\n [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n return [pnHandlerObj application:application deviceToken:deviceToken];\n`;\n\nexport const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `\n // Register for push notifications\n [pnHandlerObj registerPushNotification];\n`;\n\nexport const CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET = `\n UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];\n center.delegate = self;\n`;\n\nexport const CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET = `\n// Deep link workaround for app killed state start\nNSMutableDictionary *modifiedLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];\n if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {\n NSDictionary *pushContent = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];\n if (pushContent[@\"CIO\"] && pushContent[@\"CIO\"][@\"push\"] && pushContent[@\"CIO\"][@\"push\"][@\"link\"]) {\n NSString *initialURL = pushContent[@\"CIO\"][@\"push\"][@\"link\"];\n if (!launchOptions[UIApplicationLaunchOptionsURLKey]) {\n modifiedLaunchOptions[UIApplicationLaunchOptionsURLKey] = [NSURL URLWithString:initialURL];\n }\n }\n }\n//Deep link workaround for app killed state ends\n`;\n\n// Enable push handling - notification response\nexport const CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = `\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {\n [pnHandlerObj userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];\n}`;\n\n// Foreground push handling\nexport const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `\n// show push when the app is in foreground\n- (void)userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification:(UNNotification* )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {\n completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);\n}`;\nexport const CIO_REGISTER_PUSHNOTIFICATION_SNIPPET = `\n@objc(registerPushNotification)\n public func registerPushNotification() {\n\n let center = UNUserNotificationCenter.current()\n center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in\n if error == nil{\n DispatchQueue.main.async {\n UIApplication.shared.registerForRemoteNotifications()\n }\n }\n }\n }`;\n"],"mappings":";;;;;;;AAAA,MAAMA,MAAM,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAE5B,MAAME,CAAC,GAAGH,MAAM,CAACI,SAAS,CAAC;AAC3B,IAAIC,iBAAiB,GAAGF,CAAC,CAACG,IAAI,CAAC,CAAC,CAACC,QAAQ;AACzC;AACAF,iBAAiB,GAAGH,IAAI,CAACM,OAAO,CAACH,iBAAiB,CAAC;AAE5C,MAAMI,o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AAC;AAAC9B,OAAA,CAAA8B,iDAAA,GAAAA,iDAAA;AAEK,MAAMC,yCAAyC,GAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AAAA/B,OAAA,CAAA+B,yCAAA,GAAAA,yCAAA;AACO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,EAAE;;AAEF;AAAAhC,OAAA,CAAAgC,iDAAA,GAAAA,iDAAA;AACO,MAAMC,0CAA0C,GAAI;AAC3D;AACA;AACA;AACA,EAAE;AAACjC,OAAA,CAAAiC,0CAAA,GAAAA,0CAAA;AACI,MAAMC,qCAAqC,GAAI;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AAAClC,OAAA,CAAAkC,qCAAA,GAAAA,qCAAA"}
\ No newline at end of file
+{"version":3,"names":["finder","require","path","f","__dirname","pluginPackageRoot","next","filename","dirname","LOCAL_PATH_TO_RN_SDK","join","exports","LOCAL_PATH_TO_CIO_NSE_FILES","getRelativePathToRNSDK","currentFile","relative","IOS_DEPLOYMENT_TARGET","GROUP_IDENTIFIER_TEMPLATE_REGEX","BUNDLE_SHORT_VERSION_TEMPLATE_REGEX","BUNDLE_VERSION_TEMPLATE_REGEX","CIO_DIDFINISHLAUNCHINGMETHOD_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX","CIO_APPDELEGATEDECLARATION_REGEX","CIO_APPDELEGATEHEADER_REGEX","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_DEEPLINK_COMMENT_REGEX","DEFAULT_BUNDLE_VERSION","DEFAULT_BUNDLE_SHORT_VERSION","CIO_TARGET_NAME","CIO_NOTIFICATION_TARGET_NAME","CIO_APPDELEGATEHEADER_IMPORT_SNIPPET","CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET","CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET","CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET","CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET","CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET","CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET","CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET","CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET"],"sources":["ios.ts"],"sourcesContent":["const finder = require('find-package-json');\nconst path = require('path');\n\nconst f = finder(__dirname);\nlet pluginPackageRoot = f.next().filename;\n// This is the path to the root of the customerio-expo-plugin package\npluginPackageRoot = path.dirname(pluginPackageRoot);\n\nexport const LOCAL_PATH_TO_RN_SDK = path.join(\n pluginPackageRoot,\n '../customerio-reactnative'\n)\n\nexport const LOCAL_PATH_TO_CIO_NSE_FILES = path.join(\n pluginPackageRoot,\n 'src/helpers/native-files/ios'\n);\n\nexport function getRelativePathToRNSDK(currentFile: string) {\n return path.relative(path.dirname(currentFile), LOCAL_PATH_TO_RN_SDK);\n}\n\nexport const IOS_DEPLOYMENT_TARGET = '13.0';\nexport const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;\nexport const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;\nexport const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;\nexport const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX =\n /.*\\[super(\\s)application:application(\\s)didFinishLaunchingWithOptions:launchOptions\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX =\n /return \\[super application:application didFailToRegisterForRemoteNotificationsWithError:error\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX =\n /(- \\(void\\)application:\\(UIApplication \\*\\)application didFailToRegisterForRemoteNotificationsWithError:\\(NSError \\*\\)error(\\s|\\n)*?\\{)(.|\\n){2}.*\\n\\}/;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX =\n /return \\[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken\\];/;\n\nexport const CIO_APPDELEGATEDECLARATION_REGEX =\n /@implementation AppDelegate(.|\\n)/;\n\nexport const CIO_APPDELEGATEHEADER_REGEX =\n /(@interface AppDelegate\\s*:\\s*EXAppDelegateWrapper\\s*)(<([^>]+)>)?/;\n\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*RCTBridge\\s*\\*\\s*\\w+\\s*=\\s*\\[\\s*self\\.reactDelegate\\s+createBridgeWithDelegate:self\\s+launchOptions:launchOptions\\s*\\];\\s*$/gm;\n\nexport const CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*return\\s\\[\\s*super\\s*application:\\s*application\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\];/gm;\n\nexport const CIO_DEEPLINK_COMMENT_REGEX = /\\sDeep link workaround for app killed state start/gm;\nexport const DEFAULT_BUNDLE_VERSION = '1';\nexport const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';\nexport const CIO_TARGET_NAME = 'CustomerIOSDK';\nexport const CIO_NOTIFICATION_TARGET_NAME = 'CIONotificationService';\n\nexport const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;\nexport const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = 'UNUserNotificationCenterDelegate';\nexport const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `\nCIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];\n`;\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET = `\nRCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:modifiedLaunchOptions];\n`;\n\nexport const CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET = `\nreturn [super application:application didFinishLaunchingWithOptions:modifiedLaunchOptions];`\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `\n [super application:application didFailToRegisterForRemoteNotificationsWithError:error];\n [pnHandlerObj application:application error:error];\n`;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `\n [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n return [pnHandlerObj application:application deviceToken:deviceToken];\n`;\n\nexport const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `\n // Register for push notifications\n [pnHandlerObj registerPushNotification];\n`;\n\nexport const CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET = `\n UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];\n center.delegate = self;\n`;\n\nexport const CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET = `\n// Deep link workaround for app killed state start\nNSMutableDictionary *modifiedLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];\n if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {\n NSDictionary *pushContent = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];\n if (pushContent[@\"CIO\"] && pushContent[@\"CIO\"][@\"push\"] && pushContent[@\"CIO\"][@\"push\"][@\"link\"]) {\n NSString *initialURL = pushContent[@\"CIO\"][@\"push\"][@\"link\"];\n if (!launchOptions[UIApplicationLaunchOptionsURLKey]) {\n modifiedLaunchOptions[UIApplicationLaunchOptionsURLKey] = [NSURL URLWithString:initialURL];\n }\n }\n }\n//Deep link workaround for app killed state ends\n`;\n\n// Enable push handling - notification response\nexport const CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = `\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {\n [pnHandlerObj userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];\n}`;\n\n// Foreground push handling\nexport const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `\n// show push when the app is in foreground\n- (void)userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification:(UNNotification* )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {\n completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);\n}`;\nexport const CIO_REGISTER_PUSHNOTIFICATION_SNIPPET = `\n@objc(registerPushNotification)\n public func registerPushNotification() {\n\n let center = UNUserNotificationCenter.current()\n center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in\n if error == nil{\n DispatchQueue.main.async {\n UIApplication.shared.registerForRemoteNotifications()\n }\n }\n }\n }`;\n"],"mappings":";;;;;;;AAAA,MAAMA,MAAM,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAE5B,MAAME,CAAC,GAAGH,MAAM,CAACI,SAAS,CAAC;AAC3B,IAAIC,iBAAiB,GAAGF,CAAC,CAACG,IAAI,CAAC,CAAC,CAACC,QAAQ;AACzC;A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CAAA6B,2CAAA,GAAAA,2CAAA;AAEK,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,CAAC;AAAC9B,OAAA,CAAA8B,iDAAA,GAAAA,iDAAA;AAEK,MAAMC,yCAAyC,GAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AAAA/B,OAAA,CAAA+B,yCAAA,GAAAA,yCAAA;AACO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,EAAE;;AAEF;AAAAhC,OAAA,CAAAgC,iDAAA,GAAAA,iDAAA;AACO,MAAMC,0CAA0C,GAAI;AAC3D;AACA;AACA;AACA,EAAE;AAACjC,OAAA,CAAAiC,0CAAA,GAAAA,0CAAA;AACI,MAAMC,qCAAqC,GAAI;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AAAClC,OAAA,CAAAkC,qCAAA,GAAAA,qCAAA"}
\ No newline at end of file
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/.DS_Store b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/.DS_Store
new file mode 100644
index 0000000..80587be
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService-Info.plist b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService-Info.plist
similarity index 91%
rename from node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService-Info.plist
rename to node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService-Info.plist
index cc44286..cdd1994 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService-Info.plist
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService-Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
- <string>NotificationServiceExtension</string>
+ <string>CIONotificationServiceExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -25,7 +25,7 @@
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
- <string>NotificationService</string>
+ <string>CIONotificationService</string>
</dict>
</dict>
</plist>
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.h b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.h
new file mode 100644
index 0000000..f888bdd
--- /dev/null
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.h
@@ -0,0 +1,5 @@
+#import <UserNotifications/UserNotifications.h>
+
+@interface CIONotificationService : UNNotificationServiceExtension
+
+@end
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.m b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.m
similarity index 67%
rename from node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.m
rename to node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.m
index d684015..f83e911 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.m
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.m
@@ -1,25 +1,25 @@
-#import "NotificationService.h"
-#import "NotificationService-Swift.h"
+#import "CIONotificationService.h"
+#import "CIONotificationService-Swift.h"
-@interface NotificationService ()
+@interface CIONotificationService ()
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@end
-@implementation NotificationService
+@implementation CIONotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
- NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
+ CIONotificationServiceManager* cioManagerObj = [[CIONotificationServiceManager alloc] init];
[cioManagerObj didReceive:request withContentHandler:contentHandler];
}
- (void)serviceExtensionTimeWillExpire {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
- NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
+ CIONotificationServiceManager* cioManagerObj = [[CIONotificationServiceManager alloc] init];
[cioManagerObj serviceExtensionTimeWillExpire];
}
diff --git a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.swift b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.swift
similarity index 92%
rename from node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.swift
rename to node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.swift
index 0e30100..e920fde 100644
--- a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.swift
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/CIONotificationService.swift
@@ -4,7 +4,7 @@ import CioTracking
import CioMessagingPushAPN
@objc
-public class NotificationServiceCioManager : NSObject {
+public class CIONotificationServiceManager : NSObject {
public override init() {}
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.h b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.h
deleted file mode 100644
index 32d6298..0000000
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#import <UserNotifications/UserNotifications.h>
-
-@interface NotificationService : UNNotificationServiceExtension
-
-@end
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js
index e62b11b..90251b4 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js
@@ -38,7 +38,7 @@ async function injectCIONotificationPodfileCode(iosPath, useFrameworks) {
if (!matches) {
const snippetToInjectInPodfile = `
${blockStart}
-target 'NotificationService' do
+target 'CIONotificationService' do
${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}
pod 'customerio-reactnative-richpush/apn', :path => '${(0, _ios.getRelativePathToRNSDK)(filename)}'
end
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map
index 960d8ec..a302a64 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map
@@ -1 +1 @@
-{"version":3,"names":["_ios","require","_codeInjection","_fileManagement","injectCIOPodfileCode","iosPath","blockStart","blockEnd","filename","podfile","FileManagement","read","matches","match","RegExp","lineInPodfileToInjectSnippetBefore","snippetToInjectInPodfile","getRelativePathToRNSDK","trim","write","injectCodeByRegex","join","console","log","injectCIONotificationPodfileCode","useFrameworks","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport { getRelativePathToRNSDK } from '../constants/ios';\nimport { injectCodeByRegex } from './codeInjection';\nimport { FileManagement } from './fileManagement';\n\nexport async function injectCIOPodfileCode(iosPath: string) {\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/apn', :path => '${getRelativePathToRNSDK(filename)}'\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 console.log('CustomerIO Podfile snippets already exists. Skipping...');\n }\n}\n\nexport async function injectCIONotificationPodfileCode(\n iosPath: string,\n useFrameworks: CustomerIOPluginOptionsIOS['useFrameworks']\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/apn', :path => '${getRelativePathToRNSDK(filename)}'\nend\n${blockEnd}\n`.trim();\n\n FileManagement.append(filename, snippetToInjectInPodfile);\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEO,eAAeG,oBAAoBA,CAACC,OAAe,EAAE;EAC1D,MAAMC,UAAU,GAAG,qCAAqC;EACxD,MAAMC,QAAQ,GAAG,mCAAmC;EAEpD,MAAMC,QAAQ,GAAI,GAAEH,OAAQ,UAAS;EACrC,MAAMI,OAAO,GAAG,MAAMC,8BAAc,CAACC,IAAI,CAACH,QAAQ,CAAC;E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jection","_fileManagement","injectCIOPodfileCode","iosPath","blockStart","blockEnd","filename","podfile","FileManagement","read","matches","match","RegExp","lineInPodfileToInjectSnippetBefore","snippetToInjectInPodfile","getRelativePathToRNSDK","trim","write","injectCodeByRegex","join","console","log","injectCIONotificationPodfileCode","useFrameworks","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport { getRelativePathToRNSDK } from '../constants/ios';\nimport { injectCodeByRegex } from './codeInjection';\nimport { FileManagement } from './fileManagement';\n\nexport async function injectCIOPodfileCode(iosPath: string) {\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/apn', :path => '${getRelativePathToRNSDK(filename)}'\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 console.log('CustomerIO Podfile snippets already exists. Skipping...');\n }\n}\n\nexport async function injectCIONotificationPodfileCode(\n iosPath: string,\n useFrameworks: CustomerIOPluginOptionsIOS['useFrameworks']\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 'CIONotificationService' do\n ${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}\n pod 'customerio-reactnative-richpush/apn', :path => '${getRelativePathToRNSDK(filename)}'\nend\n${blockEnd}\n`.trim();\n\n FileManagement.append(filename, snippetToInjectInPodfile);\n }\n}\n"],"mappings":";;;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEO,eAAeG,oBAAoBA,CAACC,OAAe,EAAE;EAC1D,MAAMC,UAAU,GAAG,qCAAqC;EACxD,MAAMC,QAAQ,GAAG,mCAAmC;EAEpD,MAAMC,QAAQ,GAAI,GAAEH,OAAQ,UAAS;EACrC,MAAMI,OAAO,GAAG,MAAMC,8BAAc,CAACC,IAAI,CAACH,QAAQ,CAAC;EACnD,MAAMI,OAAO,GAAGH,OAAO,CAACI,KAAK,CAAC,IAAIC,MAAM,CAACR,UAAU,CAAC,CAAC;EAErD,IAAI,CAACM,OAAO,EAAE;IACZ;IACA;IACA;IACA,MAAMG,kCAAkC,GAAG,+BAA+B;IAE1E,MAAMC,wBAAwB,GAAI;AACtC,EAAEV,UAAW;AACb,gDAAgD,IAAAW,2BAAsB,EAACT,QAAQ,CAAE;AACjF,EAAED,QAAS;AACX,CAAC,CAACW,IAAI,CAAC,CAAC;IAEJR,8BAAc,CAACS,KAAK,CAClBX,QAAQ,EACR,IAAAY,gCAAiB,EACfX,OAAO,EACPM,kCAAkC,EAClCC,wBACF,CAAC,CAACK,IAAI,CAAC,IAAI,CACb,CAAC;EACH,CAAC,MAAM;IACLC,OAAO,CAACC,GAAG,CAAC,yDAAyD,CAAC;EACxE;AACF;AAEO,eAAeC,gCAAgCA,CACpDnB,OAAe,EACfoB,aAA0D,EAC1D;EACA,MAAMjB,QAAQ,GAAI,GAAEH,OAAQ,UAAS;EACrC,MAAMI,OAAO,GAAG,MAAMC,8BAAc,CAACC,IAAI,CAACH,QAAQ,CAAC;EAEnD,MAAMF,UAAU,GAAG,yCAAyC;EAC5D,MAAMC,QAAQ,GAAG,uCAAuC;EAExD,MAAMK,OAAO,GAAGH,OAAO,CAACI,KAAK,CAAC,IAAIC,MAAM,CAACR,UAAU,CAAC,CAAC;EAErD,IAAI,CAACM,OAAO,EAAE;IACZ,MAAMI,wBAAwB,GAAI;AACtC,EAAEV,UAAW;AACb;AACA,IAAImB,aAAa,KAAK,QAAQ,GAAG,qCAAqC,GAAG,EAAG;AAC5E,yDAAyD,IAAAR,2BAAsB,EAACT,QAAQ,CAAE;AAC1F;AACA,EAAED,QAAS;AACX,CAAC,CAACW,IAAI,CAAC,CAAC;IAEJR,8BAAc,CAACgB,MAAM,CAAClB,QAAQ,EAAEQ,wBAAwB,CAAC;EAC3D;AACF"}
\ No newline at end of file
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js b/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js
index 1c20031..1d6326e 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js
@@ -12,7 +12,7 @@ var _fileManagement = require("./../helpers/utils/fileManagement");
const PLIST_FILENAME = `${_ios.CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;
const ENV_FILENAME = 'Env.swift';
const TARGETED_DEVICE_FAMILY = `"1,2"`;
-const addNotificationServiceExtension = async (options, xcodeProject) => {
+const addCIONotificationServiceExtension = async (options, xcodeProject) => {
try {
var _options$pushNotifica;
if (options.pushNotification) {
@@ -40,9 +40,9 @@ const withCioNotificationsXcodeProject = (configOuter, props) => {
pushNotification,
useFrameworks
} = props;
- if (ios === undefined) throw new Error('Adding NotificationServiceExtension failed: ios config missing from app.config.js or app.json.');
+ if (ios === undefined) throw new Error('Adding CIONotificationServiceExtension failed: ios config missing from app.config.js or app.json.');
- // projectName and platformProjectRoot translates to appName and iosPath in addNotificationServiceExtension()
+ // projectName and platformProjectRoot translates to appName and iosPath in addCIONotificationServiceExtension()
const {
projectName,
platformProjectRoot
@@ -52,13 +52,13 @@ const withCioNotificationsXcodeProject = (configOuter, props) => {
buildNumber
} = ios;
if (bundleShortVersion === undefined) {
- throw new Error('Adding NotificationServiceExtension failed: version missing from app.config.js or app.json');
+ throw new Error('Adding CIONotificationServiceExtension failed: version missing from app.config.js or app.json');
}
if (bundleIdentifier === undefined) {
- throw new Error('Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json');
+ throw new Error('Adding CIONotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json');
}
if (projectName === undefined) {
- throw new Error('Adding NotificationServiceExtension failed: name missing from app.config.js or app.json');
+ throw new Error('Adding CIONotificationServiceExtension failed: name missing from app.config.js or app.json');
}
const options = {
...props,
@@ -72,7 +72,7 @@ const withCioNotificationsXcodeProject = (configOuter, props) => {
iosDeploymentTarget,
pushNotification
};
- const modifiedProjectFile = await addNotificationServiceExtension(options, config.modResults);
+ const modifiedProjectFile = await addCIONotificationServiceExtension(options, config.modResults);
if (modifiedProjectFile) {
config.modResults = modifiedProjectFile;
}
@@ -102,7 +102,7 @@ const addRichPushXcodeProj = async (options, xcodeProject) => {
_fileManagement.FileManagement.mkdir(nsePath, {
recursive: true
});
- const files = [PLIST_FILENAME, 'NotificationService.h', 'NotificationService.swift', 'NotificationService.m', ENV_FILENAME];
+ const files = [PLIST_FILENAME, 'CIONotificationService.h', 'CIONotificationService.swift', 'CIONotificationService.m', ENV_FILENAME];
const getTargetFile = filename => `${nsePath}/${filename}`;
files.forEach(filename => {
const targetFile = getTargetFile(filename);
@@ -147,7 +147,7 @@ const addRichPushXcodeProj = async (options, xcodeProject) => {
const nseTarget = xcodeProject.addTarget(_ios.CIO_NOTIFICATION_TARGET_NAME, 'app_extension', _ios.CIO_NOTIFICATION_TARGET_NAME, `${bundleIdentifier}.richpush`);
// Add build phases to the new target
- xcodeProject.addBuildPhase(['NotificationService.m', 'NotificationService.swift', 'Env.swift'], 'PBXSourcesBuildPhase', 'Sources', nseTarget.uuid);
+ xcodeProject.addBuildPhase(['CIONotificationService.m', 'CIONotificationService.swift', 'Env.swift'], 'PBXSourcesBuildPhase', 'Sources', nseTarget.uuid);
xcodeProject.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', nseTarget.uuid);
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', nseTarget.uuid);
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map b/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map
index 610aa75..aa4303a 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map
+++ b/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js.map
@@ -1 +1 @@
-{"version":3,"names":["_configPlugins","require","_ios","_codeInjection","_injectCIOPodfileCode","_fileManagement","PLIST_FILENAME","CIO_NOTIFICATION_TARGET_NAME","ENV_FILENAME","TARGETED_DEVICE_FAMILY","addNotificationServiceExtension","options","xcodeProject","_options$pushNotifica","pushNotification","addPushNotificationFile","useRichPush","addRichPushXcodeProj","error","console","withCioNotificationsXcodeProject","configOuter","props","withXcodeProject","config","modRequest","ios","version","bundleShortVersion","appleTeamId","iosDeploymentTarget","useFrameworks","undefined","Error","projectName","platformProjectRoot","bundleIdentifier","buildNumber","bundleVersion","DEFAULT_BUNDLE_VERSION","iosPath","appName","modifiedProjectFile","modResults","exports","injectCIONotificationPodfileCode","pbxTargetByName","warn","nsePath","FileManagement","mkdir","recursive","files","getTargetFile","filename","forEach","targetFile","copyFile","LOCAL_PATH_TO_CIO_NSE_FILES","infoPlistTargetFile","updateNseInfoPlist","updateNseEnv","extGroup","addPbxGroup","groups","hash","project","objects","Object","keys","key","name","path","addToPbxGroup","uuid","projObjects","nseTarget","addTarget","addBuildPhase","configurations","pbxXCBuildConfigurationSection","buildSettings","PRODUCT_NAME","buildSettingsObj","DEVELOPMENT_TEAM","IPHONEOS_DEPLOYMENT_TARGET","CODE_SIGN_STYLE","SWIFT_VERSION","addTargetAttribute","payload","BUNDLE_SHORT_VERSION_RE","BUNDLE_VERSION_RE","plistFileString","readFile","replaceCodeByRegex","writeFile","envFileName","_options$pushNotifica2","_options$pushNotifica4","_options$pushNotifica6","SITE_ID_RE","API_KEY_RE","REGION_RE","envFileContent","env","siteId","_options$pushNotifica3","apiKey","_options$pushNotifica5","region","_options$pushNotifica7","regionMap","us","eu","toLowerCase","mappedRegion","_options$pushNotifica8","file","appPath","exists","log","updatePushFile","group","pbxCreateGroup","classesKey","findPBXGroupKey","addSourceFile","REGISTER_RE","snippet","disableNotificationRegistration","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET"],"sources":["withNotificationsXcodeProject.ts"],"sourcesContent":["import {\n ConfigPlugin,\n XcodeProject,\n withXcodeProject,\n} from '@expo/config-plugins';\n\nimport {\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_REGISTER_PUSHNOTIFICATION_SNIPPET,\n DEFAULT_BUNDLE_VERSION,\n LOCAL_PATH_TO_CIO_NSE_FILES,\n} from '../helpers/constants/ios';\nimport { replaceCodeByRegex } from '../helpers/utils/codeInjection';\nimport { injectCIONotificationPodfileCode } from '../helpers/utils/injectCIOPodfileCode';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { FileManagement } from './../helpers/utils/fileManagement';\n\nconst PLIST_FILENAME = `${CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;\nconst ENV_FILENAME = 'Env.swift';\n\nconst TARGETED_DEVICE_FAMILY = `\"1,2\"`;\n\nconst addNotificationServiceExtension = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: XcodeProject\n) => {\n try {\n if (options.pushNotification) {\n await addPushNotificationFile(options, xcodeProject);\n }\n\n if (options.pushNotification?.useRichPush) {\n await addRichPushXcodeProj(options, xcodeProject);\n }\n return xcodeProject;\n } catch (error: any) {\n console.error(error);\n return null;\n }\n};\n\nexport const withCioNotificationsXcodeProject: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (configOuter, props) => {\n return withXcodeProject(configOuter, async (config) => {\n const { modRequest, ios, version: bundleShortVersion } = config;\n const {\n appleTeamId,\n iosDeploymentTarget,\n pushNotification,\n useFrameworks,\n } = props;\n\n if (ios === undefined)\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios config missing from app.config.js or app.json.'\n );\n\n // projectName and platformProjectRoot translates to appName and iosPath in addNotificationServiceExtension()\n const { projectName, platformProjectRoot } = modRequest;\n const { bundleIdentifier, buildNumber } = ios;\n\n if (bundleShortVersion === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: version missing from app.config.js or app.json'\n );\n }\n\n if (bundleIdentifier === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json'\n );\n }\n\n if (projectName === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: name missing from app.config.js or app.json'\n );\n }\n\n const options = {\n ...props,\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion: buildNumber || DEFAULT_BUNDLE_VERSION,\n iosPath: platformProjectRoot,\n appName: projectName,\n useFrameworks,\n iosDeploymentTarget,\n pushNotification,\n };\n\n const modifiedProjectFile = await addNotificationServiceExtension(\n options,\n config.modResults\n );\n\n if (modifiedProjectFile) {\n config.modResults = modifiedProjectFile;\n }\n\n return config;\n });\n};\n\nconst addRichPushXcodeProj = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) => {\n const {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion,\n iosPath,\n iosDeploymentTarget,\n useFrameworks,\n } = options;\n\n await injectCIONotificationPodfileCode(iosPath, useFrameworks);\n\n // Check if `CIO_NOTIFICATION_TARGET_NAME` group already exist in the project\n // If true then skip creating a new group to avoid duplicate folders\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n const nsePath = `${iosPath}/${CIO_NOTIFICATION_TARGET_NAME}`;\n FileManagement.mkdir(nsePath, {\n recursive: true,\n });\n\n const files = [\n PLIST_FILENAME,\n 'NotificationService.h',\n 'NotificationService.swift',\n 'NotificationService.m',\n ENV_FILENAME,\n ];\n\n const getTargetFile = (filename: string) => `${nsePath}/${filename}`;\n\n files.forEach((filename) => {\n const targetFile = getTargetFile(filename);\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`,\n targetFile\n );\n });\n\n /* MODIFY COPIED EXTENSION FILES */\n const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);\n updateNseInfoPlist({\n bundleVersion,\n bundleShortVersion,\n infoPlistTargetFile,\n });\n updateNseEnv(options, getTargetFile(ENV_FILENAME));\n\n // Create new PBXGroup for the extension\n const extGroup = xcodeProject.addPbxGroup(\n files,\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_NOTIFICATION_TARGET_NAME\n );\n\n // Add the new PBXGroup to the top level group. This makes the\n // files / folder appear in the file explorer in Xcode.\n const groups = xcodeProject.hash.project.objects['PBXGroup'];\n Object.keys(groups).forEach((key) => {\n if (groups[key].name === undefined && groups[key].path === undefined) {\n xcodeProject.addToPbxGroup(extGroup.uuid, key);\n }\n });\n\n // WORK AROUND for codeProject.addTarget BUG\n // Xcode projects don't contain these if there is only one target\n // An upstream fix should be made to the code referenced in this link:\n // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860\n const projObjects = xcodeProject.hash.project.objects;\n projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};\n projObjects['PBXContainerItemProxy'] =\n projObjects['PBXTargetDependency'] || {};\n\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n // Add the NSE target\n // This also adds PBXTargetDependency and PBXContainerItemProxy\n const nseTarget = xcodeProject.addTarget(\n CIO_NOTIFICATION_TARGET_NAME,\n 'app_extension',\n CIO_NOTIFICATION_TARGET_NAME,\n `${bundleIdentifier}.richpush`\n );\n\n // Add build phases to the new target\n xcodeProject.addBuildPhase(\n ['NotificationService.m', 'NotificationService.swift', 'Env.swift'],\n 'PBXSourcesBuildPhase',\n 'Sources',\n nseTarget.uuid\n );\n xcodeProject.addBuildPhase(\n [],\n 'PBXResourcesBuildPhase',\n 'Resources',\n nseTarget.uuid\n );\n\n xcodeProject.addBuildPhase(\n [],\n 'PBXFrameworksBuildPhase',\n 'Frameworks',\n nseTarget.uuid\n );\n\n // Edit the Deployment info of the target\n const configurations = xcodeProject.pbxXCBuildConfigurationSection();\n for (const key in configurations) {\n if (\n typeof configurations[key].buildSettings !== 'undefined' &&\n configurations[key].buildSettings.PRODUCT_NAME ===\n `\"${CIO_NOTIFICATION_TARGET_NAME}\"`\n ) {\n const buildSettingsObj = configurations[key].buildSettings;\n buildSettingsObj.DEVELOPMENT_TEAM = appleTeamId;\n buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET =\n iosDeploymentTarget || '13.0';\n buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY;\n buildSettingsObj.CODE_SIGN_STYLE = 'Automatic';\n buildSettingsObj.SWIFT_VERSION = 4.2;\n }\n }\n\n // Add development team to the target & the main\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId, nseTarget);\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId);\n};\n\nconst updateNseInfoPlist = (payload: {\n bundleVersion?: string;\n bundleShortVersion?: string;\n infoPlistTargetFile: string;\n}) => {\n const BUNDLE_SHORT_VERSION_RE = /\\{\\{BUNDLE_SHORT_VERSION\\}\\}/;\n const BUNDLE_VERSION_RE = /\\{\\{BUNDLE_VERSION\\}\\}/;\n\n let plistFileString = FileManagement.readFile(payload.infoPlistTargetFile);\n\n if (payload.bundleVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_VERSION_RE,\n payload.bundleVersion\n );\n }\n\n if (payload.bundleShortVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_SHORT_VERSION_RE,\n payload.bundleShortVersion\n );\n }\n\n FileManagement.writeFile(payload.infoPlistTargetFile, plistFileString);\n};\n\nconst updateNseEnv = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const SITE_ID_RE = /\\{\\{SITE_ID\\}\\}/;\n const API_KEY_RE = /\\{\\{API_KEY\\}\\}/;\n const REGION_RE = /\\{\\{REGION\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n if (options.pushNotification?.env?.siteId) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n SITE_ID_RE,\n options.pushNotification?.env?.siteId\n );\n }\n\n if (options.pushNotification?.env?.apiKey) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n API_KEY_RE,\n options.pushNotification?.env?.apiKey\n );\n }\n\n if (options.pushNotification?.env?.region) {\n const regionMap = {\n us: 'Region.US',\n eu: 'Region.EU',\n };\n const region = options.pushNotification?.env?.region?.toLowerCase();\n const mappedRegion = (regionMap as any)[region] || '';\n if (!mappedRegion) {\n console.warn(\n `${options.pushNotification?.env?.region} is an invalid region. Please use the values from the docs: https://customer.io/docs/sdk/expo/getting-started/#configure-the-plugin`\n );\n } else {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n REGION_RE,\n mappedRegion\n );\n }\n }\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n\nasync function addPushNotificationFile(\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) {\n const { iosPath, appName } = options;\n const file = 'PushService.swift';\n const appPath = `${iosPath}/${appName}`;\n const getTargetFile = (filename: string) => `${appPath}/${filename}`;\n const targetFile = getTargetFile(file);\n\n // Check whether {file} exists in the project. If false, then add the file\n // If {file} exists then skip and return\n if (!FileManagement.exists(getTargetFile(file))) {\n FileManagement.mkdir(appPath, {\n recursive: true,\n });\n\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`,\n targetFile\n );\n } else {\n console.log(`${getTargetFile(file)} already exists. Skipping...`);\n return;\n }\n\n updatePushFile(options, targetFile);\n\n const group = xcodeProject.pbxCreateGroup('CustomerIONotifications');\n const classesKey = xcodeProject.findPBXGroupKey({ name: `${appName}` });\n xcodeProject.addToPbxGroup(group, classesKey);\n\n xcodeProject.addSourceFile(`${appName}/${file}`, null, group);\n}\n\nconst updatePushFile = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const REGISTER_RE = /\\{\\{REGISTER_SNIPPET\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n let snippet = '';\n if (\n options.disableNotificationRegistration !== undefined &&\n options.disableNotificationRegistration === false\n ) {\n snippet = CIO_REGISTER_PUSHNOTIFICATION_SNIPPET;\n }\n\n envFileContent = replaceCodeByRegex(envFileContent, REGISTER_RE, snippet);\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AAMA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAI,GAAEC,iCAA6B,aAAY;AACnE,MAAMC,YAAY,GAAG,WAAW;AAEhC,MAAMC,sBAAsB,GAAI,OAAM;AAEtC,MAAMC,+BAA+B,GAAG,MAAAA,CACtCC,OAAmC,EACnCC,YAA0B,KACvB;EACH,IAAI;IAAA,IAAAC,qBAAA;IACF,IAAIF,OAAO,CAACG,gBAAgB,EAAE;MAC5B,MAAMC,uBAAuB,CAACJ,OAAO,EAAEC,YAAY,C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AmC,EACnCqF,WAAmB,KAChB;EACH,MAAM+B,WAAW,GAAG,0BAA0B;EAE9C,IAAIxB,cAAc,GAAGtD,8BAAc,CAAC4C,QAAQ,CAACG,WAAW,CAAC;EAEzD,IAAIgC,OAAO,GAAG,EAAE;EAChB,IACErH,OAAO,CAACsH,+BAA+B,KAAKjG,SAAS,IACrDrB,OAAO,CAACsH,+BAA+B,KAAK,KAAK,EACjD;IACAD,OAAO,GAAGE,0CAAqC;EACjD;EAEA3B,cAAc,GAAG,IAAAT,iCAAkB,EAACS,cAAc,EAAEwB,WAAW,EAAEC,OAAO,CAAC;EAEzE/E,8BAAc,CAAC8C,SAAS,CAACC,WAAW,EAAEO,cAAc,CAAC;AACvD,CAAC"}
\ No newline at end of file
+{"version":3,"names":["_configPlugins","require","_ios","_codeInjection","_injectCIOPodfileCode","_fileManagement","PLIST_FILENAME","CIO_NOTIFICATION_TARGET_NAME","ENV_FILENAME","TARGETED_DEVICE_FAMILY","addCIONotificationServiceExtension","options","xcodeProject","_options$pushNotifica","pushNotification","addPushNotificationFile","useRichPush","addRichPushXcodeProj","error","console","withCioNotificationsXcodeProject","configOuter","props","withXcodeProject","config","modRequest","ios","version","bundleShortVersion","appleTeamId","iosDeploymentTarget","useFrameworks","undefined","Error","projectName","platformProjectRoot","bundleIdentifier","buildNumber","bundleVersion","DEFAULT_BUNDLE_VERSION","iosPath","appName","modifiedProjectFile","modResults","exports","injectCIONotificationPodfileCode","pbxTargetByName","warn","nsePath","FileManagement","mkdir","recursive","files","getTargetFile","filename","forEach","targetFile","copyFile","LOCAL_PATH_TO_CIO_NSE_FILES","infoPlistTargetFile","updateNseInfoPlist","updateNseEnv","extGroup","addPbxGroup","groups","hash","project","objects","Object","keys","key","name","path","addToPbxGroup","uuid","projObjects","nseTarget","addTarget","addBuildPhase","configurations","pbxXCBuildConfigurationSection","buildSettings","PRODUCT_NAME","buildSettingsObj","DEVELOPMENT_TEAM","IPHONEOS_DEPLOYMENT_TARGET","CODE_SIGN_STYLE","SWIFT_VERSION","addTargetAttribute","payload","BUNDLE_SHORT_VERSION_RE","BUNDLE_VERSION_RE","plistFileString","readFile","replaceCodeByRegex","writeFile","envFileName","_options$pushNotifica2","_options$pushNotifica4","_options$pushNotifica6","SITE_ID_RE","API_KEY_RE","REGION_RE","envFileContent","env","siteId","_options$pushNotifica3","apiKey","_options$pushNotifica5","region","_options$pushNotifica7","regionMap","us","eu","toLowerCase","mappedRegion","_options$pushNotifica8","file","appPath","exists","log","updatePushFile","group","pbxCreateGroup","classesKey","findPBXGroupKey","addSourceFile","REGISTER_RE","snippet","disableNotificationRegistration","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET"],"sources":["withNotificationsXcodeProject.ts"],"sourcesContent":["import {\n ConfigPlugin,\n XcodeProject,\n withXcodeProject,\n} from '@expo/config-plugins';\n\nimport {\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_REGISTER_PUSHNOTIFICATION_SNIPPET,\n DEFAULT_BUNDLE_VERSION,\n LOCAL_PATH_TO_CIO_NSE_FILES,\n} from '../helpers/constants/ios';\nimport { replaceCodeByRegex } from '../helpers/utils/codeInjection';\nimport { injectCIONotificationPodfileCode } from '../helpers/utils/injectCIOPodfileCode';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { FileManagement } from './../helpers/utils/fileManagement';\n\nconst PLIST_FILENAME = `${CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;\nconst ENV_FILENAME = 'Env.swift';\n\nconst TARGETED_DEVICE_FAMILY = `\"1,2\"`;\n\nconst addCIONotificationServiceExtension = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: XcodeProject\n) => {\n try {\n if (options.pushNotification) {\n await addPushNotificationFile(options, xcodeProject);\n }\n\n if (options.pushNotification?.useRichPush) {\n await addRichPushXcodeProj(options, xcodeProject);\n }\n return xcodeProject;\n } catch (error: any) {\n console.error(error);\n return null;\n }\n};\n\nexport const withCioNotificationsXcodeProject: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (configOuter, props) => {\n return withXcodeProject(configOuter, async (config) => {\n const { modRequest, ios, version: bundleShortVersion } = config;\n const {\n appleTeamId,\n iosDeploymentTarget,\n pushNotification,\n useFrameworks,\n } = props;\n\n if (ios === undefined)\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: ios config missing from app.config.js or app.json.'\n );\n\n // projectName and platformProjectRoot translates to appName and iosPath in addCIONotificationServiceExtension()\n const { projectName, platformProjectRoot } = modRequest;\n const { bundleIdentifier, buildNumber } = ios;\n\n if (bundleShortVersion === undefined) {\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: version missing from app.config.js or app.json'\n );\n }\n\n if (bundleIdentifier === undefined) {\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json'\n );\n }\n\n if (projectName === undefined) {\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: name missing from app.config.js or app.json'\n );\n }\n\n const options = {\n ...props,\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion: buildNumber || DEFAULT_BUNDLE_VERSION,\n iosPath: platformProjectRoot,\n appName: projectName,\n useFrameworks,\n iosDeploymentTarget,\n pushNotification,\n };\n\n const modifiedProjectFile = await addCIONotificationServiceExtension(\n options,\n config.modResults\n );\n\n if (modifiedProjectFile) {\n config.modResults = modifiedProjectFile;\n }\n\n return config;\n });\n};\n\nconst addRichPushXcodeProj = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) => {\n const {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion,\n iosPath,\n iosDeploymentTarget,\n useFrameworks,\n } = options;\n\n await injectCIONotificationPodfileCode(iosPath, useFrameworks);\n\n // Check if `CIO_NOTIFICATION_TARGET_NAME` group already exist in the project\n // If true then skip creating a new group to avoid duplicate folders\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n const nsePath = `${iosPath}/${CIO_NOTIFICATION_TARGET_NAME}`;\n FileManagement.mkdir(nsePath, {\n recursive: true,\n });\n\n const files = [\n PLIST_FILENAME,\n 'CIONotificationService.h',\n 'CIONotificationService.swift',\n 'CIONotificationService.m',\n ENV_FILENAME,\n ];\n\n const getTargetFile = (filename: string) => `${nsePath}/${filename}`;\n\n files.forEach((filename) => {\n const targetFile = getTargetFile(filename);\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`,\n targetFile\n );\n });\n\n /* MODIFY COPIED EXTENSION FILES */\n const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);\n updateNseInfoPlist({\n bundleVersion,\n bundleShortVersion,\n infoPlistTargetFile,\n });\n updateNseEnv(options, getTargetFile(ENV_FILENAME));\n\n // Create new PBXGroup for the extension\n const extGroup = xcodeProject.addPbxGroup(\n files,\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_NOTIFICATION_TARGET_NAME\n );\n\n // Add the new PBXGroup to the top level group. This makes the\n // files / folder appear in the file explorer in Xcode.\n const groups = xcodeProject.hash.project.objects['PBXGroup'];\n Object.keys(groups).forEach((key) => {\n if (groups[key].name === undefined && groups[key].path === undefined) {\n xcodeProject.addToPbxGroup(extGroup.uuid, key);\n }\n });\n\n // WORK AROUND for codeProject.addTarget BUG\n // Xcode projects don't contain these if there is only one target\n // An upstream fix should be made to the code referenced in this link:\n // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860\n const projObjects = xcodeProject.hash.project.objects;\n projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};\n projObjects['PBXContainerItemProxy'] =\n projObjects['PBXTargetDependency'] || {};\n\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n // Add the NSE target\n // This also adds PBXTargetDependency and PBXContainerItemProxy\n const nseTarget = xcodeProject.addTarget(\n CIO_NOTIFICATION_TARGET_NAME,\n 'app_extension',\n CIO_NOTIFICATION_TARGET_NAME,\n `${bundleIdentifier}.richpush`\n );\n\n // Add build phases to the new target\n xcodeProject.addBuildPhase(\n ['CIONotificationService.m', 'CIONotificationService.swift', 'Env.swift'],\n 'PBXSourcesBuildPhase',\n 'Sources',\n nseTarget.uuid\n );\n xcodeProject.addBuildPhase(\n [],\n 'PBXResourcesBuildPhase',\n 'Resources',\n nseTarget.uuid\n );\n\n xcodeProject.addBuildPhase(\n [],\n 'PBXFrameworksBuildPhase',\n 'Frameworks',\n nseTarget.uuid\n );\n\n // Edit the Deployment info of the target\n const configurations = xcodeProject.pbxXCBuildConfigurationSection();\n for (const key in configurations) {\n if (\n typeof configurations[key].buildSettings !== 'undefined' &&\n configurations[key].buildSettings.PRODUCT_NAME ===\n `\"${CIO_NOTIFICATION_TARGET_NAME}\"`\n ) {\n const buildSettingsObj = configurations[key].buildSettings;\n buildSettingsObj.DEVELOPMENT_TEAM = appleTeamId;\n buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET =\n iosDeploymentTarget || '13.0';\n buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY;\n buildSettingsObj.CODE_SIGN_STYLE = 'Automatic';\n buildSettingsObj.SWIFT_VERSION = 4.2;\n }\n }\n\n // Add development team to the target & the main\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId, nseTarget);\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId);\n};\n\nconst updateNseInfoPlist = (payload: {\n bundleVersion?: string;\n bundleShortVersion?: string;\n infoPlistTargetFile: string;\n}) => {\n const BUNDLE_SHORT_VERSION_RE = /\\{\\{BUNDLE_SHORT_VERSION\\}\\}/;\n const BUNDLE_VERSION_RE = /\\{\\{BUNDLE_VERSION\\}\\}/;\n\n let plistFileString = FileManagement.readFile(payload.infoPlistTargetFile);\n\n if (payload.bundleVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_VERSION_RE,\n payload.bundleVersion\n );\n }\n\n if (payload.bundleShortVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_SHORT_VERSION_RE,\n payload.bundleShortVersion\n );\n }\n\n FileManagement.writeFile(payload.infoPlistTargetFile, plistFileString);\n};\n\nconst updateNseEnv = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const SITE_ID_RE = /\\{\\{SITE_ID\\}\\}/;\n const API_KEY_RE = /\\{\\{API_KEY\\}\\}/;\n const REGION_RE = /\\{\\{REGION\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n if (options.pushNotification?.env?.siteId) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n SITE_ID_RE,\n options.pushNotification?.env?.siteId\n );\n }\n\n if (options.pushNotification?.env?.apiKey) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n API_KEY_RE,\n options.pushNotification?.env?.apiKey\n );\n }\n\n if (options.pushNotification?.env?.region) {\n const regionMap = {\n us: 'Region.US',\n eu: 'Region.EU',\n };\n const region = options.pushNotification?.env?.region?.toLowerCase();\n const mappedRegion = (regionMap as any)[region] || '';\n if (!mappedRegion) {\n console.warn(\n `${options.pushNotification?.env?.region} is an invalid region. Please use the values from the docs: https://customer.io/docs/sdk/expo/getting-started/#configure-the-plugin`\n );\n } else {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n REGION_RE,\n mappedRegion\n );\n }\n }\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n\nasync function addPushNotificationFile(\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) {\n const { iosPath, appName } = options;\n const file = 'PushService.swift';\n const appPath = `${iosPath}/${appName}`;\n const getTargetFile = (filename: string) => `${appPath}/${filename}`;\n const targetFile = getTargetFile(file);\n\n // Check whether {file} exists in the project. If false, then add the file\n // If {file} exists then skip and return\n if (!FileManagement.exists(getTargetFile(file))) {\n FileManagement.mkdir(appPath, {\n recursive: true,\n });\n\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`,\n targetFile\n );\n } else {\n console.log(`${getTargetFile(file)} already exists. Skipping...`);\n return;\n }\n\n updatePushFile(options, targetFile);\n\n const group = xcodeProject.pbxCreateGroup('CustomerIONotifications');\n const classesKey = xcodeProject.findPBXGroupKey({ name: `${appName}` });\n xcodeProject.addToPbxGroup(group, classesKey);\n\n xcodeProject.addSourceFile(`${appName}/${file}`, null, group);\n}\n\nconst updatePushFile = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const REGISTER_RE = /\\{\\{REGISTER_SNIPPET\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n let snippet = '';\n if (\n options.disableNotificationRegistration !== undefined &&\n options.disableNotificationRegistration === false\n ) {\n snippet = CIO_REGISTER_PUSHNOTIFICATION_SNIPPET;\n }\n\n envFileContent = replaceCodeByRegex(envFileContent, REGISTER_RE, snippet);\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AAMA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAI,GAAEC,iCAA6B,aAAY;AACnE,MAAMC,YAAY,GAAG,WAAW;AAEhC,MAAMC,sBAAsB,GAAI,OAAM;AAEtC,MAAMC,+BAA+B,GAAG,MAAAA,CACtCC,OAAmC,EACnCC,YAA0B,KACvB;EACH,IAAI;IAAA,IAAAC,qBAAA;IACF,IAAIF,OAAO,CAACG,gBAAgB,EAAE;MAC5B,MAAMC,uBAAuB,CAACJ,OAAO,EAAEC,YAAY,CAAC;IACtD;IAEA,KAAAC,qBAAA,GA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AM+B,WAAW,GAAG,0BAA0B;EAE9C,IAAIxB,cAAc,GAAGtD,8BAAc,CAAC4C,QAAQ,CAACG,WAAW,CAAC;EAEzD,IAAIgC,OAAO,GAAG,EAAE;EAChB,IACErH,OAAO,CAACsH,+BAA+B,KAAKjG,SAAS,IACrDrB,OAAO,CAACsH,+BAA+B,KAAK,KAAK,EACjD;IACAD,OAAO,GAAGE,0CAAqC;EACjD;EAEA3B,cAAc,GAAG,IAAAT,iCAAkB,EAACS,cAAc,EAAEwB,WAAW,EAAEC,OAAO,CAAC;EAEzE/E,8BAAc,CAAC8C,SAAS,CAACC,WAAW,EAAEO,cAAc,CAAC;AACvD,CAAC"}
\ No newline at end of file
diff --git a/node_modules/customerio-expo-plugin/lib/module/.DS_Store b/node_modules/customerio-expo-plugin/lib/module/.DS_Store
new file mode 100644
index 0000000..2ef7729
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/module/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/.DS_Store b/node_modules/customerio-expo-plugin/lib/module/helpers/.DS_Store
new file mode 100644
index 0000000..cfba5f4
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/module/helpers/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js b/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js
index 37e7393..8ea2afa 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js
@@ -25,7 +25,7 @@ export const CIO_DEEPLINK_COMMENT_REGEX = /\sDeep link workaround for app killed
export const DEFAULT_BUNDLE_VERSION = '1';
export const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';
export const CIO_TARGET_NAME = 'CustomerIOSDK';
-export const CIO_NOTIFICATION_TARGET_NAME = 'NotificationService';
+export const CIO_NOTIFICATION_TARGET_NAME = 'CIONotificationService';
export const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;
export const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = 'UNUserNotificationCenterDelegate';
export const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js.map b/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js.map
index bb71efb..ca0a5ab 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js.map
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/constants/ios.js.map
@@ -1 +1 @@
-{"version":3,"names":["finder","require","path","f","__dirname","pluginPackageRoot","next","filename","dirname","LOCAL_PATH_TO_RN_SDK","join","LOCAL_PATH_TO_CIO_NSE_FILES","getRelativePathToRNSDK","currentFile","relative","IOS_DEPLOYMENT_TARGET","GROUP_IDENTIFIER_TEMPLATE_REGEX","BUNDLE_SHORT_VERSION_TEMPLATE_REGEX","BUNDLE_VERSION_TEMPLATE_REGEX","CIO_DIDFINISHLAUNCHINGMETHOD_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX","CIO_APPDELEGATEDECLARATION_REGEX","CIO_APPDELEGATEHEADER_REGEX","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_DEEPLINK_COMMENT_REGEX","DEFAULT_BUNDLE_VERSION","DEFAULT_BUNDLE_SHORT_VERSION","CIO_TARGET_NAME","CIO_NOTIFICATION_TARGET_NAME","CIO_APPDELEGATEHEADER_IMPORT_SNIPPET","CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET","CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET","CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET","CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET","CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET","CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET","CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET","CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET"],"sources":["ios.ts"],"sourcesContent":["const finder = require('find-package-json');\nconst path = require('path');\n\nconst f = finder(__dirname);\nlet pluginPackageRoot = f.next().filename;\n// This is the path to the root of the customerio-expo-plugin package\npluginPackageRoot = path.dirname(pluginPackageRoot);\n\nexport const LOCAL_PATH_TO_RN_SDK = path.join(\n pluginPackageRoot,\n '../customerio-reactnative'\n)\n\nexport const LOCAL_PATH_TO_CIO_NSE_FILES = path.join(\n pluginPackageRoot,\n 'src/helpers/native-files/ios'\n);\n\nexport function getRelativePathToRNSDK(currentFile: string) {\n return path.relative(path.dirname(currentFile), LOCAL_PATH_TO_RN_SDK);\n}\n\nexport const IOS_DEPLOYMENT_TARGET = '13.0';\nexport const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;\nexport const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;\nexport const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;\nexport const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX =\n /.*\\[super(\\s)application:application(\\s)didFinishLaunchingWithOptions:launchOptions\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX =\n /return \\[super application:application didFailToRegisterForRemoteNotificationsWithError:error\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX =\n /(- \\(void\\)application:\\(UIApplication \\*\\)application didFailToRegisterForRemoteNotificationsWithError:\\(NSError \\*\\)error(\\s|\\n)*?\\{)(.|\\n){2}.*\\n\\}/;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX =\n /return \\[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken\\];/;\n\nexport const CIO_APPDELEGATEDECLARATION_REGEX =\n /@implementation AppDelegate(.|\\n)/;\n\nexport const CIO_APPDELEGATEHEADER_REGEX =\n /(@interface AppDelegate\\s*:\\s*EXAppDelegateWrapper\\s*)(<([^>]+)>)?/;\n\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*RCTBridge\\s*\\*\\s*\\w+\\s*=\\s*\\[\\s*self\\.reactDelegate\\s+createBridgeWithDelegate:self\\s+launchOptions:launchOptions\\s*\\];\\s*$/gm;\n\nexport const CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*return\\s\\[\\s*super\\s*application:\\s*application\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\];/gm;\n\nexport const CIO_DEEPLINK_COMMENT_REGEX = /\\sDeep link workaround for app killed state start/gm;\nexport const DEFAULT_BUNDLE_VERSION = '1';\nexport const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';\nexport const CIO_TARGET_NAME = 'CustomerIOSDK';\nexport const CIO_NOTIFICATION_TARGET_NAME = 'NotificationService';\n\nexport const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;\nexport const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = 'UNUserNotificationCenterDelegate';\nexport const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `\nCIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];\n`;\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET = `\nRCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:modifiedLaunchOptions];\n`;\n\nexport const CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET = `\nreturn [super application:application didFinishLaunchingWithOptions:modifiedLaunchOptions];`\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `\n [super application:application didFailToRegisterForRemoteNotificationsWithError:error];\n [pnHandlerObj application:application error:error];\n`;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `\n [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n return [pnHandlerObj application:application deviceToken:deviceToken];\n`;\n\nexport const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `\n // Register for push notifications\n [pnHandlerObj registerPushNotification];\n`;\n\nexport const CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET = `\n UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];\n center.delegate = self;\n`;\n\nexport const CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET = `\n// Deep link workaround for app killed state start\nNSMutableDictionary *modifiedLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];\n if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {\n NSDictionary *pushContent = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];\n if (pushContent[@\"CIO\"] && pushContent[@\"CIO\"][@\"push\"] && pushContent[@\"CIO\"][@\"push\"][@\"link\"]) {\n NSString *initialURL = pushContent[@\"CIO\"][@\"push\"][@\"link\"];\n if (!launchOptions[UIApplicationLaunchOptionsURLKey]) {\n modifiedLaunchOptions[UIApplicationLaunchOptionsURLKey] = [NSURL URLWithString:initialURL];\n }\n }\n }\n//Deep link workaround for app killed state ends\n`;\n\n// Enable push handling - notification response\nexport const CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = `\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {\n [pnHandlerObj userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];\n}`;\n\n// Foreground push handling\nexport const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `\n// show push when the app is in foreground\n- (void)userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification:(UNNotification* )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {\n completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);\n}`;\nexport const CIO_REGISTER_PUSHNOTIFICATION_SNIPPET = `\n@objc(registerPushNotification)\n public func registerPushNotification() {\n\n let center = UNUserNotificationCenter.current()\n center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in\n if error == nil{\n DispatchQueue.main.async {\n UIApplication.shared.registerForRemoteNotifications()\n }\n }\n }\n }`;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAE5B,MAAME,CAAC,GAAGH,MAAM,CAACI,SAAS,CAAC;AAC3B,IAAIC,iBAAiB,GAAGF,CAAC,CAACG,IAAI,CAAC,CAAC,CAACC,QAAQ;AACzC;AACAF,iBAAiB,GAAGH,IAAI,CAACM,OAAO,CAACH,iBAAiB,CAAC;AAEnD,OAAO,MAAMI,oBAAoB,GAAGP,IAAI,CAACQ,IAAI,CAC3CL,iBAAiB,EACjB,2BACF,CAAC;AAED,OAAO,MAAMM,2BAA2B,G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AAO,MAAMC,4DAA4D,GAAI;AAC7E;AACA;AACA,CAAC;AAED,OAAO,MAAMC,2CAA2C,GAAI;AAC5D;AACA;AACA,CAAC;AAED,OAAO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,CAAC;AAED,OAAO,MAAMC,yCAAyC,GAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,OAAO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,EAAE;;AAEF;AACA,OAAO,MAAMC,0CAA0C,GAAI;AAC3D;AACA;AACA;AACA,EAAE;AACF,OAAO,MAAMC,qCAAqC,GAAI;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI"}
\ No newline at end of file
+{"version":3,"names":["finder","require","path","f","__dirname","pluginPackageRoot","next","filename","dirname","LOCAL_PATH_TO_RN_SDK","join","LOCAL_PATH_TO_CIO_NSE_FILES","getRelativePathToRNSDK","currentFile","relative","IOS_DEPLOYMENT_TARGET","GROUP_IDENTIFIER_TEMPLATE_REGEX","BUNDLE_SHORT_VERSION_TEMPLATE_REGEX","BUNDLE_VERSION_TEMPLATE_REGEX","CIO_DIDFINISHLAUNCHINGMETHOD_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX","CIO_APPDELEGATEDECLARATION_REGEX","CIO_APPDELEGATEHEADER_REGEX","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX","CIO_DEEPLINK_COMMENT_REGEX","DEFAULT_BUNDLE_VERSION","DEFAULT_BUNDLE_SHORT_VERSION","CIO_TARGET_NAME","CIO_NOTIFICATION_TARGET_NAME","CIO_APPDELEGATEHEADER_IMPORT_SNIPPET","CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET","CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET","CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET","CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET","CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET","CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET","CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET","CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET","CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET"],"sources":["ios.ts"],"sourcesContent":["const finder = require('find-package-json');\nconst path = require('path');\n\nconst f = finder(__dirname);\nlet pluginPackageRoot = f.next().filename;\n// This is the path to the root of the customerio-expo-plugin package\npluginPackageRoot = path.dirname(pluginPackageRoot);\n\nexport const LOCAL_PATH_TO_RN_SDK = path.join(\n pluginPackageRoot,\n '../customerio-reactnative'\n)\n\nexport const LOCAL_PATH_TO_CIO_NSE_FILES = path.join(\n pluginPackageRoot,\n 'src/helpers/native-files/ios'\n);\n\nexport function getRelativePathToRNSDK(currentFile: string) {\n return path.relative(path.dirname(currentFile), LOCAL_PATH_TO_RN_SDK);\n}\n\nexport const IOS_DEPLOYMENT_TARGET = '13.0';\nexport const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;\nexport const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;\nexport const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;\nexport const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX =\n /.*\\[super(\\s)application:application(\\s)didFinishLaunchingWithOptions:launchOptions\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX =\n /return \\[super application:application didFailToRegisterForRemoteNotificationsWithError:error\\];/;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX =\n /(- \\(void\\)application:\\(UIApplication \\*\\)application didFailToRegisterForRemoteNotificationsWithError:\\(NSError \\*\\)error(\\s|\\n)*?\\{)(.|\\n){2}.*\\n\\}/;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX =\n /return \\[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken\\];/;\n\nexport const CIO_APPDELEGATEDECLARATION_REGEX =\n /@implementation AppDelegate(.|\\n)/;\n\nexport const CIO_APPDELEGATEHEADER_REGEX =\n /(@interface AppDelegate\\s*:\\s*EXAppDelegateWrapper\\s*)(<([^>]+)>)?/;\n\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*RCTBridge\\s*\\*\\s*\\w+\\s*=\\s*\\[\\s*self\\.reactDelegate\\s+createBridgeWithDelegate:self\\s+launchOptions:launchOptions\\s*\\];\\s*$/gm;\n\nexport const CIO_LAUNCHOPTIONS_DEEPLINK_MODIFIEDOPTIONS_REGEX = \n/^\\s*return\\s\\[\\s*super\\s*application:\\s*application\\s*didFinishLaunchingWithOptions\\s*:\\s*launchOptions\\s*\\];/gm;\n\nexport const CIO_DEEPLINK_COMMENT_REGEX = /\\sDeep link workaround for app killed state start/gm;\nexport const DEFAULT_BUNDLE_VERSION = '1';\nexport const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';\nexport const CIO_TARGET_NAME = 'CustomerIOSDK';\nexport const CIO_NOTIFICATION_TARGET_NAME = 'CIONotificationService';\n\nexport const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;\nexport const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = 'UNUserNotificationCenterDelegate';\nexport const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `\nCIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];\n`;\nexport const CIO_RCTBRIDGE_DEEPLINK_MODIFIEDOPTIONS_SNIPPET = `\nRCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:modifiedLaunchOptions];\n`;\n\nexport const CIO_LAUNCHOPTIONS_MODIFIEDOPTIONS_SNIPPET = `\nreturn [super application:application didFinishLaunchingWithOptions:modifiedLaunchOptions];`\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `\n [super application:application didFailToRegisterForRemoteNotificationsWithError:error];\n [pnHandlerObj application:application error:error];\n`;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `\n [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];\n return [pnHandlerObj application:application deviceToken:deviceToken];\n`;\n\nexport const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `\n // Register for push notifications\n [pnHandlerObj registerPushNotification];\n`;\n\nexport const CIO_CONFIGURECIOSDKUSERNOTIFICATIONCENTER_SNIPPET = `\n UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];\n center.delegate = self;\n`;\n\nexport const CIO_CONFIGUREDEEPLINK_KILLEDSTATE_SNIPPET = `\n// Deep link workaround for app killed state start\nNSMutableDictionary *modifiedLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];\n if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {\n NSDictionary *pushContent = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];\n if (pushContent[@\"CIO\"] && pushContent[@\"CIO\"][@\"push\"] && pushContent[@\"CIO\"][@\"push\"][@\"link\"]) {\n NSString *initialURL = pushContent[@\"CIO\"][@\"push\"][@\"link\"];\n if (!launchOptions[UIApplicationLaunchOptionsURLKey]) {\n modifiedLaunchOptions[UIApplicationLaunchOptionsURLKey] = [NSURL URLWithString:initialURL];\n }\n }\n }\n//Deep link workaround for app killed state ends\n`;\n\n// Enable push handling - notification response\nexport const CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = `\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {\n [pnHandlerObj userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];\n}`;\n\n// Foreground push handling\nexport const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `\n// show push when the app is in foreground\n- (void)userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification:(UNNotification* )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {\n completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);\n}`;\nexport const CIO_REGISTER_PUSHNOTIFICATION_SNIPPET = `\n@objc(registerPushNotification)\n public func registerPushNotification() {\n\n let center = UNUserNotificationCenter.current()\n center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in\n if error == nil{\n DispatchQueue.main.async {\n UIApplication.shared.registerForRemoteNotifications()\n }\n }\n }\n }`;\n"],"mappings":"AAAA,MAAMA,MAAM,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAE5B,MAAME,CAAC,GAAGH,MAAM,CAACI,SAAS,CAAC;AAC3B,IAAIC,iBAAiB,GAAGF,CAAC,CAACG,IAAI,CAAC,CAAC,CAACC,QAAQ;AACzC;AACAF,iBAAiB,GAAGH,IAAI,CAACM,OAAO,CAACH,iBAAiB,C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AACA,CAAC;AAED,OAAO,MAAMC,yCAAyC,GAAI;AAC1D,4FAA4F;AAE5F,OAAO,MAAMC,4DAA4D,GAAI;AAC7E;AACA;AACA,CAAC;AAED,OAAO,MAAMC,4DAA4D,GAAI;AAC7E;AACA;AACA,CAAC;AAED,OAAO,MAAMC,2CAA2C,GAAI;AAC5D;AACA;AACA,CAAC;AAED,OAAO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,CAAC;AAED,OAAO,MAAMC,yCAAyC,GAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,OAAO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,EAAE;;AAEF;AACA,OAAO,MAAMC,0CAA0C,GAAI;AAC3D;AACA;AACA;AACA,EAAE;AACF,OAAO,MAAMC,qCAAqC,GAAI;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI"}
\ No newline at end of file
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/.DS_Store b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/.DS_Store
new file mode 100644
index 0000000..4cf9fc3
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService-Info.plist b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService-Info.plist
similarity index 91%
rename from node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService-Info.plist
rename to node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService-Info.plist
index cc44286..cdd1994 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService-Info.plist
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService-Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
- <string>NotificationServiceExtension</string>
+ <string>CIONotificationServiceExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -25,7 +25,7 @@
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
- <string>NotificationService</string>
+ <string>CIONotificationService</string>
</dict>
</dict>
</plist>
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.h b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.h
new file mode 100644
index 0000000..f888bdd
--- /dev/null
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.h
@@ -0,0 +1,5 @@
+#import <UserNotifications/UserNotifications.h>
+
+@interface CIONotificationService : UNNotificationServiceExtension
+
+@end
diff --git a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.m b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.m
similarity index 67%
rename from node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.m
rename to node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.m
index d684015..f83e911 100644
--- a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.m
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.m
@@ -1,25 +1,25 @@
-#import "NotificationService.h"
-#import "NotificationService-Swift.h"
+#import "CIONotificationService.h"
+#import "CIONotificationService-Swift.h"
-@interface NotificationService ()
+@interface CIONotificationService ()
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@end
-@implementation NotificationService
+@implementation CIONotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
- NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
+ CIONotificationServiceManager* cioManagerObj = [[CIONotificationServiceManager alloc] init];
[cioManagerObj didReceive:request withContentHandler:contentHandler];
}
- (void)serviceExtensionTimeWillExpire {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
- NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
+ CIONotificationServiceManager* cioManagerObj = [[CIONotificationServiceManager alloc] init];
[cioManagerObj serviceExtensionTimeWillExpire];
}
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.swift b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.swift
similarity index 92%
rename from node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.swift
rename to node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.swift
index 0e30100..e920fde 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.swift
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/CIONotificationService.swift
@@ -4,7 +4,7 @@ import CioTracking
import CioMessagingPushAPN
@objc
-public class NotificationServiceCioManager : NSObject {
+public class CIONotificationServiceManager : NSObject {
public override init() {}
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.h b/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.h
deleted file mode 100644
index 32d6298..0000000
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/native-files/ios/NotificationService.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#import <UserNotifications/UserNotifications.h>
-
-@interface NotificationService : UNNotificationServiceExtension
-
-@end
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js b/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js
index 71567ea..7475aae 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js
@@ -31,7 +31,7 @@ export async function injectCIONotificationPodfileCode(iosPath, useFrameworks) {
if (!matches) {
const snippetToInjectInPodfile = `
${blockStart}
-target 'NotificationService' do
+target 'CIONotificationService' do
${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}
pod 'customerio-reactnative-richpush/apn', :path => '${getRelativePathToRNSDK(filename)}'
end
diff --git a/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map b/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map
index 1f727ae..26d3c01 100644
--- a/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map
+++ b/node_modules/customerio-expo-plugin/lib/module/helpers/utils/injectCIOPodfileCode.js.map
@@ -1 +1 @@
-{"version":3,"names":["getRelativePathToRNSDK","injectCodeByRegex","FileManagement","injectCIOPodfileCode","iosPath","blockStart","blockEnd","filename","podfile","read","matches","match","RegExp","lineInPodfileToInjectSnippetBefore","snippetToInjectInPodfile","trim","write","join","console","log","injectCIONotificationPodfileCode","useFrameworks","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport { getRelativePathToRNSDK } from '../constants/ios';\nimport { injectCodeByRegex } from './codeInjection';\nimport { FileManagement } from './fileManagement';\n\nexport async function injectCIOPodfileCode(iosPath: string) {\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/apn', :path => '${getRelativePathToRNSDK(filename)}'\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 console.log('CustomerIO Podfile snippets already exists. Skipping...');\n }\n}\n\nexport async function injectCIONotificationPodfileCode(\n iosPath: string,\n useFrameworks: CustomerIOPluginOptionsIOS['useFrameworks']\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/apn', :path => '${getRelativePathToRNSDK(filename)}'\nend\n${blockEnd}\n`.trim();\n\n FileManagement.append(filename, snippetToInjectInPodfile);\n }\n}\n"],"mappings":"AACA,SAASA,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,OAAO,eAAeC,oBAAoBA,CAACC,OAAe,EAAE;EAC1D,MAAMC,UAAU,GAAG,qCAAqC;EACxD,MAAMC,QAAQ,GAAG,mCAAmC;EAEpD,MAAMC,QAAQ,GAAI,GAAEH,OAAQ,UAAS;EACrC,MAAMI,OAAO,GAAG,MAAMN,cAAc,CAACO,IAAI,CAACF,QAAQ,CAAC;EACnD,MAAMG,OAAO,GAAGF,OAAO,CAACG,KAAK,CAAC,IAAIC,MAAM,CAACP,UAAU,CAAC,CAAC;EAErD,IAAI,CAACK,OAAO,EAAE;IACZ;IACA;IACA;IACA,MAAMG,kCAAkC,GAAG,+BAA+B;IAE1E,MAAMC,wBAAwB,GAAI;AACtC,EAAET,UAAW;AACb,gDAAgDL,sBAAsB,CAACO,QAAQ,CAAE;AACjF,EAAED,QAAS;AACX,CAAC,CAACS,IAAI,CAAC,CAAC;IAEJb,cAAc,CAACc,KAAK,CAClBT,QAAQ,EACRN,iBAAiB,CACfO,OAAO,EACPK,kCAAkC,EAClCC,wBACF,CAAC,CAACG,IAAI,CAAC,IAAI,CACb,CAAC;EACH,CAAC,MAAM;IACLC,OAAO,CAACC,GAAG,CAAC,yDAAyD,CAAC;EACxE;AACF;AAEA,OAAO,eAAeC,gCAAgCA,CACpDhB,OAAe,EACfiB,aAA0D,EAC1D;EACA,MAAMd,QAAQ,GAAI,GAAEH,OAAQ,UAAS;EACrC,MAAMI,OAAO,GAAG,MAAMN,cAAc,CAACO,IAAI,CAACF,QAAQ,CAAC;EAEnD,MAAMF,UAAU,GAAG,yCAAyC;EAC5D,MAAMC,QAAQ,GAAG,uCAAuC;EAExD,MAAMI,OAAO,GAAGF,OAAO,CAACG,KAAK,CAAC,IAAIC,MAAM,CAACP,UAAU,CAAC,CAAC;EAErD,IAAI,CAACK,OAAO,EAAE;IACZ,MAAMI,wBAAwB,GAAI;AACtC,EAAET,UAAW;AACb;AACA,IAAIgB,aAAa,KAAK,QAAQ,GAAG,qCAAqC,GAAG,EAAG;AAC5E,yDAAyDrB,sBAAsB,CAACO,QAAQ,CAAE;AAC1F;AACA,EAAED,QAAS;AACX,CAAC,CAACS,IAAI,CAAC,CAAC;IAEJb,cAAc,CAACoB,MAAM,CAACf,QAAQ,EAAEO,wBAAwB,CAAC;EAC3D;AACF"}
\ No newline at end of file
+{"version":3,"names":["getRelativePathToRNSDK","injectCodeByRegex","FileManagement","injectCIOPodfileCode","iosPath","blockStart","blockEnd","filename","podfile","read","matches","match","RegExp","lineInPodfileToInjectSnippetBefore","snippetToInjectInPodfile","trim","write","join","console","log","injectCIONotificationPodfileCode","useFrameworks","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport { getRelativePathToRNSDK } from '../constants/ios';\nimport { injectCodeByRegex } from './codeInjection';\nimport { FileManagement } from './fileManagement';\n\nexport async function injectCIOPodfileCode(iosPath: string) {\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/apn', :path => '${getRelativePathToRNSDK(filename)}'\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 console.log('CustomerIO Podfile snippets already exists. Skipping...');\n }\n}\n\nexport async function injectCIONotificationPodfileCode(\n iosPath: string,\n useFrameworks: CustomerIOPluginOptionsIOS['useFrameworks']\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 'CIONotificationService' do\n ${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}\n pod 'customerio-reactnative-richpush/apn', :path => '${getRelativePathToRNSDK(filename)}'\nend\n${blockEnd}\n`.trim();\n\n FileManagement.append(filename, snippetToInjectInPodfile);\n }\n}\n"],"mappings":"AACA,SAASA,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AAwB,GAAI;AACtC,EAAET,UAAW;AACb;AACA,IAAIgB,aAAa,KAAK,QAAQ,GAAG,qCAAqC,GAAG,EAAG;AAC5E,yDAAyDrB,sBAAsB,CAACO,QAAQ,CAAE;AAC1F;AACA,EAAED,QAAS;AACX,CAAC,CAACS,IAAI,CAAC,CAAC;IAEJb,cAAc,CAACoB,MAAM,CAACf,QAAQ,EAAEO,wBAAwB,CAAC;EAC3D;AACF"}
\ No newline at end of file
diff --git a/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js b/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js
index 11452de..f81d99f 100644
--- a/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js
+++ b/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js
@@ -6,7 +6,7 @@ import { FileManagement } from './../helpers/utils/fileManagement';
const PLIST_FILENAME = `${CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;
const ENV_FILENAME = 'Env.swift';
const TARGETED_DEVICE_FAMILY = `"1,2"`;
-const addNotificationServiceExtension = async (options, xcodeProject) => {
+const addCIONotificationServiceExtension = async (options, xcodeProject) => {
try {
var _options$pushNotifica;
if (options.pushNotification) {
@@ -34,9 +34,9 @@ export const withCioNotificationsXcodeProject = (configOuter, props) => {
pushNotification,
useFrameworks
} = props;
- if (ios === undefined) throw new Error('Adding NotificationServiceExtension failed: ios config missing from app.config.js or app.json.');
+ if (ios === undefined) throw new Error('Adding CIONotificationServiceExtension failed: ios config missing from app.config.js or app.json.');
- // projectName and platformProjectRoot translates to appName and iosPath in addNotificationServiceExtension()
+ // projectName and platformProjectRoot translates to appName and iosPath in addCIONotificationServiceExtension()
const {
projectName,
platformProjectRoot
@@ -46,13 +46,13 @@ export const withCioNotificationsXcodeProject = (configOuter, props) => {
buildNumber
} = ios;
if (bundleShortVersion === undefined) {
- throw new Error('Adding NotificationServiceExtension failed: version missing from app.config.js or app.json');
+ throw new Error('Adding CIONotificationServiceExtension failed: version missing from app.config.js or app.json');
}
if (bundleIdentifier === undefined) {
- throw new Error('Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json');
+ throw new Error('Adding CIONotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json');
}
if (projectName === undefined) {
- throw new Error('Adding NotificationServiceExtension failed: name missing from app.config.js or app.json');
+ throw new Error('Adding CIONotificationServiceExtension failed: name missing from app.config.js or app.json');
}
const options = {
...props,
@@ -66,7 +66,7 @@ export const withCioNotificationsXcodeProject = (configOuter, props) => {
iosDeploymentTarget,
pushNotification
};
- const modifiedProjectFile = await addNotificationServiceExtension(options, config.modResults);
+ const modifiedProjectFile = await addCIONotificationServiceExtension(options, config.modResults);
if (modifiedProjectFile) {
config.modResults = modifiedProjectFile;
}
@@ -95,7 +95,7 @@ const addRichPushXcodeProj = async (options, xcodeProject) => {
FileManagement.mkdir(nsePath, {
recursive: true
});
- const files = [PLIST_FILENAME, 'NotificationService.h', 'NotificationService.swift', 'NotificationService.m', ENV_FILENAME];
+ const files = [PLIST_FILENAME, 'CIONotificationService.h', 'CIONotificationService.swift', 'CIONotificationService.m', ENV_FILENAME];
const getTargetFile = filename => `${nsePath}/${filename}`;
files.forEach(filename => {
const targetFile = getTargetFile(filename);
@@ -140,7 +140,7 @@ const addRichPushXcodeProj = async (options, xcodeProject) => {
const nseTarget = xcodeProject.addTarget(CIO_NOTIFICATION_TARGET_NAME, 'app_extension', CIO_NOTIFICATION_TARGET_NAME, `${bundleIdentifier}.richpush`);
// Add build phases to the new target
- xcodeProject.addBuildPhase(['NotificationService.m', 'NotificationService.swift', 'Env.swift'], 'PBXSourcesBuildPhase', 'Sources', nseTarget.uuid);
+ xcodeProject.addBuildPhase(['CIONotificationService.m', 'CIONotificationService.swift', 'Env.swift'], 'PBXSourcesBuildPhase', 'Sources', nseTarget.uuid);
xcodeProject.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', nseTarget.uuid);
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', nseTarget.uuid);
diff --git a/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js.map b/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js.map
index a972dae..f6f4bd4 100644
--- a/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js.map
+++ b/node_modules/customerio-expo-plugin/lib/module/ios/withNotificationsXcodeProject.js.map
@@ -1 +1 @@
-{"version":3,"names":["withXcodeProject","CIO_NOTIFICATION_TARGET_NAME","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET","DEFAULT_BUNDLE_VERSION","LOCAL_PATH_TO_CIO_NSE_FILES","replaceCodeByRegex","injectCIONotificationPodfileCode","FileManagement","PLIST_FILENAME","ENV_FILENAME","TARGETED_DEVICE_FAMILY","addNotificationServiceExtension","options","xcodeProject","_options$pushNotifica","pushNotification","addPushNotificationFile","useRichPush","addRichPushXcodeProj","error","console","withCioNotificationsXcodeProject","configOuter","props","config","modRequest","ios","version","bundleShortVersion","appleTeamId","iosDeploymentTarget","useFrameworks","undefined","Error","projectName","platformProjectRoot","bundleIdentifier","buildNumber","bundleVersion","iosPath","appName","modifiedProjectFile","modResults","pbxTargetByName","warn","nsePath","mkdir","recursive","files","getTargetFile","filename","forEach","targetFile","copyFile","infoPlistTargetFile","updateNseInfoPlist","updateNseEnv","extGroup","addPbxGroup","groups","hash","project","objects","Object","keys","key","name","path","addToPbxGroup","uuid","projObjects","nseTarget","addTarget","addBuildPhase","configurations","pbxXCBuildConfigurationSection","buildSettings","PRODUCT_NAME","buildSettingsObj","DEVELOPMENT_TEAM","IPHONEOS_DEPLOYMENT_TARGET","CODE_SIGN_STYLE","SWIFT_VERSION","addTargetAttribute","payload","BUNDLE_SHORT_VERSION_RE","BUNDLE_VERSION_RE","plistFileString","readFile","writeFile","envFileName","_options$pushNotifica2","_options$pushNotifica4","_options$pushNotifica6","SITE_ID_RE","API_KEY_RE","REGION_RE","envFileContent","env","siteId","_options$pushNotifica3","apiKey","_options$pushNotifica5","region","_options$pushNotifica7","regionMap","us","eu","toLowerCase","mappedRegion","_options$pushNotifica8","file","appPath","exists","log","updatePushFile","group","pbxCreateGroup","classesKey","findPBXGroupKey","addSourceFile","REGISTER_RE","snippet","disableNotificationRegistration"],"sources":["withNotificationsXcodeProject.ts"],"sourcesContent":["import {\n ConfigPlugin,\n XcodeProject,\n withXcodeProject,\n} from '@expo/config-plugins';\n\nimport {\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_REGISTER_PUSHNOTIFICATION_SNIPPET,\n DEFAULT_BUNDLE_VERSION,\n LOCAL_PATH_TO_CIO_NSE_FILES,\n} from '../helpers/constants/ios';\nimport { replaceCodeByRegex } from '../helpers/utils/codeInjection';\nimport { injectCIONotificationPodfileCode } from '../helpers/utils/injectCIOPodfileCode';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { FileManagement } from './../helpers/utils/fileManagement';\n\nconst PLIST_FILENAME = `${CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;\nconst ENV_FILENAME = 'Env.swift';\n\nconst TARGETED_DEVICE_FAMILY = `\"1,2\"`;\n\nconst addNotificationServiceExtension = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: XcodeProject\n) => {\n try {\n if (options.pushNotification) {\n await addPushNotificationFile(options, xcodeProject);\n }\n\n if (options.pushNotification?.useRichPush) {\n await addRichPushXcodeProj(options, xcodeProject);\n }\n return xcodeProject;\n } catch (error: any) {\n console.error(error);\n return null;\n }\n};\n\nexport const withCioNotificationsXcodeProject: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (configOuter, props) => {\n return withXcodeProject(configOuter, async (config) => {\n const { modRequest, ios, version: bundleShortVersion } = config;\n const {\n appleTeamId,\n iosDeploymentTarget,\n pushNotification,\n useFrameworks,\n } = props;\n\n if (ios === undefined)\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios config missing from app.config.js or app.json.'\n );\n\n // projectName and platformProjectRoot translates to appName and iosPath in addNotificationServiceExtension()\n const { projectName, platformProjectRoot } = modRequest;\n const { bundleIdentifier, buildNumber } = ios;\n\n if (bundleShortVersion === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: version missing from app.config.js or app.json'\n );\n }\n\n if (bundleIdentifier === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json'\n );\n }\n\n if (projectName === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: name missing from app.config.js or app.json'\n );\n }\n\n const options = {\n ...props,\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion: buildNumber || DEFAULT_BUNDLE_VERSION,\n iosPath: platformProjectRoot,\n appName: projectName,\n useFrameworks,\n iosDeploymentTarget,\n pushNotification,\n };\n\n const modifiedProjectFile = await addNotificationServiceExtension(\n options,\n config.modResults\n );\n\n if (modifiedProjectFile) {\n config.modResults = modifiedProjectFile;\n }\n\n return config;\n });\n};\n\nconst addRichPushXcodeProj = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) => {\n const {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion,\n iosPath,\n iosDeploymentTarget,\n useFrameworks,\n } = options;\n\n await injectCIONotificationPodfileCode(iosPath, useFrameworks);\n\n // Check if `CIO_NOTIFICATION_TARGET_NAME` group already exist in the project\n // If true then skip creating a new group to avoid duplicate folders\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n const nsePath = `${iosPath}/${CIO_NOTIFICATION_TARGET_NAME}`;\n FileManagement.mkdir(nsePath, {\n recursive: true,\n });\n\n const files = [\n PLIST_FILENAME,\n 'NotificationService.h',\n 'NotificationService.swift',\n 'NotificationService.m',\n ENV_FILENAME,\n ];\n\n const getTargetFile = (filename: string) => `${nsePath}/${filename}`;\n\n files.forEach((filename) => {\n const targetFile = getTargetFile(filename);\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`,\n targetFile\n );\n });\n\n /* MODIFY COPIED EXTENSION FILES */\n const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);\n updateNseInfoPlist({\n bundleVersion,\n bundleShortVersion,\n infoPlistTargetFile,\n });\n updateNseEnv(options, getTargetFile(ENV_FILENAME));\n\n // Create new PBXGroup for the extension\n const extGroup = xcodeProject.addPbxGroup(\n files,\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_NOTIFICATION_TARGET_NAME\n );\n\n // Add the new PBXGroup to the top level group. This makes the\n // files / folder appear in the file explorer in Xcode.\n const groups = xcodeProject.hash.project.objects['PBXGroup'];\n Object.keys(groups).forEach((key) => {\n if (groups[key].name === undefined && groups[key].path === undefined) {\n xcodeProject.addToPbxGroup(extGroup.uuid, key);\n }\n });\n\n // WORK AROUND for codeProject.addTarget BUG\n // Xcode projects don't contain these if there is only one target\n // An upstream fix should be made to the code referenced in this link:\n // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860\n const projObjects = xcodeProject.hash.project.objects;\n projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};\n projObjects['PBXContainerItemProxy'] =\n projObjects['PBXTargetDependency'] || {};\n\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n // Add the NSE target\n // This also adds PBXTargetDependency and PBXContainerItemProxy\n const nseTarget = xcodeProject.addTarget(\n CIO_NOTIFICATION_TARGET_NAME,\n 'app_extension',\n CIO_NOTIFICATION_TARGET_NAME,\n `${bundleIdentifier}.richpush`\n );\n\n // Add build phases to the new target\n xcodeProject.addBuildPhase(\n ['NotificationService.m', 'NotificationService.swift', 'Env.swift'],\n 'PBXSourcesBuildPhase',\n 'Sources',\n nseTarget.uuid\n );\n xcodeProject.addBuildPhase(\n [],\n 'PBXResourcesBuildPhase',\n 'Resources',\n nseTarget.uuid\n );\n\n xcodeProject.addBuildPhase(\n [],\n 'PBXFrameworksBuildPhase',\n 'Frameworks',\n nseTarget.uuid\n );\n\n // Edit the Deployment info of the target\n const configurations = xcodeProject.pbxXCBuildConfigurationSection();\n for (const key in configurations) {\n if (\n typeof configurations[key].buildSettings !== 'undefined' &&\n configurations[key].buildSettings.PRODUCT_NAME ===\n `\"${CIO_NOTIFICATION_TARGET_NAME}\"`\n ) {\n const buildSettingsObj = configurations[key].buildSettings;\n buildSettingsObj.DEVELOPMENT_TEAM = appleTeamId;\n buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET =\n iosDeploymentTarget || '13.0';\n buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY;\n buildSettingsObj.CODE_SIGN_STYLE = 'Automatic';\n buildSettingsObj.SWIFT_VERSION = 4.2;\n }\n }\n\n // Add development team to the target & the main\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId, nseTarget);\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId);\n};\n\nconst updateNseInfoPlist = (payload: {\n bundleVersion?: string;\n bundleShortVersion?: string;\n infoPlistTargetFile: string;\n}) => {\n const BUNDLE_SHORT_VERSION_RE = /\\{\\{BUNDLE_SHORT_VERSION\\}\\}/;\n const BUNDLE_VERSION_RE = /\\{\\{BUNDLE_VERSION\\}\\}/;\n\n let plistFileString = FileManagement.readFile(payload.infoPlistTargetFile);\n\n if (payload.bundleVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_VERSION_RE,\n payload.bundleVersion\n );\n }\n\n if (payload.bundleShortVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_SHORT_VERSION_RE,\n payload.bundleShortVersion\n );\n }\n\n FileManagement.writeFile(payload.infoPlistTargetFile, plistFileString);\n};\n\nconst updateNseEnv = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const SITE_ID_RE = /\\{\\{SITE_ID\\}\\}/;\n const API_KEY_RE = /\\{\\{API_KEY\\}\\}/;\n const REGION_RE = /\\{\\{REGION\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n if (options.pushNotification?.env?.siteId) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n SITE_ID_RE,\n options.pushNotification?.env?.siteId\n );\n }\n\n if (options.pushNotification?.env?.apiKey) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n API_KEY_RE,\n options.pushNotification?.env?.apiKey\n );\n }\n\n if (options.pushNotification?.env?.region) {\n const regionMap = {\n us: 'Region.US',\n eu: 'Region.EU',\n };\n const region = options.pushNotification?.env?.region?.toLowerCase();\n const mappedRegion = (regionMap as any)[region] || '';\n if (!mappedRegion) {\n console.warn(\n `${options.pushNotification?.env?.region} is an invalid region. Please use the values from the docs: https://customer.io/docs/sdk/expo/getting-started/#configure-the-plugin`\n );\n } else {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n REGION_RE,\n mappedRegion\n );\n }\n }\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n\nasync function addPushNotificationFile(\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) {\n const { iosPath, appName } = options;\n const file = 'PushService.swift';\n const appPath = `${iosPath}/${appName}`;\n const getTargetFile = (filename: string) => `${appPath}/${filename}`;\n const targetFile = getTargetFile(file);\n\n // Check whether {file} exists in the project. If false, then add the file\n // If {file} exists then skip and return\n if (!FileManagement.exists(getTargetFile(file))) {\n FileManagement.mkdir(appPath, {\n recursive: true,\n });\n\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`,\n targetFile\n );\n } else {\n console.log(`${getTargetFile(file)} already exists. Skipping...`);\n return;\n }\n\n updatePushFile(options, targetFile);\n\n const group = xcodeProject.pbxCreateGroup('CustomerIONotifications');\n const classesKey = xcodeProject.findPBXGroupKey({ name: `${appName}` });\n xcodeProject.addToPbxGroup(group, classesKey);\n\n xcodeProject.addSourceFile(`${appName}/${file}`, null, group);\n}\n\nconst updatePushFile = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const REGISTER_RE = /\\{\\{REGISTER_SNIPPET\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n let snippet = '';\n if (\n options.disableNotificationRegistration !== undefined &&\n options.disableNotificationRegistration === false\n ) {\n snippet = CIO_REGISTER_PUSHNOTIFICATION_SNIPPET;\n }\n\n envFileContent = replaceCodeByRegex(envFileContent, REGISTER_RE, snippet);\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n"],"mappings":"AAAA,SAGEA,gBAAgB,QACX,sBAAsB;AAE7B,SACEC,4BAA4B,EAC5BC,qCAAqC,EACrCC,sBAAsB,EACtBC,2BAA2B,QACtB,0BAA0B;AACjC,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,gCAAgC,QAAQ,uCAAuC;AAExF,SAASC,cAAc,QAAQ,mCAAmC;AAElE,MAAMC,cAAc,GAAI,GAAEP,4BAA6B,aAAY;AACnE,MAAMQ,YAAY,GAAG,WAAW;AAEhC,MAAMC,sBAAsB,GAAI,OAAM;AAEtC,MAAMC,+BAA+B,GAAG,MAAAA,CACtCC,OAAmC,EACnCC,YAA0B,KACvB;EACH,IAAI;IAAA,IAAAC,qBAAA;IACF,IAAIF,OAAO,CAACG,gBAAgB,EAAE;MAC5B,MAAMC,uBAAuB,CAACJ,OAAO,EAAEC,YAAY,CAAC;IACtD;IAEA,KAAAC,qBAAA,GAAIF,OAAO,CAACG,gBAAgB,cAAAD,qBAAA,eAAxBA,qBAAA,CAA0BG,WAAW,EAAE;MACzC,MAAMC,oBAAoB,CAACN,OAAO,EAAEC,YAAY,CAAC;IACnD;IACA,OAAOA,YAAY;EACrB,CAAC,CAAC,OAAOM,KA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,GAAGxH,qCAAqC;EACjD;EAEA+F,cAAc,GAAG5F,kBAAkB,CAAC4F,cAAc,EAAEwB,WAAW,EAAEC,OAAO,CAAC;EAEzEnH,cAAc,CAACkF,SAAS,CAACC,WAAW,EAAEO,cAAc,CAAC;AACvD,CAAC"}
\ No newline at end of file
+{"version":3,"names":["withXcodeProject","CIO_NOTIFICATION_TARGET_NAME","CIO_REGISTER_PUSHNOTIFICATION_SNIPPET","DEFAULT_BUNDLE_VERSION","LOCAL_PATH_TO_CIO_NSE_FILES","replaceCodeByRegex","injectCIONotificationPodfileCode","FileManagement","PLIST_FILENAME","ENV_FILENAME","TARGETED_DEVICE_FAMILY","addCIONotificationServiceExtension","options","xcodeProject","_options$pushNotifica","pushNotification","addPushNotificationFile","useRichPush","addRichPushXcodeProj","error","console","withCioNotificationsXcodeProject","configOuter","props","config","modRequest","ios","version","bundleShortVersion","appleTeamId","iosDeploymentTarget","useFrameworks","undefined","Error","projectName","platformProjectRoot","bundleIdentifier","buildNumber","bundleVersion","iosPath","appName","modifiedProjectFile","modResults","pbxTargetByName","warn","nsePath","mkdir","recursive","files","getTargetFile","filename","forEach","targetFile","copyFile","infoPlistTargetFile","updateNseInfoPlist","updateNseEnv","extGroup","addPbxGroup","groups","hash","project","objects","Object","keys","key","name","path","addToPbxGroup","uuid","projObjects","nseTarget","addTarget","addBuildPhase","configurations","pbxXCBuildConfigurationSection","buildSettings","PRODUCT_NAME","buildSettingsObj","DEVELOPMENT_TEAM","IPHONEOS_DEPLOYMENT_TARGET","CODE_SIGN_STYLE","SWIFT_VERSION","addTargetAttribute","payload","BUNDLE_SHORT_VERSION_RE","BUNDLE_VERSION_RE","plistFileString","readFile","writeFile","envFileName","_options$pushNotifica2","_options$pushNotifica4","_options$pushNotifica6","SITE_ID_RE","API_KEY_RE","REGION_RE","envFileContent","env","siteId","_options$pushNotifica3","apiKey","_options$pushNotifica5","region","_options$pushNotifica7","regionMap","us","eu","toLowerCase","mappedRegion","_options$pushNotifica8","file","appPath","exists","log","updatePushFile","group","pbxCreateGroup","classesKey","findPBXGroupKey","addSourceFile","REGISTER_RE","snippet","disableNotificationRegistration"],"sources":["withNotificationsXcodeProject.ts"],"sourcesContent":["import {\n ConfigPlugin,\n XcodeProject,\n withXcodeProject,\n} from '@expo/config-plugins';\n\nimport {\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_REGISTER_PUSHNOTIFICATION_SNIPPET,\n DEFAULT_BUNDLE_VERSION,\n LOCAL_PATH_TO_CIO_NSE_FILES,\n} from '../helpers/constants/ios';\nimport { replaceCodeByRegex } from '../helpers/utils/codeInjection';\nimport { injectCIONotificationPodfileCode } from '../helpers/utils/injectCIOPodfileCode';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { FileManagement } from './../helpers/utils/fileManagement';\n\nconst PLIST_FILENAME = `${CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;\nconst ENV_FILENAME = 'Env.swift';\n\nconst TARGETED_DEVICE_FAMILY = `\"1,2\"`;\n\nconst addCIONotificationServiceExtension = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: XcodeProject\n) => {\n try {\n if (options.pushNotification) {\n await addPushNotificationFile(options, xcodeProject);\n }\n\n if (options.pushNotification?.useRichPush) {\n await addRichPushXcodeProj(options, xcodeProject);\n }\n return xcodeProject;\n } catch (error: any) {\n console.error(error);\n return null;\n }\n};\n\nexport const withCioNotificationsXcodeProject: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (configOuter, props) => {\n return withXcodeProject(configOuter, async (config) => {\n const { modRequest, ios, version: bundleShortVersion } = config;\n const {\n appleTeamId,\n iosDeploymentTarget,\n pushNotification,\n useFrameworks,\n } = props;\n\n if (ios === undefined)\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: ios config missing from app.config.js or app.json.'\n );\n\n // projectName and platformProjectRoot translates to appName and iosPath in addCIONotificationServiceExtension()\n const { projectName, platformProjectRoot } = modRequest;\n const { bundleIdentifier, buildNumber } = ios;\n\n if (bundleShortVersion === undefined) {\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: version missing from app.config.js or app.json'\n );\n }\n\n if (bundleIdentifier === undefined) {\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json'\n );\n }\n\n if (projectName === undefined) {\n throw new Error(\n 'Adding CIONotificationServiceExtension failed: name missing from app.config.js or app.json'\n );\n }\n\n const options = {\n ...props,\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion: buildNumber || DEFAULT_BUNDLE_VERSION,\n iosPath: platformProjectRoot,\n appName: projectName,\n useFrameworks,\n iosDeploymentTarget,\n pushNotification,\n };\n\n const modifiedProjectFile = await addCIONotificationServiceExtension(\n options,\n config.modResults\n );\n\n if (modifiedProjectFile) {\n config.modResults = modifiedProjectFile;\n }\n\n return config;\n });\n};\n\nconst addRichPushXcodeProj = async (\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) => {\n const {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion,\n iosPath,\n iosDeploymentTarget,\n useFrameworks,\n } = options;\n\n await injectCIONotificationPodfileCode(iosPath, useFrameworks);\n\n // Check if `CIO_NOTIFICATION_TARGET_NAME` group already exist in the project\n // If true then skip creating a new group to avoid duplicate folders\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n const nsePath = `${iosPath}/${CIO_NOTIFICATION_TARGET_NAME}`;\n FileManagement.mkdir(nsePath, {\n recursive: true,\n });\n\n const files = [\n PLIST_FILENAME,\n 'CIONotificationService.h',\n 'CIONotificationService.swift',\n 'CIONotificationService.m',\n ENV_FILENAME,\n ];\n\n const getTargetFile = (filename: string) => `${nsePath}/${filename}`;\n\n files.forEach((filename) => {\n const targetFile = getTargetFile(filename);\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`,\n targetFile\n );\n });\n\n /* MODIFY COPIED EXTENSION FILES */\n const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);\n updateNseInfoPlist({\n bundleVersion,\n bundleShortVersion,\n infoPlistTargetFile,\n });\n updateNseEnv(options, getTargetFile(ENV_FILENAME));\n\n // Create new PBXGroup for the extension\n const extGroup = xcodeProject.addPbxGroup(\n files,\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_NOTIFICATION_TARGET_NAME\n );\n\n // Add the new PBXGroup to the top level group. This makes the\n // files / folder appear in the file explorer in Xcode.\n const groups = xcodeProject.hash.project.objects['PBXGroup'];\n Object.keys(groups).forEach((key) => {\n if (groups[key].name === undefined && groups[key].path === undefined) {\n xcodeProject.addToPbxGroup(extGroup.uuid, key);\n }\n });\n\n // WORK AROUND for codeProject.addTarget BUG\n // Xcode projects don't contain these if there is only one target\n // An upstream fix should be made to the code referenced in this link:\n // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860\n const projObjects = xcodeProject.hash.project.objects;\n projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};\n projObjects['PBXContainerItemProxy'] =\n projObjects['PBXTargetDependency'] || {};\n\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n // Add the NSE target\n // This also adds PBXTargetDependency and PBXContainerItemProxy\n const nseTarget = xcodeProject.addTarget(\n CIO_NOTIFICATION_TARGET_NAME,\n 'app_extension',\n CIO_NOTIFICATION_TARGET_NAME,\n `${bundleIdentifier}.richpush`\n );\n\n // Add build phases to the new target\n xcodeProject.addBuildPhase(\n ['CIONotificationService.m', 'CIONotificationService.swift', 'Env.swift'],\n 'PBXSourcesBuildPhase',\n 'Sources',\n nseTarget.uuid\n );\n xcodeProject.addBuildPhase(\n [],\n 'PBXResourcesBuildPhase',\n 'Resources',\n nseTarget.uuid\n );\n\n xcodeProject.addBuildPhase(\n [],\n 'PBXFrameworksBuildPhase',\n 'Frameworks',\n nseTarget.uuid\n );\n\n // Edit the Deployment info of the target\n const configurations = xcodeProject.pbxXCBuildConfigurationSection();\n for (const key in configurations) {\n if (\n typeof configurations[key].buildSettings !== 'undefined' &&\n configurations[key].buildSettings.PRODUCT_NAME ===\n `\"${CIO_NOTIFICATION_TARGET_NAME}\"`\n ) {\n const buildSettingsObj = configurations[key].buildSettings;\n buildSettingsObj.DEVELOPMENT_TEAM = appleTeamId;\n buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET =\n iosDeploymentTarget || '13.0';\n buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY;\n buildSettingsObj.CODE_SIGN_STYLE = 'Automatic';\n buildSettingsObj.SWIFT_VERSION = 4.2;\n }\n }\n\n // Add development team to the target & the main\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId, nseTarget);\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId);\n};\n\nconst updateNseInfoPlist = (payload: {\n bundleVersion?: string;\n bundleShortVersion?: string;\n infoPlistTargetFile: string;\n}) => {\n const BUNDLE_SHORT_VERSION_RE = /\\{\\{BUNDLE_SHORT_VERSION\\}\\}/;\n const BUNDLE_VERSION_RE = /\\{\\{BUNDLE_VERSION\\}\\}/;\n\n let plistFileString = FileManagement.readFile(payload.infoPlistTargetFile);\n\n if (payload.bundleVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_VERSION_RE,\n payload.bundleVersion\n );\n }\n\n if (payload.bundleShortVersion) {\n plistFileString = replaceCodeByRegex(\n plistFileString,\n BUNDLE_SHORT_VERSION_RE,\n payload.bundleShortVersion\n );\n }\n\n FileManagement.writeFile(payload.infoPlistTargetFile, plistFileString);\n};\n\nconst updateNseEnv = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const SITE_ID_RE = /\\{\\{SITE_ID\\}\\}/;\n const API_KEY_RE = /\\{\\{API_KEY\\}\\}/;\n const REGION_RE = /\\{\\{REGION\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n if (options.pushNotification?.env?.siteId) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n SITE_ID_RE,\n options.pushNotification?.env?.siteId\n );\n }\n\n if (options.pushNotification?.env?.apiKey) {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n API_KEY_RE,\n options.pushNotification?.env?.apiKey\n );\n }\n\n if (options.pushNotification?.env?.region) {\n const regionMap = {\n us: 'Region.US',\n eu: 'Region.EU',\n };\n const region = options.pushNotification?.env?.region?.toLowerCase();\n const mappedRegion = (regionMap as any)[region] || '';\n if (!mappedRegion) {\n console.warn(\n `${options.pushNotification?.env?.region} is an invalid region. Please use the values from the docs: https://customer.io/docs/sdk/expo/getting-started/#configure-the-plugin`\n );\n } else {\n envFileContent = replaceCodeByRegex(\n envFileContent,\n REGION_RE,\n mappedRegion\n );\n }\n }\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n\nasync function addPushNotificationFile(\n options: CustomerIOPluginOptionsIOS,\n xcodeProject: any\n) {\n const { iosPath, appName } = options;\n const file = 'PushService.swift';\n const appPath = `${iosPath}/${appName}`;\n const getTargetFile = (filename: string) => `${appPath}/${filename}`;\n const targetFile = getTargetFile(file);\n\n // Check whether {file} exists in the project. If false, then add the file\n // If {file} exists then skip and return\n if (!FileManagement.exists(getTargetFile(file))) {\n FileManagement.mkdir(appPath, {\n recursive: true,\n });\n\n FileManagement.copyFile(\n `${LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`,\n targetFile\n );\n } else {\n console.log(`${getTargetFile(file)} already exists. Skipping...`);\n return;\n }\n\n updatePushFile(options, targetFile);\n\n const group = xcodeProject.pbxCreateGroup('CustomerIONotifications');\n const classesKey = xcodeProject.findPBXGroupKey({ name: `${appName}` });\n xcodeProject.addToPbxGroup(group, classesKey);\n\n xcodeProject.addSourceFile(`${appName}/${file}`, null, group);\n}\n\nconst updatePushFile = (\n options: CustomerIOPluginOptionsIOS,\n envFileName: string\n) => {\n const REGISTER_RE = /\\{\\{REGISTER_SNIPPET\\}\\}/;\n\n let envFileContent = FileManagement.readFile(envFileName);\n\n let snippet = '';\n if (\n options.disableNotificationRegistration !== undefined &&\n options.disableNotificationRegistration === false\n ) {\n snippet = CIO_REGISTER_PUSHNOTIFICATION_SNIPPET;\n }\n\n envFileContent = replaceCodeByRegex(envFileContent, REGISTER_RE, snippet);\n\n FileManagement.writeFile(envFileName, envFileContent);\n};\n"],"mappings":"AAAA,SAGEA,gBAAgB,QACX,sBAAsB;AAE7B,SACEC,4BAA4B,EAC5BC,qCAAqC,EACrCC,sBAAsB,EACtBC,2BAA2B,QACtB,0BAA0B;AACjC,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,gCAAgC,QAAQ,uCAAuC;AAExF,SAASC,cAAc,QAAQ,mCAAmC;AAElE,MAAMC,cAAc,GAAI,GAAEP,4BAA6B,aAAY;AACnE,MAAMQ,YAAY,GAAG,WAAW;AAEhC,MAAMC,sBAAsB,GAAI,OAAM;AAEtC,MAAMC,+BAA+B,GAAG,MAAAA,CACtCC,OAAmC,EACnCC,YAA0B,KACvB;EACH,IAAI;IAAA,IAAAC,qBAAA;IACF,IAAIF,OAAO,CAACG,gBAAgB,EAAE;MAC5B,MAAMC,uBAAuB,CAACJ,OAAO,EAAEC,YAAY,CAAC;IACtD;IAEA,KAAAC,qBAAA,GAAIF,OAAO,CAACG,gBAAgB,cAAAD,qBAAA,eAAxBA,qBAAA,CAA0BG,WAAW,EAAE;MACzC,MAAMC,oBAAoB,CAACN,OAAO,EAAEC,YAAY,CAAC;IACnD;IACA,OAAOA,YAAY;EACrB,CAAC,CAAC,OAAOM,KAAU,EAAE;IACnBC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;IACpB,OAAO,IAAI;EACb;AACF,CAAC;AAED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,OAAO,CAAC;EAEzEnH,cAAc,CAACkF,SAAS,CAACC,WAAW,EAAEO,cAAc,CAAC;AACvD,CAAC"}
\ No newline at end of file
diff --git a/node_modules/customerio-expo-plugin/lib/typescript/.DS_Store b/node_modules/customerio-expo-plugin/lib/typescript/.DS_Store
new file mode 100644
index 0000000..b1f19db
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/typescript/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/typescript/helpers/.DS_Store b/node_modules/customerio-expo-plugin/lib/typescript/helpers/.DS_Store
new file mode 100644
index 0000000..79b1365
Binary files /dev/null and b/node_modules/customerio-expo-plugin/lib/typescript/helpers/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/lib/typescript/helpers/constants/ios.d.ts b/node_modules/customerio-expo-plugin/lib/typescript/helpers/constants/ios.d.ts
index b10aa47..b69d7cf 100644
--- a/node_modules/customerio-expo-plugin/lib/typescript/helpers/constants/ios.d.ts
+++ b/node_modules/customerio-expo-plugin/lib/typescript/helpers/constants/ios.d.ts
@@ -17,7 +17,7 @@ export declare const CIO_DEEPLINK_COMMENT_REGEX: RegExp;
export declare const DEFAULT_BUNDLE_VERSION = "1";
export declare const DEFAULT_BUNDLE_SHORT_VERSION = "1.0";
export declare const CIO_TARGET_NAME = "CustomerIOSDK";
-export declare const CIO_NOTIFICATION_TARGET_NAME = "NotificationService";
+export declare const CIO_NOTIFICATION_TARGET_NAME = "CIONotificationService";
export declare const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = "#import <UserNotifications/UserNotifications.h>";
export declare const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = "UNUserNotificationCenterDelegate";
export declare const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = "\nCIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];\n";
diff --git a/node_modules/customerio-expo-plugin/src/.DS_Store b/node_modules/customerio-expo-plugin/src/.DS_Store
new file mode 100644
index 0000000..c626f49
Binary files /dev/null and b/node_modules/customerio-expo-plugin/src/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/src/helpers/.DS_Store b/node_modules/customerio-expo-plugin/src/helpers/.DS_Store
new file mode 100644
index 0000000..d354fe3
Binary files /dev/null and b/node_modules/customerio-expo-plugin/src/helpers/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/src/helpers/constants/ios.ts b/node_modules/customerio-expo-plugin/src/helpers/constants/ios.ts
index 3f70a5a..32720d6 100644
--- a/node_modules/customerio-expo-plugin/src/helpers/constants/ios.ts
+++ b/node_modules/customerio-expo-plugin/src/helpers/constants/ios.ts
@@ -52,7 +52,7 @@ export const CIO_DEEPLINK_COMMENT_REGEX = /\sDeep link workaround for app killed
export const DEFAULT_BUNDLE_VERSION = '1';
export const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';
export const CIO_TARGET_NAME = 'CustomerIOSDK';
-export const CIO_NOTIFICATION_TARGET_NAME = 'NotificationService';
+export const CIO_NOTIFICATION_TARGET_NAME = 'CIONotificationService';
export const CIO_APPDELEGATEHEADER_IMPORT_SNIPPET = `#import <UserNotifications/UserNotifications.h>`;
export const CIO_APPDELEGATEHEADER_USER_NOTIFICATION_CENTER_SNIPPET = 'UNUserNotificationCenterDelegate';
diff --git a/node_modules/customerio-expo-plugin/src/helpers/native-files/.DS_Store b/node_modules/customerio-expo-plugin/src/helpers/native-files/.DS_Store
new file mode 100644
index 0000000..939baa8
Binary files /dev/null and b/node_modules/customerio-expo-plugin/src/helpers/native-files/.DS_Store differ
diff --git a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService-Info.plist b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService-Info.plist
similarity index 91%
rename from node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService-Info.plist
rename to node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService-Info.plist
index cc44286..cdd1994 100644
--- a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService-Info.plist
+++ b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService-Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
- <string>NotificationServiceExtension</string>
+ <string>CIONotificationServiceExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -25,7 +25,7 @@
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
- <string>NotificationService</string>
+ <string>CIONotificationService</string>
</dict>
</dict>
</plist>
diff --git a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.h b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.h
new file mode 100644
index 0000000..f888bdd
--- /dev/null
+++ b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.h
@@ -0,0 +1,5 @@
+#import <UserNotifications/UserNotifications.h>
+
+@interface CIONotificationService : UNNotificationServiceExtension
+
+@end
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.m b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.m
similarity index 67%
rename from node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.m
rename to node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.m
index d684015..f83e911 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.m
+++ b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.m
@@ -1,25 +1,25 @@
-#import "NotificationService.h"
-#import "NotificationService-Swift.h"
+#import "CIONotificationService.h"
+#import "CIONotificationService-Swift.h"
-@interface NotificationService ()
+@interface CIONotificationService ()
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@end
-@implementation NotificationService
+@implementation CIONotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
- NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
+ CIONotificationServiceManager* cioManagerObj = [[CIONotificationServiceManager alloc] init];
[cioManagerObj didReceive:request withContentHandler:contentHandler];
}
- (void)serviceExtensionTimeWillExpire {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
- NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
+ CIONotificationServiceManager* cioManagerObj = [[CIONotificationServiceManager alloc] init];
[cioManagerObj serviceExtensionTimeWillExpire];
}
diff --git a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.swift b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.swift
similarity index 92%
rename from node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.swift
rename to node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.swift
index 0e30100..e920fde 100644
--- a/node_modules/customerio-expo-plugin/lib/commonjs/helpers/native-files/ios/NotificationService.swift
+++ b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/CIONotificationService.swift
@@ -4,7 +4,7 @@ import CioTracking
import CioMessagingPushAPN
@objc
-public class NotificationServiceCioManager : NSObject {
+public class CIONotificationServiceManager : NSObject {
public override init() {}
diff --git a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.h b/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.h
deleted file mode 100644
index 32d6298..0000000
--- a/node_modules/customerio-expo-plugin/src/helpers/native-files/ios/NotificationService.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#import <UserNotifications/UserNotifications.h>
-
-@interface NotificationService : UNNotificationServiceExtension
-
-@end
diff --git a/node_modules/customerio-expo-plugin/src/helpers/utils/injectCIOPodfileCode.ts b/node_modules/customerio-expo-plugin/src/helpers/utils/injectCIOPodfileCode.ts
index cba11fa..f7faba7 100644
--- a/node_modules/customerio-expo-plugin/src/helpers/utils/injectCIOPodfileCode.ts
+++ b/node_modules/customerio-expo-plugin/src/helpers/utils/injectCIOPodfileCode.ts
@@ -51,7 +51,7 @@ export async function injectCIONotificationPodfileCode(
if (!matches) {
const snippetToInjectInPodfile = `
${blockStart}
-target 'NotificationService' do
+target 'CIONotificationService' do
${useFrameworks === 'static' ? 'use_frameworks! :linkage => :static' : ''}
pod 'customerio-reactnative-richpush/apn', :path => '${getRelativePathToRNSDK(filename)}'
end
diff --git a/node_modules/customerio-expo-plugin/src/ios/withNotificationsXcodeProject.ts b/node_modules/customerio-expo-plugin/src/ios/withNotificationsXcodeProject.ts
index 8697690..310965e 100644
--- a/node_modules/customerio-expo-plugin/src/ios/withNotificationsXcodeProject.ts
+++ b/node_modules/customerio-expo-plugin/src/ios/withNotificationsXcodeProject.ts
@@ -20,7 +20,7 @@ const ENV_FILENAME = 'Env.swift';
const TARGETED_DEVICE_FAMILY = `"1,2"`;
-const addNotificationServiceExtension = async (
+const addCIONotificationServiceExtension = async (
options: CustomerIOPluginOptionsIOS,
xcodeProject: XcodeProject
) => {
@@ -53,28 +53,28 @@ export const withCioNotificationsXcodeProject: ConfigPlugin<
if (ios === undefined)
throw new Error(
- 'Adding NotificationServiceExtension failed: ios config missing from app.config.js or app.json.'
+ 'Adding CIONotificationServiceExtension failed: ios config missing from app.config.js or app.json.'
);
- // projectName and platformProjectRoot translates to appName and iosPath in addNotificationServiceExtension()
+ // projectName and platformProjectRoot translates to appName and iosPath in addCIONotificationServiceExtension()
const { projectName, platformProjectRoot } = modRequest;
const { bundleIdentifier, buildNumber } = ios;
if (bundleShortVersion === undefined) {
throw new Error(
- 'Adding NotificationServiceExtension failed: version missing from app.config.js or app.json'
+ 'Adding CIONotificationServiceExtension failed: version missing from app.config.js or app.json'
);
}
if (bundleIdentifier === undefined) {
throw new Error(
- 'Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json'
+ 'Adding CIONotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js or app.json'
);
}
if (projectName === undefined) {
throw new Error(
- 'Adding NotificationServiceExtension failed: name missing from app.config.js or app.json'
+ 'Adding CIONotificationServiceExtension failed: name missing from app.config.js or app.json'
);
}
@@ -91,7 +91,7 @@ export const withCioNotificationsXcodeProject: ConfigPlugin<
pushNotification,
};
- const modifiedProjectFile = await addNotificationServiceExtension(
+ const modifiedProjectFile = await addCIONotificationServiceExtension(
options,
config.modResults
);
@@ -136,9 +136,9 @@ const addRichPushXcodeProj = async (
const files = [
PLIST_FILENAME,
- 'NotificationService.h',
- 'NotificationService.swift',
- 'NotificationService.m',
+ 'CIONotificationService.h',
+ 'CIONotificationService.swift',
+ 'CIONotificationService.m',
ENV_FILENAME,
];
@@ -204,7 +204,7 @@ const addRichPushXcodeProj = async (
// Add build phases to the new target
xcodeProject.addBuildPhase(
- ['NotificationService.m', 'NotificationService.swift', 'Env.swift'],
+ ['CIONotificationService.m', 'CIONotificationService.swift', 'Env.swift'],
'PBXSourcesBuildPhase',
'Sources',
nseTarget.uuid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment