customerio-expo-plugin 1.0.0-alpha.5 → 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/lib/commonjs/android/withGoogleServicesJSON.js +7 -5
- package/lib/commonjs/android/withGoogleServicesJSON.js.map +1 -1
- package/lib/commonjs/helpers/constants/ios.js +5 -52
- package/lib/commonjs/helpers/constants/ios.js.map +1 -1
- package/lib/commonjs/helpers/native-files/ios/Env.swift +8 -0
- package/lib/commonjs/helpers/native-files/ios/NotificationService.swift +4 -1
- package/lib/commonjs/helpers/native-files/ios/{PushNotification.swift → PushService.swift} +0 -0
- package/lib/commonjs/helpers/utils/injectCIOPodfileCode.js +1 -3
- package/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map +1 -1
- package/lib/commonjs/index.js +0 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ios/withCIOIos.js +2 -7
- package/lib/commonjs/ios/withCIOIos.js.map +1 -1
- package/lib/commonjs/ios/withNotificationsXcodeProject.js +145 -74
- package/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -1
- package/lib/commonjs/postInstall.js +7 -0
- package/lib/commonjs/postInstall.js.map +1 -0
- package/lib/commonjs/postInstallHelper.js +20 -0
- package/lib/commonjs/postInstallHelper.js.map +1 -0
- package/lib/commonjs/types/cio-types.js.map +1 -1
- package/lib/module/android/withGoogleServicesJSON.js +7 -5
- package/lib/module/android/withGoogleServicesJSON.js.map +1 -1
- package/lib/module/helpers/constants/ios.js +3 -47
- package/lib/module/helpers/constants/ios.js.map +1 -1
- package/lib/module/helpers/native-files/ios/Env.swift +8 -0
- package/lib/module/helpers/native-files/ios/NotificationService.swift +4 -1
- package/lib/module/helpers/native-files/ios/{PushNotification.swift → PushService.swift} +0 -0
- package/lib/module/helpers/utils/injectCIOPodfileCode.js +2 -4
- package/lib/module/helpers/utils/injectCIOPodfileCode.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/ios/withCIOIos.js +2 -7
- package/lib/module/ios/withCIOIos.js.map +1 -1
- package/lib/module/ios/withNotificationsXcodeProject.js +145 -74
- package/lib/module/ios/withNotificationsXcodeProject.js.map +1 -1
- package/lib/module/postInstall.js +5 -0
- package/lib/module/postInstall.js.map +1 -0
- package/lib/module/postInstallHelper.js +18 -0
- package/lib/module/postInstallHelper.js.map +1 -0
- package/lib/module/types/cio-types.js.map +1 -1
- package/lib/typescript/helpers/constants/ios.d.ts +2 -5
- package/lib/typescript/types/cio-types.d.ts +6 -1
- package/package.json +9 -5
- package/src/android/withGoogleServicesJSON.ts +9 -5
- package/src/helpers/constants/ios.ts +3 -46
- package/src/helpers/native-files/ios/Env.swift +8 -0
- package/src/helpers/native-files/ios/NotificationService.swift +4 -1
- package/src/helpers/native-files/ios/{PushNotification.swift → PushService.swift} +0 -0
- package/src/helpers/utils/injectCIOPodfileCode.ts +2 -10
- package/src/index.ts +0 -3
- package/src/ios/withCIOIos.ts +2 -8
- package/src/ios/withNotificationsXcodeProject.ts +218 -124
- package/src/postInstall.js +5 -0
- package/src/postInstallHelper.js +22 -0
- package/src/types/cio-types.ts +6 -1
- package/lib/commonjs/analytics/injectAnalytics.js +0 -31
- package/lib/commonjs/analytics/injectAnalytics.js.map +0 -1
- package/lib/commonjs/ios/withAppDelegateXcodeProject.js +0 -79
- package/lib/commonjs/ios/withAppDelegateXcodeProject.js.map +0 -1
- package/lib/commonjs/version.js +0 -9
- package/lib/commonjs/version.js.map +0 -1
- package/lib/module/analytics/injectAnalytics.js +0 -24
- package/lib/module/analytics/injectAnalytics.js.map +0 -1
- package/lib/module/ios/withAppDelegateXcodeProject.js +0 -71
- package/lib/module/ios/withAppDelegateXcodeProject.js.map +0 -1
- package/lib/module/version.js +0 -2
- package/lib/module/version.js.map +0 -1
- package/lib/typescript/analytics/injectAnalytics.d.ts +0 -3
- package/lib/typescript/ios/withAppDelegateXcodeProject.d.ts +0 -3
- package/lib/typescript/version.d.ts +0 -1
- package/src/analytics/injectAnalytics.ts +0 -36
- package/src/ios/withAppDelegateXcodeProject.ts +0 -89
- package/src/version.ts +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|

|
|
9
9
|

|
|
10
|
-
[](code_of_conduct.md)
|
|
10
|
+
[](code_of_conduct.md)
|
|
11
11
|
[](https://codecov.io/gh/customerio/customerio-expo-plugin)
|
|
12
12
|
|
|
13
13
|
# Customer.io Expo Plugin
|
|
@@ -40,7 +40,7 @@ By default, the plugin expects to use Apple's Push Notification service (APNs) f
|
|
|
40
40
|
"customerio-expo-plugin",
|
|
41
41
|
{
|
|
42
42
|
"android": {
|
|
43
|
-
"
|
|
43
|
+
"googleServicesFile": "./files/google-services.json",
|
|
44
44
|
},
|
|
45
45
|
"ios": {
|
|
46
46
|
"pushNotification": {
|
|
@@ -71,10 +71,6 @@ By default, the plugin expects to use Apple's Push Notification service (APNs) f
|
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
1. Go to `ios/{your_appname}.xcworkspace` in XCode.
|
|
75
|
-
1. Right-click the main target `{your_appname}` and click **Add files to "{your_appname}"**.
|
|
76
|
-
1. Select `{your_appname}/PushNotification.swift` and click **Add**.
|
|
77
|
-
|
|
78
74
|
1. Add an import statement to your project for the react native library. We haven't included it below, but you can import `CioLogLevel` to set log outputs to something other than `error`; this may help you debug your application.
|
|
79
75
|
```javascript
|
|
80
76
|
import { CustomerIO, CustomerioConfig, CustomerIOEnv, Region } from ‘customerio-reactnative’;
|
|
@@ -123,7 +119,7 @@ The `customerio-expo-plugin` supports the following configuration options. In mo
|
|
|
123
119
|
<td>Required if you want to setup iOS even if it is empty. Eg (<code>"ios": {}</code>).</td>
|
|
124
120
|
</tr>
|
|
125
121
|
<tr>
|
|
126
|
-
<td><code>android.
|
|
122
|
+
<td><code>android.googleServicesFile</code></td>
|
|
127
123
|
<td>string</td>
|
|
128
124
|
<td><code>undefined</code></td>
|
|
129
125
|
<td>Set the path to the folder that contains your <code>google-services.json</code> file with a trailing slash (<code>/</code>).</td>
|
|
@@ -140,6 +136,12 @@ The `customerio-expo-plugin` supports the following configuration options. In mo
|
|
|
140
136
|
<td><code>false</code></td>
|
|
141
137
|
<td>Enables rich push for iOS</td>
|
|
142
138
|
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td style="white-space:nowrap;"><code>ios.useFrameworks</code></td>
|
|
141
|
+
<td>string</td>
|
|
142
|
+
<td><code>undefined</code></td>
|
|
143
|
+
<td>This is optional, it allows the plugin to work with static libraries. Options are <code>static</code> and <code>dynamic</code></td>
|
|
144
|
+
</tr>
|
|
143
145
|
</tbody>
|
|
144
146
|
</table>
|
|
145
147
|
|
|
@@ -182,7 +184,7 @@ See our complete SDK documentation at [https://customer.io/docs/sdk/expo/](https
|
|
|
182
184
|
|
|
183
185
|
Thanks for taking an interest in our project! We welcome your contributions.
|
|
184
186
|
|
|
185
|
-
We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our [code of conduct](CODE_OF_CONDUCT.md).
|
|
187
|
+
We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our [code of conduct](CODE_OF_CONDUCT.md).
|
|
186
188
|
|
|
187
189
|
# License
|
|
188
190
|
|
|
@@ -10,19 +10,21 @@ const withGoogleServicesJSON = (configOuter, cioProps) => {
|
|
|
10
10
|
return (0, _configPlugins.withProjectBuildGradle)(configOuter, props => {
|
|
11
11
|
const options = {
|
|
12
12
|
androidPath: props.modRequest.platformProjectRoot,
|
|
13
|
-
|
|
13
|
+
googleServicesFile: cioProps === null || cioProps === void 0 ? void 0 : cioProps.googleServicesFile
|
|
14
14
|
};
|
|
15
15
|
const {
|
|
16
16
|
androidPath,
|
|
17
|
-
|
|
17
|
+
googleServicesFile
|
|
18
18
|
} = options;
|
|
19
19
|
if (!_fileManagement.FileManagement.exists(`${androidPath}/app/google-services.json`)) {
|
|
20
|
-
if (
|
|
20
|
+
if (googleServicesFile && _fileManagement.FileManagement.exists(googleServicesFile)) {
|
|
21
21
|
try {
|
|
22
|
-
_fileManagement.FileManagement.copyFile(
|
|
22
|
+
_fileManagement.FileManagement.copyFile(googleServicesFile, `${androidPath}/app/google-services.json`);
|
|
23
23
|
} catch (e) {
|
|
24
|
-
console.log(`There was an error copying your google-services.json file. You can copy it manually into ${androidPath}/app
|
|
24
|
+
console.log(`There was an error copying your google-services.json file. You can copy it manually into ${androidPath}/app/google-services.json`);
|
|
25
25
|
}
|
|
26
|
+
} else {
|
|
27
|
+
console.log(`The Google Services file provided in ${googleServicesFile} doesn't seem to exist. You can copy it manually into ${androidPath}/app/google-services.json`);
|
|
26
28
|
}
|
|
27
29
|
} else {
|
|
28
30
|
console.log(`File already exists: ${androidPath}/app/google-services.json. Skipping...`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withGoogleServicesJSON","configOuter","cioProps","withProjectBuildGradle","props","options","androidPath","modRequest","platformProjectRoot","
|
|
1
|
+
{"version":3,"names":["withGoogleServicesJSON","configOuter","cioProps","withProjectBuildGradle","props","options","androidPath","modRequest","platformProjectRoot","googleServicesFile","FileManagement","exists","copyFile","e","console","log"],"sources":["withGoogleServicesJSON.ts"],"sourcesContent":["import { withProjectBuildGradle, ConfigPlugin } from '@expo/config-plugins';\n\nimport { FileManagement } from './../helpers/utils/fileManagement';\nimport type { CustomerIOPluginOptionsAndroid } from './../types/cio-types';\n\nexport const withGoogleServicesJSON: ConfigPlugin<\n CustomerIOPluginOptionsAndroid\n> = (configOuter, cioProps) => {\n return withProjectBuildGradle(configOuter, (props) => {\n const options: CustomerIOPluginOptionsAndroid = {\n androidPath: props.modRequest.platformProjectRoot,\n googleServicesFile: cioProps?.googleServicesFile,\n };\n const { androidPath, googleServicesFile } = options;\n if (!FileManagement.exists(`${androidPath}/app/google-services.json`)) {\n if (googleServicesFile && FileManagement.exists(googleServicesFile)) {\n try {\n FileManagement.copyFile(\n googleServicesFile,\n `${androidPath}/app/google-services.json`\n );\n } catch (e) {\n console.log(\n `There was an error copying your google-services.json file. You can copy it manually into ${androidPath}/app/google-services.json`\n );\n }\n } else {\n console.log(\n `The Google Services file provided in ${googleServicesFile} doesn't seem to exist. You can copy it manually into ${androidPath}/app/google-services.json`\n );\n }\n } else {\n console.log(\n `File already exists: ${androidPath}/app/google-services.json. Skipping...`\n );\n }\n\n return props;\n });\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAGO,MAAMA,sBAEZ,GAAG,CAACC,WAAW,EAAEC,QAAQ,KAAK;EAC7B,OAAO,IAAAC,qCAAsB,EAACF,WAAW,EAAGG,KAAK,IAAK;IACpD,MAAMC,OAAuC,GAAG;MAC9CC,WAAW,EAAEF,KAAK,CAACG,UAAU,CAACC,mBAAmB;MACjDC,kBAAkB,EAAEP,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEO;IAChC,CAAC;IACD,MAAM;MAAEH,WAAW;MAAEG;IAAmB,CAAC,GAAGJ,OAAO;IACnD,IAAI,CAACK,8BAAc,CAACC,MAAM,CAAE,GAAEL,WAAY,2BAA0B,CAAC,EAAE;MACrE,IAAIG,kBAAkB,IAAIC,8BAAc,CAACC,MAAM,CAACF,kBAAkB,CAAC,EAAE;QACnE,IAAI;UACFC,8BAAc,CAACE,QAAQ,CACrBH,kBAAkB,EACjB,GAAEH,WAAY,2BAA0B,CAC1C;QACH,CAAC,CAAC,OAAOO,CAAC,EAAE;UACVC,OAAO,CAACC,GAAG,CACR,4FAA2FT,WAAY,2BAA0B,CACnI;QACH;MACF,CAAC,MAAM;QACLQ,OAAO,CAACC,GAAG,CACR,wCAAuCN,kBAAmB,yDAAwDH,WAAY,2BAA0B,CAC1J;MACH;IACF,CAAC,MAAM;MACLQ,OAAO,CAACC,GAAG,CACR,wBAAuBT,WAAY,wCAAuC,CAC5E;IACH;IAEA,OAAOF,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.LOCAL_PATH_TO_CIO_NSE_FILES = exports.IOS_DEPLOYMENT_TARGET = exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = exports.DEFAULT_BUNDLE_VERSION = exports.DEFAULT_BUNDLE_SHORT_VERSION = exports.CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = exports.CIO_TARGET_NAME = exports.CIO_SDK_VERSION = exports.CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = exports.
|
|
6
|
+
exports.LOCAL_PATH_TO_CIO_NSE_FILES = exports.IOS_DEPLOYMENT_TARGET = exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = exports.DEFAULT_BUNDLE_VERSION = exports.DEFAULT_BUNDLE_SHORT_VERSION = exports.CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = exports.CIO_TARGET_NAME = exports.CIO_SDK_VERSION = exports.CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = exports.CIO_PODFILE_SNIPPET = exports.CIO_PODFILE_REGEX = exports.CIO_PODFILE_POST_INSTALL_REGEX = exports.CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET = exports.CIO_PODFILE_NOTIFICATION_SNIPPET = exports.CIO_PODFILE_NOTIFICATION_REGEX = exports.CIO_NOTIFICATION_TARGET_NAME = exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX = exports.CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = exports.CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX = exports.CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = exports.CIO_CIO_TARGET_REGEX = exports.CIO_APPDELEGATEHEADER_SNIPPET = exports.CIO_APPDELEGATEHEADER_REGEX = exports.CIO_APPDELEGATEDECLARATION_REGEX = exports.BUNDLE_VERSION_TEMPLATE_REGEX = exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = void 0;
|
|
7
7
|
const LOCAL_PATH_TO_CIO_NSE_FILES = `node_modules/customerio-expo-plugin/src/helpers/native-files/ios`;
|
|
8
8
|
exports.LOCAL_PATH_TO_CIO_NSE_FILES = LOCAL_PATH_TO_CIO_NSE_FILES;
|
|
9
9
|
const IOS_DEPLOYMENT_TARGET = '13.0';
|
|
10
10
|
exports.IOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET;
|
|
11
|
-
const CIO_SDK_VERSION = '
|
|
11
|
+
const CIO_SDK_VERSION = '~> 2.0.0';
|
|
12
12
|
exports.CIO_SDK_VERSION = CIO_SDK_VERSION;
|
|
13
13
|
const CIO_PODFILE_REGEX = /pod 'CustomerIO\/MessagingPushAPN'/;
|
|
14
14
|
exports.CIO_PODFILE_REGEX = CIO_PODFILE_REGEX;
|
|
@@ -16,14 +16,14 @@ const CIO_CIO_TARGET_REGEX = /cio_target_names/;
|
|
|
16
16
|
exports.CIO_CIO_TARGET_REGEX = CIO_CIO_TARGET_REGEX;
|
|
17
17
|
const CIO_PODFILE_NOTIFICATION_REGEX = /target 'NotificationService' do/;
|
|
18
18
|
exports.CIO_PODFILE_NOTIFICATION_REGEX = CIO_PODFILE_NOTIFICATION_REGEX;
|
|
19
|
+
const CIO_PODFILE_POST_INSTALL_REGEX = /post_install do \|installer\|/;
|
|
20
|
+
exports.CIO_PODFILE_POST_INSTALL_REGEX = CIO_PODFILE_POST_INSTALL_REGEX;
|
|
19
21
|
const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;
|
|
20
22
|
exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = GROUP_IDENTIFIER_TEMPLATE_REGEX;
|
|
21
23
|
const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;
|
|
22
24
|
exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = BUNDLE_SHORT_VERSION_TEMPLATE_REGEX;
|
|
23
25
|
const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;
|
|
24
26
|
exports.BUNDLE_VERSION_TEMPLATE_REGEX = BUNDLE_VERSION_TEMPLATE_REGEX;
|
|
25
|
-
const CIO_PODFILE_POST_INSTALL_REGEX = /post_install do \|installer\|/;
|
|
26
|
-
exports.CIO_PODFILE_POST_INSTALL_REGEX = CIO_PODFILE_POST_INSTALL_REGEX;
|
|
27
27
|
const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = /(- \(BOOL\)application:\(UIApplication \*\)application didFinishLaunchingWithOptions:\(NSDictionary \*\)launchOptions(\s|\n)*?\{)((.|\n)*)\[super(\s)application:application(\s)didFinishLaunchingWithOptions:launchOptions\];/;
|
|
28
28
|
exports.CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = CIO_DIDFINISHLAUNCHINGMETHOD_REGEX;
|
|
29
29
|
const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = /return \[super application:application didFailToRegisterForRemoteNotificationsWithError:error\];/;
|
|
@@ -61,9 +61,6 @@ exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = CIO_DIDFA
|
|
|
61
61
|
const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `
|
|
62
62
|
return [pnHandlerObj application:application deviceToken:deviceToken];
|
|
63
63
|
`;
|
|
64
|
-
|
|
65
|
-
// Configure Customerio push notifications SDK by adding to application:didFinishLaunchingWithOptions: delegate method
|
|
66
|
-
// From Braze docs: https://www.customer.io/docs/sdk/react-native/push/#obj-c-push
|
|
67
64
|
exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET;
|
|
68
65
|
const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `
|
|
69
66
|
// Register for push notifications
|
|
@@ -85,7 +82,7 @@ const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `
|
|
|
85
82
|
completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);
|
|
86
83
|
}`;
|
|
87
84
|
exports.CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET;
|
|
88
|
-
const CIO_PODFILE_SNIPPET = ` pod 'CustomerIO/MessagingPushAPN', '
|
|
85
|
+
const CIO_PODFILE_SNIPPET = ` pod 'CustomerIO/MessagingPushAPN', '${CIO_SDK_VERSION}'`;
|
|
89
86
|
exports.CIO_PODFILE_SNIPPET = CIO_PODFILE_SNIPPET;
|
|
90
87
|
const CIO_PODFILE_NOTIFICATION_SNIPPET = `
|
|
91
88
|
target '${CIO_NOTIFICATION_TARGET_NAME}' do
|
|
@@ -98,48 +95,4 @@ target '${CIO_NOTIFICATION_TARGET_NAME}' do
|
|
|
98
95
|
${CIO_PODFILE_SNIPPET}
|
|
99
96
|
end`;
|
|
100
97
|
exports.CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET = CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET;
|
|
101
|
-
const CIO_PODFILE_TARGET_NAMES_SNIPPET = `
|
|
102
|
-
cio_target_names = [
|
|
103
|
-
'CustomerIOTracking',
|
|
104
|
-
'CustomerIOCommon',
|
|
105
|
-
'CustomerIOMessagingPushAPN',
|
|
106
|
-
'CustomerIOMessagingPush'
|
|
107
|
-
]`;
|
|
108
|
-
exports.CIO_PODFILE_TARGET_NAMES_SNIPPET = CIO_PODFILE_TARGET_NAMES_SNIPPET;
|
|
109
|
-
const CIO_PODFILE_POST_INSTALL_SNIPPET = `
|
|
110
|
-
installer.pods_project.targets.each do |target|
|
|
111
|
-
if cio_target_names.include? target.name
|
|
112
|
-
puts "Modifying target #{target.name}"
|
|
113
|
-
|
|
114
|
-
target.build_configurations.each do |config|
|
|
115
|
-
puts "Setting build config settings for #{target.name}"
|
|
116
|
-
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
end`;
|
|
120
|
-
exports.CIO_PODFILE_POST_INSTALL_SNIPPET = CIO_PODFILE_POST_INSTALL_SNIPPET;
|
|
121
|
-
const CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = `
|
|
122
|
-
cio_target_names = [
|
|
123
|
-
'CustomerIOTracking',
|
|
124
|
-
'CustomerIOCommon',
|
|
125
|
-
'CustomerIOMessagingPushAPN',
|
|
126
|
-
'CustomerIOMessagingPush'
|
|
127
|
-
]
|
|
128
|
-
|
|
129
|
-
post_install do |installer|
|
|
130
|
-
|
|
131
|
-
installer.pods_project.targets.each do |target|
|
|
132
|
-
if cio_target_names.include? target.name
|
|
133
|
-
puts "Modifying target #{target.name}"
|
|
134
|
-
|
|
135
|
-
target.build_configurations.each do |config|
|
|
136
|
-
puts "Setting build config settings for #{target.name}"
|
|
137
|
-
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
|
|
138
|
-
end
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
react_native_post_install(installer)
|
|
142
|
-
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
143
|
-
end`;
|
|
144
|
-
exports.CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET;
|
|
145
98
|
//# sourceMappingURL=ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LOCAL_PATH_TO_CIO_NSE_FILES","IOS_DEPLOYMENT_TARGET","CIO_SDK_VERSION","CIO_PODFILE_REGEX","CIO_CIO_TARGET_REGEX","CIO_PODFILE_NOTIFICATION_REGEX","GROUP_IDENTIFIER_TEMPLATE_REGEX","BUNDLE_SHORT_VERSION_TEMPLATE_REGEX","BUNDLE_VERSION_TEMPLATE_REGEX","
|
|
1
|
+
{"version":3,"names":["LOCAL_PATH_TO_CIO_NSE_FILES","IOS_DEPLOYMENT_TARGET","CIO_SDK_VERSION","CIO_PODFILE_REGEX","CIO_CIO_TARGET_REGEX","CIO_PODFILE_NOTIFICATION_REGEX","CIO_PODFILE_POST_INSTALL_REGEX","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","DEFAULT_BUNDLE_VERSION","DEFAULT_BUNDLE_SHORT_VERSION","CIO_TARGET_NAME","CIO_NOTIFICATION_TARGET_NAME","CIO_APPDELEGATEHEADER_SNIPPET","CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET","CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET","CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET","CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET","CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET","CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET","CIO_PODFILE_SNIPPET","CIO_PODFILE_NOTIFICATION_SNIPPET","CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET"],"sources":["ios.ts"],"sourcesContent":["export const LOCAL_PATH_TO_CIO_NSE_FILES = `node_modules/customerio-expo-plugin/src/helpers/native-files/ios`;\nexport const IOS_DEPLOYMENT_TARGET = '13.0';\nexport const CIO_SDK_VERSION = '~> 2.0.0';\nexport const CIO_PODFILE_REGEX = /pod 'CustomerIO\\/MessagingPushAPN'/;\nexport const CIO_CIO_TARGET_REGEX = /cio_target_names/;\nexport const CIO_PODFILE_NOTIFICATION_REGEX = /target 'NotificationService' do/;\nexport const CIO_PODFILE_POST_INSTALL_REGEX = /post_install do \\|installer\\|/;\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 /(- \\(BOOL\\)application:\\(UIApplication \\*\\)application didFinishLaunchingWithOptions:\\(NSDictionary \\*\\)launchOptions(\\s|\\n)*?\\{)((.|\\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 : EXAppDelegateWrapper <RCTBridgeDelegate>/;\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';\nexport const CIO_APPDELEGATEHEADER_SNIPPET = `\n#import <UserNotifications/UserNotifications.h>\n\n@interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate, UNUserNotificationCenterDelegate>\n`;\n\nexport const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `\nCIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];\n`;\n\nexport const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `\n [pnHandlerObj application:application error:error];\n`;\n\nexport const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `\n return [pnHandlerObj application:application deviceToken:deviceToken];\n`;\n\nexport const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `\n // Register for push notifications\n [pnHandlerObj registerPushNotification:self];\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_PODFILE_SNIPPET = ` pod 'CustomerIO/MessagingPushAPN', '${CIO_SDK_VERSION}'`;\nexport const CIO_PODFILE_NOTIFICATION_SNIPPET = `\ntarget '${CIO_NOTIFICATION_TARGET_NAME}' do\n${CIO_PODFILE_SNIPPET}\nend`;\nexport const CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET = `\ntarget '${CIO_NOTIFICATION_TARGET_NAME}' do\n use_frameworks! :linkage => :static\n${CIO_PODFILE_SNIPPET}\nend`;\n"],"mappings":";;;;;;AAAO,MAAMA,2BAA2B,GAAI,kEAAiE;AAAC;AACvG,MAAMC,qBAAqB,GAAG,MAAM;AAAC;AACrC,MAAMC,eAAe,GAAG,UAAU;AAAC;AACnC,MAAMC,iBAAiB,GAAG,oCAAoC;AAAC;AAC/D,MAAMC,oBAAoB,GAAG,kBAAkB;AAAC;AAChD,MAAMC,8BAA8B,GAAG,iCAAiC;AAAC;AACzE,MAAMC,8BAA8B,GAAG,+BAA+B;AAAC;AACvE,MAAMC,+BAA+B,GAAG,wBAAwB;AAAC;AACjE,MAAMC,mCAAmC,GAAG,4BAA4B;AAAC;AACzE,MAAMC,6BAA6B,GAAG,sBAAsB;AAAC;AAC7D,MAAMC,kCAAkC,GAC7C,gOAAgO;AAAC;AAE5N,MAAMC,0DAA0D,GACrE,kGAAkG;AAAC;AAE9F,MAAMC,8DAA8D,GACzE,wJAAwJ;AAAC;AAEpJ,MAAMC,0DAA0D,GACrE,wGAAwG;AAAC;AAEpG,MAAMC,gCAAgC,GAC3C,mCAAmC;AAAC;AAE/B,MAAMC,2BAA2B,GACtC,mEAAmE;AAAC;AAC/D,MAAMC,sBAAsB,GAAG,GAAG;AAAC;AACnC,MAAMC,4BAA4B,GAAG,KAAK;AAAC;AAC3C,MAAMC,eAAe,GAAG,eAAe;AAAC;AACxC,MAAMC,4BAA4B,GAAG,qBAAqB;AAAC;AAC3D,MAAMC,6BAA6B,GAAI;AAC9C;AACA;AACA;AACA,CAAC;AAAC;AAEK,MAAMC,8CAA8C,GAAI;AAC/D;AACA,CAAC;AAAC;AAEK,MAAMC,4DAA4D,GAAI;AAC7E;AACA,CAAC;AAAC;AAEK,MAAMC,4DAA4D,GAAI;AAC7E;AACA,CAAC;AAAC;AAEK,MAAMC,2CAA2C,GAAI;AAC5D;AACA;AACA,CAAC;;AAED;AAAA;AACO,MAAMC,iDAAiD,GAAI;AAClE;AACA;AACA,EAAE;;AAEF;AAAA;AACO,MAAMC,0CAA0C,GAAI;AAC3D;AACA;AACA;AACA,EAAE;AAAC;AACI,MAAMC,mBAAmB,GAAI,yCAAwCzB,eAAgB,GAAE;AAAC;AACxF,MAAM0B,gCAAgC,GAAI;AACjD,UAAUT,4BAA6B;AACvC,EAAEQ,mBAAoB;AACtB,IAAI;AAAC;AACE,MAAME,iDAAiD,GAAI;AAClE,UAAUV,4BAA6B;AACvC;AACA,EAAEQ,mBAAoB;AACtB,IAAI;AAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import UserNotifications
|
|
3
|
-
import
|
|
3
|
+
import CioTracking
|
|
4
|
+
import CioMessagingPushAPN
|
|
4
5
|
|
|
5
6
|
@objc
|
|
6
7
|
public class NotificationServiceCioManager : NSObject {
|
|
@@ -9,6 +10,8 @@ public class NotificationServiceCioManager : NSObject {
|
|
|
9
10
|
|
|
10
11
|
@objc(didReceive:withContentHandler:)
|
|
11
12
|
public func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
|
13
|
+
CustomerIO
|
|
14
|
+
.initialize(siteId: Env.customerIOSiteId, apiKey: Env.customerIOApiKey, region: Env.customerIORegion) { config in }
|
|
12
15
|
MessagingPush.shared.didReceive(request, withContentHandler: contentHandler)
|
|
13
16
|
}
|
|
14
17
|
|
|
File without changes
|
|
@@ -17,9 +17,7 @@ async function injectCIOPodfileCode(iosPath) {
|
|
|
17
17
|
const index = lines.findIndex(line => _ios.CIO_PODFILE_POST_INSTALL_REGEX.test(line));
|
|
18
18
|
let content = lines;
|
|
19
19
|
if (index > -1) {
|
|
20
|
-
content = [...lines.slice(0, index - 1), !matches ? _ios.CIO_PODFILE_SNIPPET : '',
|
|
21
|
-
} else {
|
|
22
|
-
content.push(_ios.CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET);
|
|
20
|
+
content = [...lines.slice(0, index - 1), !matches ? _ios.CIO_PODFILE_SNIPPET : '', ...lines.slice(index - 1)];
|
|
23
21
|
}
|
|
24
22
|
_fileManagement.FileManagement.write(filename, content.join('\n'));
|
|
25
23
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["injectCIOPodfileCode","iosPath","filename","podfile","FileManagement","read","matches","match","CIO_PODFILE_REGEX","targetMatch","CIO_CIO_TARGET_REGEX","lines","split","index","findIndex","line","CIO_PODFILE_POST_INSTALL_REGEX","test","content","slice","CIO_PODFILE_SNIPPET","
|
|
1
|
+
{"version":3,"names":["injectCIOPodfileCode","iosPath","filename","podfile","FileManagement","read","matches","match","CIO_PODFILE_REGEX","targetMatch","CIO_CIO_TARGET_REGEX","lines","split","index","findIndex","line","CIO_PODFILE_POST_INSTALL_REGEX","test","content","slice","CIO_PODFILE_SNIPPET","write","join","console","log","injectCIONotificationPodfileCode","useFrameworks","CIO_PODFILE_NOTIFICATION_REGEX","snippet","CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET","CIO_PODFILE_NOTIFICATION_SNIPPET","append"],"sources":["injectCIOPodfileCode.ts"],"sourcesContent":["import type { CustomerIOPluginOptionsIOS } from '../../types/cio-types';\nimport {\n CIO_PODFILE_REGEX,\n CIO_PODFILE_SNIPPET,\n CIO_PODFILE_NOTIFICATION_SNIPPET,\n CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET,\n CIO_PODFILE_NOTIFICATION_REGEX,\n CIO_CIO_TARGET_REGEX,\n CIO_PODFILE_POST_INSTALL_REGEX,\n} from '../constants/ios';\nimport { FileManagement } from './fileManagement';\n\nexport async function injectCIOPodfileCode(iosPath: string) {\n const filename = `${iosPath}/Podfile`;\n const podfile = await FileManagement.read(filename);\n const matches = podfile.match(CIO_PODFILE_REGEX);\n const targetMatch = podfile.match(CIO_CIO_TARGET_REGEX);\n\n if (!targetMatch) {\n const lines = podfile.split('\\n');\n const index = lines.findIndex((line) =>\n CIO_PODFILE_POST_INSTALL_REGEX.test(line)\n );\n let content: string[] = lines;\n if (index > -1) {\n content = [\n ...lines.slice(0, index - 1),\n !matches ? CIO_PODFILE_SNIPPET : '',\n ...lines.slice(index - 1),\n ];\n }\n\n FileManagement.write(filename, content.join('\\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 const matches = podfile.match(CIO_PODFILE_NOTIFICATION_REGEX);\n\n if (!matches) {\n const snippet =\n useFrameworks === 'static'\n ? CIO_PODFILE_NOTIFICATION_STATIC_FRAMEWORK_SNIPPET\n : CIO_PODFILE_NOTIFICATION_SNIPPET;\n FileManagement.append(filename, snippet);\n }\n}\n"],"mappings":";;;;;;;AACA;AASA;AAEO,eAAeA,oBAAoB,CAACC,OAAe,EAAE;EAC1D,MAAMC,QAAQ,GAAI,GAAED,OAAQ,UAAS;EACrC,MAAME,OAAO,GAAG,MAAMC,8BAAc,CAACC,IAAI,CAACH,QAAQ,CAAC;EACnD,MAAMI,OAAO,GAAGH,OAAO,CAACI,KAAK,CAACC,sBAAiB,CAAC;EAChD,MAAMC,WAAW,GAAGN,OAAO,CAACI,KAAK,CAACG,yBAAoB,CAAC;EAEvD,IAAI,CAACD,WAAW,EAAE;IAChB,MAAME,KAAK,GAAGR,OAAO,CAACS,KAAK,CAAC,IAAI,CAAC;IACjC,MAAMC,KAAK,GAAGF,KAAK,CAACG,SAAS,CAAEC,IAAI,IACjCC,mCAA8B,CAACC,IAAI,CAACF,IAAI,CAAC,CAC1C;IACD,IAAIG,OAAiB,GAAGP,KAAK;IAC7B,IAAIE,KAAK,GAAG,CAAC,CAAC,EAAE;MACdK,OAAO,GAAG,CACR,GAAGP,KAAK,CAACQ,KAAK,CAAC,CAAC,EAAEN,KAAK,GAAG,CAAC,CAAC,EAC5B,CAACP,OAAO,GAAGc,wBAAmB,GAAG,EAAE,EACnC,GAAGT,KAAK,CAACQ,KAAK,CAACN,KAAK,GAAG,CAAC,CAAC,CAC1B;IACH;IAEAT,8BAAc,CAACiB,KAAK,CAACnB,QAAQ,EAAEgB,OAAO,CAACI,IAAI,CAAC,IAAI,CAAC,CAAC;EACpD,CAAC,MAAM;IACLC,OAAO,CAACC,GAAG,CAAC,yDAAyD,CAAC;EACxE;AACF;AAEO,eAAeC,gCAAgC,CACpDxB,OAAe,EACfyB,aAA0D,EAC1D;EACA,MAAMxB,QAAQ,GAAI,GAAED,OAAQ,UAAS;EACrC,MAAME,OAAO,GAAG,MAAMC,8BAAc,CAACC,IAAI,CAACH,QAAQ,CAAC;EACnD,MAAMI,OAAO,GAAGH,OAAO,CAACI,KAAK,CAACoB,mCAA8B,CAAC;EAE7D,IAAI,CAACrB,OAAO,EAAE;IACZ,MAAMsB,OAAO,GACXF,aAAa,KAAK,QAAQ,GACtBG,sDAAiD,GACjDC,qCAAgC;IACtC1B,8BAAc,CAAC2B,MAAM,CAAC7B,QAAQ,EAAE0B,OAAO,CAAC;EAC1C;AACF"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _injectAnalytics = require("./analytics/injectAnalytics");
|
|
8
7
|
var _withCIOAndroid = require("./android/withCIOAndroid");
|
|
9
8
|
var _withCIOIos = require("./ios/withCIOIos");
|
|
10
9
|
// Entry point for config plugin
|
|
@@ -15,7 +14,6 @@ function withCustomerIOPlugin(config, props) {
|
|
|
15
14
|
if (props.android) {
|
|
16
15
|
config = (0, _withCIOAndroid.withCIOAndroid)(config, props.android);
|
|
17
16
|
}
|
|
18
|
-
config = (0, _injectAnalytics.withAnalytics)(config, props);
|
|
19
17
|
return config;
|
|
20
18
|
}
|
|
21
19
|
var _default = withCustomerIOPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withCustomerIOPlugin","config","props","ios","withCIOIos","android","withCIOAndroid"
|
|
1
|
+
{"version":3,"names":["withCustomerIOPlugin","config","props","ios","withCIOIos","android","withCIOAndroid"],"sources":["index.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport { withCIOAndroid } from './android/withCIOAndroid';\nimport { withCIOIos } from './ios/withCIOIos';\nimport type { CustomerIOPluginOptions } from './types/cio-types';\n\n// Entry point for config plugin\nfunction withCustomerIOPlugin(\n config: ExpoConfig,\n props: CustomerIOPluginOptions\n) {\n if (props.ios) {\n config = withCIOIos(config, props.ios);\n }\n\n if (props.android) {\n config = withCIOAndroid(config, props.android);\n }\n\n return config;\n}\n\nexport default withCustomerIOPlugin;\n"],"mappings":";;;;;;AAEA;AACA;AAGA;AACA,SAASA,oBAAoB,CAC3BC,MAAkB,EAClBC,KAA8B,EAC9B;EACA,IAAIA,KAAK,CAACC,GAAG,EAAE;IACbF,MAAM,GAAG,IAAAG,sBAAU,EAACH,MAAM,EAAEC,KAAK,CAACC,GAAG,CAAC;EACxC;EAEA,IAAID,KAAK,CAACG,OAAO,EAAE;IACjBJ,MAAM,GAAG,IAAAK,8BAAc,EAACL,MAAM,EAAEC,KAAK,CAACG,OAAO,CAAC;EAChD;EAEA,OAAOJ,MAAM;AACf;AAAC,eAEcD,oBAAoB;AAAA"}
|
|
@@ -5,19 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.withCIOIos = withCIOIos;
|
|
7
7
|
var _withAppDelegateModifications = require("./withAppDelegateModifications");
|
|
8
|
-
var _withAppDelegateXcodeProject = require("./withAppDelegateXcodeProject");
|
|
9
8
|
var _withNotificationsXcodeProject = require("./withNotificationsXcodeProject");
|
|
10
9
|
var _withXcodeProject = require("./withXcodeProject");
|
|
11
10
|
function withCIOIos(config, props) {
|
|
12
|
-
var _props$pushNotificati;
|
|
13
|
-
if ((_props$pushNotificati = props.pushNotification) !== null && _props$pushNotificati !== void 0 && _props$pushNotificati.useRichPush) {
|
|
14
|
-
config = (0, _withNotificationsXcodeProject.withCioNotificationsXcodeProject)(config, props);
|
|
15
|
-
}
|
|
16
11
|
if (props.pushNotification) {
|
|
17
12
|
config = (0, _withAppDelegateModifications.withAppDelegateModifications)(config, props);
|
|
18
|
-
config = (0,
|
|
13
|
+
config = (0, _withNotificationsXcodeProject.withCioNotificationsXcodeProject)(config, props);
|
|
14
|
+
config = (0, _withXcodeProject.withCioXcodeProject)(config, props);
|
|
19
15
|
}
|
|
20
|
-
config = (0, _withXcodeProject.withCioXcodeProject)(config, props);
|
|
21
16
|
return config;
|
|
22
17
|
}
|
|
23
18
|
//# sourceMappingURL=withCIOIos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withCIOIos","config","props","pushNotification","
|
|
1
|
+
{"version":3,"names":["withCIOIos","config","props","pushNotification","withAppDelegateModifications","withCioNotificationsXcodeProject","withCioXcodeProject"],"sources":["withCIOIos.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { withAppDelegateModifications } from './withAppDelegateModifications';\nimport { withCioNotificationsXcodeProject } from './withNotificationsXcodeProject';\nimport { withCioXcodeProject } from './withXcodeProject';\n\nexport function withCIOIos(\n config: ExpoConfig,\n props: CustomerIOPluginOptionsIOS\n) {\n if (props.pushNotification) {\n config = withAppDelegateModifications(config, props);\n config = withCioNotificationsXcodeProject(config, props);\n config = withCioXcodeProject(config, props);\n }\n\n return config;\n}\n"],"mappings":";;;;;;AAGA;AACA;AACA;AAEO,SAASA,UAAU,CACxBC,MAAkB,EAClBC,KAAiC,EACjC;EACA,IAAIA,KAAK,CAACC,gBAAgB,EAAE;IAC1BF,MAAM,GAAG,IAAAG,0DAA4B,EAACH,MAAM,EAAEC,KAAK,CAAC;IACpDD,MAAM,GAAG,IAAAI,+DAAgC,EAACJ,MAAM,EAAEC,KAAK,CAAC;IACxDD,MAAM,GAAG,IAAAK,qCAAmB,EAACL,MAAM,EAAEC,KAAK,CAAC;EAC7C;EAEA,OAAOD,MAAM;AACf"}
|