customerio-expo-plugin 0.0.5 → 1.0.0-alpha.2
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/lib/commonjs/analytics/injectAnalytics.js +31 -0
- package/lib/commonjs/analytics/injectAnalytics.js.map +1 -0
- package/lib/commonjs/android/withAppGoogleServices.js +22 -0
- package/lib/commonjs/android/withAppGoogleServices.js.map +1 -0
- package/lib/commonjs/android/withCIOAndroid.js +18 -0
- package/lib/commonjs/android/withCIOAndroid.js.map +1 -0
- package/lib/commonjs/android/withGistMavenRepository.js +21 -0
- package/lib/commonjs/android/withGistMavenRepository.js.map +1 -0
- package/lib/commonjs/android/withGoogleServicesJSON.js +34 -0
- package/lib/commonjs/android/withGoogleServicesJSON.js.map +1 -0
- package/lib/commonjs/android/withProjectGoogleServices.js +20 -0
- package/lib/commonjs/android/withProjectGoogleServices.js.map +1 -0
- package/lib/commonjs/helpers/constants/android.js +21 -0
- package/lib/commonjs/helpers/constants/android.js.map +1 -0
- package/lib/commonjs/helpers/constants/globals.d.js +2 -0
- package/lib/commonjs/helpers/constants/globals.d.js.map +1 -0
- package/lib/commonjs/helpers/constants/ios.js +140 -0
- package/lib/commonjs/helpers/constants/ios.js.map +1 -0
- package/{build/helpers/ios/CIONotificationService-Info.plist → lib/commonjs/helpers/native-files/ios/NotificationService-Info.plist} +2 -2
- package/{build/helpers/ios/CIONotificationService.h → lib/commonjs/helpers/native-files/ios/NotificationService.h} +0 -0
- package/{build/helpers/ios/CIONotificationService.m → lib/commonjs/helpers/native-files/ios/NotificationService.m} +2 -6
- package/{build/helpers/ios/CIONotificationService.swift → lib/commonjs/helpers/native-files/ios/NotificationService.swift} +0 -2
- package/{build/helpers → lib/commonjs/helpers/native-files}/ios/PushNotification.swift +1 -10
- package/lib/commonjs/helpers/utils/codeInjection.js +33 -0
- package/lib/commonjs/helpers/utils/codeInjection.js.map +1 -0
- package/lib/commonjs/helpers/utils/fileManagement.js +76 -0
- package/lib/commonjs/helpers/utils/fileManagement.js.map +1 -0
- package/lib/commonjs/helpers/utils/injectCIOPodfileCode.js +37 -0
- package/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map +1 -0
- package/lib/commonjs/index.js +23 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/ios/withAppDelegateModifications.js +85 -0
- package/lib/commonjs/ios/withAppDelegateModifications.js.map +1 -0
- package/lib/commonjs/ios/withAppDelegateXcodeProject.js +79 -0
- package/lib/commonjs/ios/withAppDelegateXcodeProject.js.map +1 -0
- package/lib/commonjs/ios/withCIOIos.js +23 -0
- package/lib/commonjs/ios/withCIOIos.js.map +1 -0
- package/lib/commonjs/ios/withNotificationsXcodeProject.js +158 -0
- package/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -0
- package/lib/commonjs/ios/withXcodeProject.js +28 -0
- package/lib/commonjs/ios/withXcodeProject.js.map +1 -0
- package/lib/commonjs/types/cio-types.js +2 -0
- package/lib/commonjs/types/cio-types.js.map +1 -0
- package/lib/commonjs/version.js +9 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/analytics/injectAnalytics.js +24 -0
- package/lib/module/analytics/injectAnalytics.js.map +1 -0
- package/lib/module/android/withAppGoogleServices.js +15 -0
- package/lib/module/android/withAppGoogleServices.js.map +1 -0
- package/lib/module/android/withCIOAndroid.js +12 -0
- package/lib/module/android/withCIOAndroid.js.map +1 -0
- package/lib/module/android/withGistMavenRepository.js +14 -0
- package/lib/module/android/withGistMavenRepository.js.map +1 -0
- package/lib/module/android/withGoogleServicesJSON.js +27 -0
- package/lib/module/android/withGoogleServicesJSON.js.map +1 -0
- package/lib/module/android/withProjectGoogleServices.js +13 -0
- package/lib/module/android/withProjectGoogleServices.js.map +1 -0
- package/lib/module/helpers/constants/android.js +8 -0
- package/lib/module/helpers/constants/android.js.map +1 -0
- package/lib/module/helpers/constants/globals.d.js +2 -0
- package/lib/module/helpers/constants/globals.d.js.map +1 -0
- package/lib/module/helpers/constants/ios.js +103 -0
- package/lib/module/helpers/constants/ios.js.map +1 -0
- package/lib/module/helpers/native-files/ios/NotificationService-Info.plist +31 -0
- package/lib/module/helpers/native-files/ios/NotificationService.h +5 -0
- package/lib/module/helpers/native-files/ios/NotificationService.m +26 -0
- package/lib/module/helpers/native-files/ios/NotificationService.swift +19 -0
- package/lib/module/helpers/native-files/ios/PushNotification.swift +47 -0
- package/lib/module/helpers/utils/codeInjection.js +24 -0
- package/lib/module/helpers/utils/codeInjection.js.map +1 -0
- package/lib/module/helpers/utils/fileManagement.js +69 -0
- package/lib/module/helpers/utils/fileManagement.js.map +1 -0
- package/lib/module/helpers/utils/injectCIOPodfileCode.js +30 -0
- package/lib/module/helpers/utils/injectCIOPodfileCode.js.map +1 -0
- package/lib/module/index.js +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/ios/withAppDelegateModifications.js +78 -0
- package/lib/module/ios/withAppDelegateModifications.js.map +1 -0
- package/lib/module/ios/withAppDelegateXcodeProject.js +71 -0
- package/lib/module/ios/withAppDelegateXcodeProject.js.map +1 -0
- package/lib/module/ios/withCIOIos.js +17 -0
- package/lib/module/ios/withCIOIos.js.map +1 -0
- package/lib/module/ios/withNotificationsXcodeProject.js +150 -0
- package/lib/module/ios/withNotificationsXcodeProject.js.map +1 -0
- package/lib/module/ios/withXcodeProject.js +21 -0
- package/lib/module/ios/withXcodeProject.js.map +1 -0
- package/lib/module/types/cio-types.js +2 -0
- package/lib/module/types/cio-types.js.map +1 -0
- package/lib/module/version.js +2 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/analytics/injectAnalytics.d.ts +3 -0
- package/lib/typescript/android/withAppGoogleServices.d.ts +3 -0
- package/lib/typescript/android/withCIOAndroid.d.ts +3 -0
- package/lib/typescript/android/withGistMavenRepository.d.ts +3 -0
- package/lib/typescript/android/withGoogleServicesJSON.d.ts +3 -0
- package/lib/typescript/android/withProjectGoogleServices.d.ts +3 -0
- package/lib/typescript/helpers/constants/android.d.ts +7 -0
- package/lib/typescript/helpers/constants/ios.d.ts +31 -0
- package/lib/typescript/helpers/utils/codeInjection.d.ts +4 -0
- package/lib/typescript/helpers/utils/fileManagement.d.ts +12 -0
- package/lib/typescript/helpers/utils/injectCIOPodfileCode.d.ts +2 -0
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/ios/withAppDelegateModifications.d.ts +2 -0
- package/lib/typescript/ios/withAppDelegateXcodeProject.d.ts +3 -0
- package/lib/typescript/ios/withCIOIos.d.ts +3 -0
- package/lib/typescript/ios/withNotificationsXcodeProject.d.ts +3 -0
- package/lib/typescript/ios/withXcodeProject.d.ts +3 -0
- package/lib/typescript/types/cio-types.d.ts +25 -0
- package/lib/typescript/version.d.ts +1 -0
- package/package.json +88 -13
- package/src/analytics/injectAnalytics.ts +36 -0
- package/src/android/withAppGoogleServices.ts +26 -0
- package/src/android/withCIOAndroid.ts +19 -0
- package/src/android/withGistMavenRepository.ts +26 -0
- package/src/android/withGoogleServicesJSON.ts +36 -0
- package/src/android/withProjectGoogleServices.ts +24 -0
- package/src/helpers/constants/android.ts +14 -0
- package/src/helpers/constants/globals.d.ts +8 -0
- package/src/helpers/constants/ios.ts +116 -0
- package/src/helpers/native-files/ios/NotificationService-Info.plist +31 -0
- package/src/helpers/native-files/ios/NotificationService.h +5 -0
- package/src/helpers/native-files/ios/NotificationService.m +26 -0
- package/src/helpers/native-files/ios/NotificationService.swift +19 -0
- package/src/helpers/native-files/ios/PushNotification.swift +47 -0
- package/src/helpers/utils/codeInjection.ts +46 -0
- package/src/helpers/utils/fileManagement.ts +87 -0
- package/src/helpers/utils/injectCIOPodfileCode.ts +53 -0
- package/src/index.ts +26 -0
- package/src/ios/withAppDelegateModifications.ts +166 -0
- package/src/ios/withAppDelegateXcodeProject.ts +89 -0
- package/src/ios/withCIOIos.ts +25 -0
- package/src/ios/withNotificationsXcodeProject.ts +237 -0
- package/src/ios/withXcodeProject.ts +25 -0
- package/src/types/cio-types.ts +31 -0
- package/src/version.ts +1 -0
- package/build/helpers/.DS_Store +0 -0
- package/build/helpers/ios/.DS_Store +0 -0
- package/build/package.json +0 -36
- package/build/src/android/withAppGoogleServices.js +0 -12
- package/build/src/android/withCIOAndroid.js +0 -15
- package/build/src/android/withGistMavenRepository.js +0 -12
- package/build/src/android/withGoogleServicesJSON.js +0 -24
- package/build/src/android/withProjectGoogleServices.js +0 -12
- package/build/src/helpers/constants/android.js +0 -9
- package/build/src/helpers/constants/ios.js +0 -102
- package/build/src/helpers/utils/codeInjection.js +0 -30
- package/build/src/helpers/utils/fileManagement.js +0 -40
- package/build/src/helpers/utils/injectCIOPodfileCode.js +0 -37
- package/build/src/index.js +0 -11
- package/build/src/ios/withAppDelegateModifications.js +0 -77
- package/build/src/ios/withAppDelegateXcodeProject.js +0 -78
- package/build/src/ios/withCIOIos.js +0 -15
- package/build/src/ios/withNotificationsXcodeProject.js +0 -133
- package/build/src/ios/withXcodeProject.js +0 -22
- package/build/src/types/cio-types.js +0 -8
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withAnalytics = void 0;
|
|
7
|
+
var _version = require("./../version");
|
|
8
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
9
|
+
var _fileManagement = require("../helpers/utils/fileManagement");
|
|
10
|
+
const withAnalytics = config => {
|
|
11
|
+
return (0, _configPlugins.withXcodeProject)(config, async props => {
|
|
12
|
+
const expoVersionSnippet = `"expoVersion": "${_version.LIB_VERSION}"`;
|
|
13
|
+
let versionRegEx = new RegExp(expoVersionSnippet);
|
|
14
|
+
const filename = `node_modules/customerio-reactnative/package.json`;
|
|
15
|
+
if (_fileManagement.FileManagement.exists(filename)) {
|
|
16
|
+
const pJsonFile = await _fileManagement.FileManagement.read(filename);
|
|
17
|
+
const lines = pJsonFile.split('\n');
|
|
18
|
+
const missingMmatch = pJsonFile.match(versionRegEx);
|
|
19
|
+
const expoVersionRegex = /"expoVersion": ".*"/;
|
|
20
|
+
const existatch = pJsonFile.match(expoVersionRegex);
|
|
21
|
+
if (existatch && !missingMmatch) {
|
|
22
|
+
const index = lines.findIndex(line => expoVersionRegex.test(line));
|
|
23
|
+
const content = [...lines.slice(0, index), ` ${expoVersionSnippet},`, ...lines.slice(index + 1)];
|
|
24
|
+
_fileManagement.FileManagement.write(filename, content.join('\n'));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return props;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
exports.withAnalytics = withAnalytics;
|
|
31
|
+
//# sourceMappingURL=injectAnalytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withAnalytics","config","withXcodeProject","props","expoVersionSnippet","LIB_VERSION","versionRegEx","RegExp","filename","FileManagement","exists","pJsonFile","read","lines","split","missingMmatch","match","expoVersionRegex","existatch","index","findIndex","line","test","content","slice","write","join"],"sources":["injectAnalytics.ts"],"sourcesContent":["import { LIB_VERSION } from './../version';\nimport { ConfigPlugin, withXcodeProject } from '@expo/config-plugins';\nimport { FileManagement } from '../helpers/utils/fileManagement';\nimport type { CustomerIOPluginOptions } from '../types/cio-types';\n\n\nexport const withAnalytics: ConfigPlugin<CustomerIOPluginOptions> = (config) => {\n return withXcodeProject(config, async (props) => {\n const expoVersionSnippet = `\"expoVersion\": \"${LIB_VERSION}\"`;\n let versionRegEx = new RegExp(expoVersionSnippet);\n const filename = `node_modules/customerio-reactnative/package.json`;\n if (FileManagement.exists(filename)) {\n const pJsonFile = await FileManagement.read(filename);\n const lines = pJsonFile.split('\\n');\n const missingMmatch = pJsonFile.match(versionRegEx);\n const expoVersionRegex = /\"expoVersion\": \".*\"/;\n const existatch = pJsonFile.match(expoVersionRegex);\n\n if (existatch && !missingMmatch) {\n const index = lines.findIndex((line) =>\n expoVersionRegex.test(line)\n );\n\n const content = [\n ...lines.slice(0, index),\n ` ${expoVersionSnippet},`,\n ...lines.slice(index + 1),\n ];\n\n FileManagement.write(filename, content.join('\\n'));\n }\n }\n\n return props;\n });\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAIO,MAAMA,aAAoD,GAAIC,MAAM,IAAK;EAC9E,OAAO,IAAAC,+BAAgB,EAACD,MAAM,EAAE,MAAOE,KAAK,IAAK;IAC/C,MAAMC,kBAAkB,GAAI,mBAAkBC,oBAAY,GAAE;IAC5D,IAAIC,YAAY,GAAG,IAAIC,MAAM,CAACH,kBAAkB,CAAC;IACjD,MAAMI,QAAQ,GAAI,kDAAiD;IACnE,IAAIC,8BAAc,CAACC,MAAM,CAACF,QAAQ,CAAC,EAAE;MACnC,MAAMG,SAAS,GAAG,MAAMF,8BAAc,CAACG,IAAI,CAACJ,QAAQ,CAAC;MACrD,MAAMK,KAAK,GAAGF,SAAS,CAACG,KAAK,CAAC,IAAI,CAAC;MACnC,MAAMC,aAAa,GAAGJ,SAAS,CAACK,KAAK,CAACV,YAAY,CAAC;MACnD,MAAMW,gBAAgB,GAAG,qBAAqB;MAC9C,MAAMC,SAAS,GAAGP,SAAS,CAACK,KAAK,CAACC,gBAAgB,CAAC;MAEnD,IAAIC,SAAS,IAAI,CAACH,aAAa,EAAE;QAC/B,MAAMI,KAAK,GAAGN,KAAK,CAACO,SAAS,CAAEC,IAAI,IACjCJ,gBAAgB,CAACK,IAAI,CAACD,IAAI,CAAC,CAC5B;QAED,MAAME,OAAO,GAAG,CACd,GAAGV,KAAK,CAACW,KAAK,CAAC,CAAC,EAAEL,KAAK,CAAC,EACvB,KAAIf,kBAAmB,GAAE,EAC1B,GAAGS,KAAK,CAACW,KAAK,CAACL,KAAK,GAAG,CAAC,CAAC,CAC1B;QAEDV,8BAAc,CAACgB,KAAK,CAACjB,QAAQ,EAAEe,OAAO,CAACG,IAAI,CAAC,IAAI,CAAC,CAAC;MACpD;IACF;IAEA,OAAOvB,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withAppGoogleServices = void 0;
|
|
7
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
8
|
+
var _android = require("../helpers/constants/android");
|
|
9
|
+
const withAppGoogleServices = configOuter => {
|
|
10
|
+
return (0, _configPlugins.withAppBuildGradle)(configOuter, props => {
|
|
11
|
+
const regex = new RegExp(_android.CIO_APP_GOOGLE_SNIPPET);
|
|
12
|
+
const match = props.modResults.contents.match(regex);
|
|
13
|
+
if (!match) {
|
|
14
|
+
props.modResults.contents = props.modResults.contents.replace(_android.CIO_APP_APPLY_REGEX, `$1\n${_android.CIO_APP_GOOGLE_SNIPPET}`);
|
|
15
|
+
} else {
|
|
16
|
+
console.log('app/build.gradle snippet already exists. Skipping...');
|
|
17
|
+
}
|
|
18
|
+
return props;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.withAppGoogleServices = withAppGoogleServices;
|
|
22
|
+
//# sourceMappingURL=withAppGoogleServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withAppGoogleServices","configOuter","withAppBuildGradle","props","regex","RegExp","CIO_APP_GOOGLE_SNIPPET","match","modResults","contents","replace","CIO_APP_APPLY_REGEX","console","log"],"sources":["withAppGoogleServices.ts"],"sourcesContent":["import { ConfigPlugin, withAppBuildGradle } from '@expo/config-plugins';\n\nimport {\n CIO_APP_APPLY_REGEX,\n CIO_APP_GOOGLE_SNIPPET,\n} from '../helpers/constants/android';\nimport type { CustomerIOPluginOptionsAndroid } from '../types/cio-types';\n\nexport const withAppGoogleServices: ConfigPlugin<\n CustomerIOPluginOptionsAndroid\n> = (configOuter) => {\n return withAppBuildGradle(configOuter, (props) => {\n const regex = new RegExp(CIO_APP_GOOGLE_SNIPPET);\n const match = props.modResults.contents.match(regex);\n if (!match) {\n props.modResults.contents = props.modResults.contents.replace(\n CIO_APP_APPLY_REGEX,\n `$1\\n${CIO_APP_GOOGLE_SNIPPET}`\n );\n } else {\n console.log('app/build.gradle snippet already exists. Skipping...');\n }\n\n return props;\n });\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAMO,MAAMA,qBAEZ,GAAIC,WAAW,IAAK;EACnB,OAAO,IAAAC,iCAAkB,EAACD,WAAW,EAAGE,KAAK,IAAK;IAChD,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACC,+BAAsB,CAAC;IAChD,MAAMC,KAAK,GAAGJ,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACF,KAAK,CAACH,KAAK,CAAC;IACpD,IAAI,CAACG,KAAK,EAAE;MACVJ,KAAK,CAACK,UAAU,CAACC,QAAQ,GAAGN,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACC,OAAO,CAC3DC,4BAAmB,EAClB,OAAML,+BAAuB,EAAC,CAChC;IACH,CAAC,MAAM;MACLM,OAAO,CAACC,GAAG,CAAC,sDAAsD,CAAC;IACrE;IAEA,OAAOV,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withCIOAndroid = withCIOAndroid;
|
|
7
|
+
var _withAppGoogleServices = require("./withAppGoogleServices");
|
|
8
|
+
var _withGistMavenRepository = require("./withGistMavenRepository");
|
|
9
|
+
var _withGoogleServicesJSON = require("./withGoogleServicesJSON");
|
|
10
|
+
var _withProjectGoogleServices = require("./withProjectGoogleServices");
|
|
11
|
+
function withCIOAndroid(config, props) {
|
|
12
|
+
config = (0, _withGistMavenRepository.withGistMavenRepository)(config, props);
|
|
13
|
+
config = (0, _withProjectGoogleServices.withProjectGoogleServices)(config, props);
|
|
14
|
+
config = (0, _withAppGoogleServices.withAppGoogleServices)(config, props);
|
|
15
|
+
config = (0, _withGoogleServicesJSON.withGoogleServicesJSON)(config, props);
|
|
16
|
+
return config;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=withCIOAndroid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withCIOAndroid","config","props","withGistMavenRepository","withProjectGoogleServices","withAppGoogleServices","withGoogleServicesJSON"],"sources":["withCIOAndroid.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { CustomerIOPluginOptionsAndroid } from '../types/cio-types';\nimport { withAppGoogleServices } from './withAppGoogleServices';\nimport { withGistMavenRepository } from './withGistMavenRepository';\nimport { withGoogleServicesJSON } from './withGoogleServicesJSON';\nimport { withProjectGoogleServices } from './withProjectGoogleServices';\n\nexport function withCIOAndroid(\n config: ExpoConfig,\n props: CustomerIOPluginOptionsAndroid\n): ExpoConfig {\n config = withGistMavenRepository(config, props);\n config = withProjectGoogleServices(config, props);\n config = withAppGoogleServices(config, props);\n config = withGoogleServicesJSON(config, props);\n\n return config;\n}\n"],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AAEO,SAASA,cAAc,CAC5BC,MAAkB,EAClBC,KAAqC,EACzB;EACZD,MAAM,GAAG,IAAAE,gDAAuB,EAACF,MAAM,EAAEC,KAAK,CAAC;EAC/CD,MAAM,GAAG,IAAAG,oDAAyB,EAACH,MAAM,EAAEC,KAAK,CAAC;EACjDD,MAAM,GAAG,IAAAI,4CAAqB,EAACJ,MAAM,EAAEC,KAAK,CAAC;EAC7CD,MAAM,GAAG,IAAAK,8CAAsB,EAACL,MAAM,EAAEC,KAAK,CAAC;EAE9C,OAAOD,MAAM;AACf"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withGistMavenRepository = void 0;
|
|
7
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
8
|
+
var _android = require("../helpers/constants/android");
|
|
9
|
+
const withGistMavenRepository = configOuter => {
|
|
10
|
+
return (0, _configPlugins.withProjectBuildGradle)(configOuter, props => {
|
|
11
|
+
const targetMatch = props.modResults.contents.match(_android.CIO_GIST_MAVEN_REGEX);
|
|
12
|
+
if (!targetMatch) {
|
|
13
|
+
props.modResults.contents = props.modResults.contents.replace(_android.CIO_PROJECT_ALLPROJECTS_REGEX, `$1\n${_android.CIO_PROJECT_GIST_MAVEN_SNIPPET}`);
|
|
14
|
+
} else {
|
|
15
|
+
console.log('build.gradle snippet alreade exists. Skipping...');
|
|
16
|
+
}
|
|
17
|
+
return props;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.withGistMavenRepository = withGistMavenRepository;
|
|
21
|
+
//# sourceMappingURL=withGistMavenRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withGistMavenRepository","configOuter","withProjectBuildGradle","props","targetMatch","modResults","contents","match","CIO_GIST_MAVEN_REGEX","replace","CIO_PROJECT_ALLPROJECTS_REGEX","CIO_PROJECT_GIST_MAVEN_SNIPPET","console","log"],"sources":["withGistMavenRepository.ts"],"sourcesContent":["import { withProjectBuildGradle, ConfigPlugin } from '@expo/config-plugins';\n\nimport {\n CIO_GIST_MAVEN_REGEX,\n CIO_PROJECT_ALLPROJECTS_REGEX,\n CIO_PROJECT_GIST_MAVEN_SNIPPET,\n} from '../helpers/constants/android';\nimport type { CustomerIOPluginOptionsAndroid } from './../types/cio-types';\n\nexport const withGistMavenRepository: ConfigPlugin<\n CustomerIOPluginOptionsAndroid\n> = (configOuter) => {\n return withProjectBuildGradle(configOuter, (props) => {\n const targetMatch = props.modResults.contents.match(CIO_GIST_MAVEN_REGEX);\n if (!targetMatch) {\n props.modResults.contents = props.modResults.contents.replace(\n CIO_PROJECT_ALLPROJECTS_REGEX,\n `$1\\n${CIO_PROJECT_GIST_MAVEN_SNIPPET}`\n );\n } else {\n console.log('build.gradle snippet alreade exists. Skipping...');\n }\n\n return props;\n });\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAOO,MAAMA,uBAEZ,GAAIC,WAAW,IAAK;EACnB,OAAO,IAAAC,qCAAsB,EAACD,WAAW,EAAGE,KAAK,IAAK;IACpD,MAAMC,WAAW,GAAGD,KAAK,CAACE,UAAU,CAACC,QAAQ,CAACC,KAAK,CAACC,6BAAoB,CAAC;IACzE,IAAI,CAACJ,WAAW,EAAE;MAChBD,KAAK,CAACE,UAAU,CAACC,QAAQ,GAAGH,KAAK,CAACE,UAAU,CAACC,QAAQ,CAACG,OAAO,CAC3DC,sCAA6B,EAC5B,OAAMC,uCAA+B,EAAC,CACxC;IACH,CAAC,MAAM;MACLC,OAAO,CAACC,GAAG,CAAC,kDAAkD,CAAC;IACjE;IAEA,OAAOV,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withGoogleServicesJSON = void 0;
|
|
7
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
8
|
+
var _fileManagement = require("./../helpers/utils/fileManagement");
|
|
9
|
+
const withGoogleServicesJSON = (configOuter, cioProps) => {
|
|
10
|
+
return (0, _configPlugins.withProjectBuildGradle)(configOuter, props => {
|
|
11
|
+
const options = {
|
|
12
|
+
androidPath: props.modRequest.platformProjectRoot,
|
|
13
|
+
googleServicesFilePath: cioProps === null || cioProps === void 0 ? void 0 : cioProps.googleServicesFilePath
|
|
14
|
+
};
|
|
15
|
+
const {
|
|
16
|
+
androidPath,
|
|
17
|
+
googleServicesFilePath
|
|
18
|
+
} = options;
|
|
19
|
+
if (!_fileManagement.FileManagement.exists(`${androidPath}/app/google-services.json`)) {
|
|
20
|
+
if (googleServicesFilePath) {
|
|
21
|
+
try {
|
|
22
|
+
_fileManagement.FileManagement.copyFile(`${googleServicesFilePath}google-services.json`, `${androidPath}/app/google-services.json`);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.log(`There was an error copying your google-services.json file. You can copy it manually into ${androidPath}/app/`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
console.log(`File already exists: ${androidPath}/app/google-services.json. Skipping...`);
|
|
29
|
+
}
|
|
30
|
+
return props;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.withGoogleServicesJSON = withGoogleServicesJSON;
|
|
34
|
+
//# sourceMappingURL=withGoogleServicesJSON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withGoogleServicesJSON","configOuter","cioProps","withProjectBuildGradle","props","options","androidPath","modRequest","platformProjectRoot","googleServicesFilePath","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 googleServicesFilePath: cioProps?.googleServicesFilePath,\n };\n const { androidPath, googleServicesFilePath } = options;\n if (!FileManagement.exists(`${androidPath}/app/google-services.json`)) {\n if (googleServicesFilePath) {\n try {\n FileManagement.copyFile(\n `${googleServicesFilePath}google-services.json`,\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/`\n );\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,sBAAsB,EAAEP,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEO;IACpC,CAAC;IACD,MAAM;MAAEH,WAAW;MAAEG;IAAuB,CAAC,GAAGJ,OAAO;IACvD,IAAI,CAACK,8BAAc,CAACC,MAAM,CAAE,GAAEL,WAAY,2BAA0B,CAAC,EAAE;MACrE,IAAIG,sBAAsB,EAAE;QAC1B,IAAI;UACFC,8BAAc,CAACE,QAAQ,CACpB,GAAEH,sBAAuB,sBAAqB,EAC9C,GAAEH,WAAY,2BAA0B,CAC1C;QACH,CAAC,CAAC,OAAOO,CAAC,EAAE;UACVC,OAAO,CAACC,GAAG,CACR,4FAA2FT,WAAY,OAAM,CAC/G;QACH;MACF;IACF,CAAC,MAAM;MACLQ,OAAO,CAACC,GAAG,CACR,wBAAuBT,WAAY,wCAAuC,CAC5E;IACH;IAEA,OAAOF,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withProjectGoogleServices = void 0;
|
|
7
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
8
|
+
var _android = require("./../helpers/constants/android");
|
|
9
|
+
const withProjectGoogleServices = configOuter => {
|
|
10
|
+
return (0, _configPlugins.withProjectBuildGradle)(configOuter, props => {
|
|
11
|
+
const regex = new RegExp(_android.CIO_PROJECT_GOOGLE_SNIPPET);
|
|
12
|
+
const match = props.modResults.contents.match(regex);
|
|
13
|
+
if (!match) {
|
|
14
|
+
props.modResults.contents = props.modResults.contents.replace(_android.CIO_PROJECT_BUILDSCRIPTS_REGEX, `$1\n${_android.CIO_PROJECT_GOOGLE_SNIPPET}`);
|
|
15
|
+
}
|
|
16
|
+
return props;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
exports.withProjectGoogleServices = withProjectGoogleServices;
|
|
20
|
+
//# sourceMappingURL=withProjectGoogleServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withProjectGoogleServices","configOuter","withProjectBuildGradle","props","regex","RegExp","CIO_PROJECT_GOOGLE_SNIPPET","match","modResults","contents","replace","CIO_PROJECT_BUILDSCRIPTS_REGEX"],"sources":["withProjectGoogleServices.ts"],"sourcesContent":["import { ConfigPlugin, withProjectBuildGradle } from '@expo/config-plugins';\n\nimport {\n CIO_PROJECT_BUILDSCRIPTS_REGEX,\n CIO_PROJECT_GOOGLE_SNIPPET,\n} from './../helpers/constants/android';\nimport type { CustomerIOPluginOptionsAndroid } from './../types/cio-types';\n\nexport const withProjectGoogleServices: ConfigPlugin<\n CustomerIOPluginOptionsAndroid\n> = (configOuter) => {\n return withProjectBuildGradle(configOuter, (props) => {\n const regex = new RegExp(CIO_PROJECT_GOOGLE_SNIPPET);\n const match = props.modResults.contents.match(regex);\n if (!match) {\n props.modResults.contents = props.modResults.contents.replace(\n CIO_PROJECT_BUILDSCRIPTS_REGEX,\n `$1\\n${CIO_PROJECT_GOOGLE_SNIPPET}`\n );\n }\n\n return props;\n });\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAMO,MAAMA,yBAEZ,GAAIC,WAAW,IAAK;EACnB,OAAO,IAAAC,qCAAsB,EAACD,WAAW,EAAGE,KAAK,IAAK;IACpD,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACC,mCAA0B,CAAC;IACpD,MAAMC,KAAK,GAAGJ,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACF,KAAK,CAACH,KAAK,CAAC;IACpD,IAAI,CAACG,KAAK,EAAE;MACVJ,KAAK,CAACK,UAAU,CAACC,QAAQ,GAAGN,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACC,OAAO,CAC3DC,uCAA8B,EAC7B,OAAML,mCAA2B,EAAC,CACpC;IACH;IAEA,OAAOH,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CIO_PROJECT_GOOGLE_SNIPPET = exports.CIO_PROJECT_GIST_MAVEN_SNIPPET = exports.CIO_PROJECT_BUILDSCRIPTS_REGEX = exports.CIO_PROJECT_ALLPROJECTS_REGEX = exports.CIO_GIST_MAVEN_REGEX = exports.CIO_APP_GOOGLE_SNIPPET = exports.CIO_APP_APPLY_REGEX = void 0;
|
|
7
|
+
const CIO_PROJECT_BUILDSCRIPTS_REGEX = /(buildscript\s*\{(.|\n)*dependencies\s*\{)/;
|
|
8
|
+
exports.CIO_PROJECT_BUILDSCRIPTS_REGEX = CIO_PROJECT_BUILDSCRIPTS_REGEX;
|
|
9
|
+
const CIO_APP_APPLY_REGEX = /(apply plugin: "com.android.application")/;
|
|
10
|
+
exports.CIO_APP_APPLY_REGEX = CIO_APP_APPLY_REGEX;
|
|
11
|
+
const CIO_GIST_MAVEN_REGEX = /maven { url "https:\/\/maven.gist.build" }/;
|
|
12
|
+
exports.CIO_GIST_MAVEN_REGEX = CIO_GIST_MAVEN_REGEX;
|
|
13
|
+
const CIO_PROJECT_ALLPROJECTS_REGEX = /(allprojects\s*\{(.|\n)*repositories\s*\{)/;
|
|
14
|
+
exports.CIO_PROJECT_ALLPROJECTS_REGEX = CIO_PROJECT_ALLPROJECTS_REGEX;
|
|
15
|
+
const CIO_PROJECT_GIST_MAVEN_SNIPPET = ' maven { url "https://maven.gist.build" }';
|
|
16
|
+
exports.CIO_PROJECT_GIST_MAVEN_SNIPPET = CIO_PROJECT_GIST_MAVEN_SNIPPET;
|
|
17
|
+
const CIO_APP_GOOGLE_SNIPPET = 'apply plugin: "com.google.gms.google-services" // Google Services plugin';
|
|
18
|
+
exports.CIO_APP_GOOGLE_SNIPPET = CIO_APP_GOOGLE_SNIPPET;
|
|
19
|
+
const CIO_PROJECT_GOOGLE_SNIPPET = ' classpath "com.google.gms:google-services:4.3.13" // Google Services plugin';
|
|
20
|
+
exports.CIO_PROJECT_GOOGLE_SNIPPET = CIO_PROJECT_GOOGLE_SNIPPET;
|
|
21
|
+
//# sourceMappingURL=android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CIO_PROJECT_BUILDSCRIPTS_REGEX","CIO_APP_APPLY_REGEX","CIO_GIST_MAVEN_REGEX","CIO_PROJECT_ALLPROJECTS_REGEX","CIO_PROJECT_GIST_MAVEN_SNIPPET","CIO_APP_GOOGLE_SNIPPET","CIO_PROJECT_GOOGLE_SNIPPET"],"sources":["android.ts"],"sourcesContent":["export const CIO_PROJECT_BUILDSCRIPTS_REGEX =\n /(buildscript\\s*\\{(.|\\n)*dependencies\\s*\\{)/;\nexport const CIO_APP_APPLY_REGEX = /(apply plugin: \"com.android.application\")/;\nexport const CIO_GIST_MAVEN_REGEX =\n /maven { url \"https:\\/\\/maven.gist.build\" }/;\nexport const CIO_PROJECT_ALLPROJECTS_REGEX =\n /(allprojects\\s*\\{(.|\\n)*repositories\\s*\\{)/;\n\nexport const CIO_PROJECT_GIST_MAVEN_SNIPPET =\n ' maven { url \"https://maven.gist.build\" }';\nexport const CIO_APP_GOOGLE_SNIPPET =\n 'apply plugin: \"com.google.gms.google-services\" // Google Services plugin';\nexport const CIO_PROJECT_GOOGLE_SNIPPET =\n ' classpath \"com.google.gms:google-services:4.3.13\" // Google Services plugin';\n"],"mappings":";;;;;;AAAO,MAAMA,8BAA8B,GACzC,4CAA4C;AAAC;AACxC,MAAMC,mBAAmB,GAAG,2CAA2C;AAAC;AACxE,MAAMC,oBAAoB,GAC/B,4CAA4C;AAAC;AACxC,MAAMC,6BAA6B,GACxC,4CAA4C;AAAC;AAExC,MAAMC,8BAA8B,GACzC,kDAAkD;AAAC;AAC9C,MAAMC,sBAAsB,GACjC,2EAA2E;AAAC;AACvE,MAAMC,0BAA0B,GACrC,sFAAsF;AAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["globals.d.ts"],"sourcesContent":["declare module 'xcode' {\n interface xcode {\n project(projPath: string): any;\n }\n\n const xcode: xcode;\n export default xcode;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
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_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = exports.CIO_PODFILE_TARGET_NAMES_SNIPPET = exports.CIO_PODFILE_SNIPPET = exports.CIO_PODFILE_REGEX = exports.CIO_PODFILE_POST_INSTALL_SNIPPET = exports.CIO_PODFILE_POST_INSTALL_REGEX = exports.CIO_PODFILE_POST_INSTALL_FALLBACK_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
|
+
const LOCAL_PATH_TO_CIO_NSE_FILES = `node_modules/customerio-expo-plugin/src/helpers/native-files/ios`;
|
|
8
|
+
exports.LOCAL_PATH_TO_CIO_NSE_FILES = LOCAL_PATH_TO_CIO_NSE_FILES;
|
|
9
|
+
const IOS_DEPLOYMENT_TARGET = '13.0';
|
|
10
|
+
exports.IOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET;
|
|
11
|
+
const CIO_PODFILE_REGEX = /pod 'RCT-Folly'/;
|
|
12
|
+
exports.CIO_PODFILE_REGEX = CIO_PODFILE_REGEX;
|
|
13
|
+
const CIO_CIO_TARGET_REGEX = /cio_target_names/;
|
|
14
|
+
exports.CIO_CIO_TARGET_REGEX = CIO_CIO_TARGET_REGEX;
|
|
15
|
+
const CIO_PODFILE_NOTIFICATION_REGEX = /target 'NotificationService' do/;
|
|
16
|
+
exports.CIO_PODFILE_NOTIFICATION_REGEX = CIO_PODFILE_NOTIFICATION_REGEX;
|
|
17
|
+
const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;
|
|
18
|
+
exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = GROUP_IDENTIFIER_TEMPLATE_REGEX;
|
|
19
|
+
const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;
|
|
20
|
+
exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = BUNDLE_SHORT_VERSION_TEMPLATE_REGEX;
|
|
21
|
+
const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;
|
|
22
|
+
exports.BUNDLE_VERSION_TEMPLATE_REGEX = BUNDLE_VERSION_TEMPLATE_REGEX;
|
|
23
|
+
const CIO_PODFILE_POST_INSTALL_REGEX = /post_install do \|installer\|/;
|
|
24
|
+
exports.CIO_PODFILE_POST_INSTALL_REGEX = CIO_PODFILE_POST_INSTALL_REGEX;
|
|
25
|
+
const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = /(- \(BOOL\)application:\(UIApplication \*\)application didFinishLaunchingWithOptions:\(NSDictionary \*\)launchOptions(\s|\n)*?\{)((.|\n)*)\[super(\s)application:application(\s)didFinishLaunchingWithOptions:launchOptions\];/;
|
|
26
|
+
exports.CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = CIO_DIDFINISHLAUNCHINGMETHOD_REGEX;
|
|
27
|
+
const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = /return \[super application:application didFailToRegisterForRemoteNotificationsWithError:error\];/;
|
|
28
|
+
exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX;
|
|
29
|
+
const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX = /(- \(void\)application:\(UIApplication \*\)application didFailToRegisterForRemoteNotificationsWithError:\(NSError \*\)error(\s|\n)*?\{)(.|\n){2}.*\n\}/;
|
|
30
|
+
exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX = CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX;
|
|
31
|
+
const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX = /return \[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken\];/;
|
|
32
|
+
exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX = CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX;
|
|
33
|
+
const CIO_APPDELEGATEDECLARATION_REGEX = /@implementation AppDelegate(.|\n)/;
|
|
34
|
+
exports.CIO_APPDELEGATEDECLARATION_REGEX = CIO_APPDELEGATEDECLARATION_REGEX;
|
|
35
|
+
const CIO_APPDELEGATEHEADER_REGEX = /@interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate>/;
|
|
36
|
+
exports.CIO_APPDELEGATEHEADER_REGEX = CIO_APPDELEGATEHEADER_REGEX;
|
|
37
|
+
const DEFAULT_BUNDLE_VERSION = '1';
|
|
38
|
+
exports.DEFAULT_BUNDLE_VERSION = DEFAULT_BUNDLE_VERSION;
|
|
39
|
+
const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';
|
|
40
|
+
exports.DEFAULT_BUNDLE_SHORT_VERSION = DEFAULT_BUNDLE_SHORT_VERSION;
|
|
41
|
+
const CIO_TARGET_NAME = 'CustomerIOSDK';
|
|
42
|
+
exports.CIO_TARGET_NAME = CIO_TARGET_NAME;
|
|
43
|
+
const CIO_NOTIFICATION_TARGET_NAME = 'NotificationService';
|
|
44
|
+
exports.CIO_NOTIFICATION_TARGET_NAME = CIO_NOTIFICATION_TARGET_NAME;
|
|
45
|
+
const CIO_APPDELEGATEHEADER_SNIPPET = `
|
|
46
|
+
#import <UserNotifications/UserNotifications.h>
|
|
47
|
+
|
|
48
|
+
@interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate, UNUserNotificationCenterDelegate>
|
|
49
|
+
`;
|
|
50
|
+
exports.CIO_APPDELEGATEHEADER_SNIPPET = CIO_APPDELEGATEHEADER_SNIPPET;
|
|
51
|
+
const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `
|
|
52
|
+
CIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];
|
|
53
|
+
`;
|
|
54
|
+
exports.CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET;
|
|
55
|
+
const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `
|
|
56
|
+
[pnHandlerObj application:application error:error];
|
|
57
|
+
`;
|
|
58
|
+
exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET;
|
|
59
|
+
const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `
|
|
60
|
+
return [pnHandlerObj application:application deviceToken:deviceToken];
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
// Configure Customerio push notifications SDK by adding to application:didFinishLaunchingWithOptions: delegate method
|
|
64
|
+
// From Braze docs: https://www.customer.io/docs/sdk/react-native/push/#obj-c-push
|
|
65
|
+
exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET;
|
|
66
|
+
const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `
|
|
67
|
+
// Register for push notifications
|
|
68
|
+
[pnHandlerObj registerPushNotification:self];
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
// Enable push handling - notification response
|
|
72
|
+
exports.CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET;
|
|
73
|
+
const CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = `
|
|
74
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {
|
|
75
|
+
[pnHandlerObj userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
|
|
76
|
+
}`;
|
|
77
|
+
|
|
78
|
+
// Foreground push handling
|
|
79
|
+
exports.CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET;
|
|
80
|
+
const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `
|
|
81
|
+
// show push when the app is in foreground
|
|
82
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification:(UNNotification* )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
|
|
83
|
+
completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);
|
|
84
|
+
}`;
|
|
85
|
+
exports.CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET;
|
|
86
|
+
const CIO_PODFILE_NOTIFICATION_SNIPPET = `
|
|
87
|
+
target '${CIO_NOTIFICATION_TARGET_NAME}' do
|
|
88
|
+
pod 'CustomerIO/MessagingPushAPN', '~> 1.2.0-alpha.3'
|
|
89
|
+
end`;
|
|
90
|
+
exports.CIO_PODFILE_NOTIFICATION_SNIPPET = CIO_PODFILE_NOTIFICATION_SNIPPET;
|
|
91
|
+
const CIO_PODFILE_SNIPPET = `
|
|
92
|
+
pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
|
|
93
|
+
pod 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec'
|
|
94
|
+
pod 'CustomerIO/MessagingPushAPN', '~> 1.2.0-alpha.3'`;
|
|
95
|
+
exports.CIO_PODFILE_SNIPPET = CIO_PODFILE_SNIPPET;
|
|
96
|
+
const CIO_PODFILE_TARGET_NAMES_SNIPPET = `
|
|
97
|
+
cio_target_names = [
|
|
98
|
+
'CustomerIOTracking',
|
|
99
|
+
'CustomerIOCommon',
|
|
100
|
+
'CustomerIOMessagingPushAPN',
|
|
101
|
+
'CustomerIOMessagingPush'
|
|
102
|
+
]`;
|
|
103
|
+
exports.CIO_PODFILE_TARGET_NAMES_SNIPPET = CIO_PODFILE_TARGET_NAMES_SNIPPET;
|
|
104
|
+
const CIO_PODFILE_POST_INSTALL_SNIPPET = `
|
|
105
|
+
installer.pods_project.targets.each do |target|
|
|
106
|
+
if cio_target_names.include? target.name
|
|
107
|
+
puts "Modifying target #{target.name}"
|
|
108
|
+
|
|
109
|
+
target.build_configurations.each do |config|
|
|
110
|
+
puts "Setting build config settings for #{target.name}"
|
|
111
|
+
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end`;
|
|
115
|
+
exports.CIO_PODFILE_POST_INSTALL_SNIPPET = CIO_PODFILE_POST_INSTALL_SNIPPET;
|
|
116
|
+
const CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = `
|
|
117
|
+
cio_target_names = [
|
|
118
|
+
'CustomerIOTracking',
|
|
119
|
+
'CustomerIOCommon',
|
|
120
|
+
'CustomerIOMessagingPushAPN',
|
|
121
|
+
'CustomerIOMessagingPush'
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
post_install do |installer|
|
|
125
|
+
|
|
126
|
+
installer.pods_project.targets.each do |target|
|
|
127
|
+
if cio_target_names.include? target.name
|
|
128
|
+
puts "Modifying target #{target.name}"
|
|
129
|
+
|
|
130
|
+
target.build_configurations.each do |config|
|
|
131
|
+
puts "Setting build config settings for #{target.name}"
|
|
132
|
+
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
react_native_post_install(installer)
|
|
137
|
+
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
138
|
+
end`;
|
|
139
|
+
exports.CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET;
|
|
140
|
+
//# sourceMappingURL=ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LOCAL_PATH_TO_CIO_NSE_FILES","IOS_DEPLOYMENT_TARGET","CIO_PODFILE_REGEX","CIO_CIO_TARGET_REGEX","CIO_PODFILE_NOTIFICATION_REGEX","GROUP_IDENTIFIER_TEMPLATE_REGEX","BUNDLE_SHORT_VERSION_TEMPLATE_REGEX","BUNDLE_VERSION_TEMPLATE_REGEX","CIO_PODFILE_POST_INSTALL_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_NOTIFICATION_SNIPPET","CIO_PODFILE_SNIPPET","CIO_PODFILE_TARGET_NAMES_SNIPPET","CIO_PODFILE_POST_INSTALL_SNIPPET","CIO_PODFILE_POST_INSTALL_FALLBACK_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_PODFILE_REGEX = /pod 'RCT-Folly'/;\nexport const CIO_CIO_TARGET_REGEX = /cio_target_names/;\nexport const CIO_PODFILE_NOTIFICATION_REGEX = /target 'NotificationService' do/;\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_PODFILE_POST_INSTALL_REGEX = /post_install do \\|installer\\|/;\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\n// Configure Customerio push notifications SDK by adding to application:didFinishLaunchingWithOptions: delegate method\n// From Braze docs: https://www.customer.io/docs/sdk/react-native/push/#obj-c-push\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_NOTIFICATION_SNIPPET = `\ntarget '${CIO_NOTIFICATION_TARGET_NAME}' do\n pod 'CustomerIO/MessagingPushAPN', '~> 1.2.0-alpha.3'\nend`;\nexport const CIO_PODFILE_SNIPPET = `\n pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'\n pod 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec'\n pod 'CustomerIO/MessagingPushAPN', '~> 1.2.0-alpha.3'`;\nexport const CIO_PODFILE_TARGET_NAMES_SNIPPET = `\n cio_target_names = [\n 'CustomerIOTracking',\n 'CustomerIOCommon',\n 'CustomerIOMessagingPushAPN',\n 'CustomerIOMessagingPush'\n ]`;\nexport const CIO_PODFILE_POST_INSTALL_SNIPPET = `\n installer.pods_project.targets.each do |target|\n if cio_target_names.include? target.name\n puts \"Modifying target #{target.name}\"\n\n target.build_configurations.each do |config|\n puts \"Setting build config settings for #{target.name}\"\n config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'\n end\n end\n end`;\nexport const CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = `\ncio_target_names = [\n 'CustomerIOTracking',\n 'CustomerIOCommon',\n 'CustomerIOMessagingPushAPN',\n 'CustomerIOMessagingPush'\n]\n\npost_install do |installer|\n\n installer.pods_project.targets.each do |target|\n if cio_target_names.include? target.name\n puts \"Modifying target #{target.name}\"\n\n target.build_configurations.each do |config|\n puts \"Setting build config settings for #{target.name}\"\n config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'\n end\n end\n end\n react_native_post_install(installer)\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\nend`;\n"],"mappings":";;;;;;AAAO,MAAMA,2BAA2B,GAAI,kEAAiE;AAAC;AACvG,MAAMC,qBAAqB,GAAG,MAAM;AAAC;AACrC,MAAMC,iBAAiB,GAAG,iBAAiB;AAAC;AAC5C,MAAMC,oBAAoB,GAAG,kBAAkB;AAAC;AAChD,MAAMC,8BAA8B,GAAG,iCAAiC;AAAC;AACzE,MAAMC,+BAA+B,GAAG,wBAAwB;AAAC;AACjE,MAAMC,mCAAmC,GAAG,4BAA4B;AAAC;AACzE,MAAMC,6BAA6B,GAAG,sBAAsB;AAAC;AAC7D,MAAMC,8BAA8B,GAAG,+BAA+B;AAAC;AACvE,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;;AAED;AACA;AAAA;AACO,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,gCAAgC,GAAI;AACjD,UAAUR,4BAA6B;AACvC;AACA,IAAI;AAAC;AACE,MAAMS,mBAAmB,GAAI;AACpC;AACA;AACA,wDAAwD;AAAC;AAClD,MAAMC,gCAAgC,GAAI;AACjD;AACA;AACA;AACA;AACA;AACA,IAAI;AAAC;AACE,MAAMC,gCAAgC,GAAI;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AAAC;AACF,MAAMC,yCAAyC,GAAI;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<key>CFBundleDevelopmentRegion</key>
|
|
10
10
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
11
11
|
<key>CFBundleDisplayName</key>
|
|
12
|
-
<string>
|
|
12
|
+
<string>NotificationServiceExtension</string>
|
|
13
13
|
<key>CFBundleExecutable</key>
|
|
14
14
|
<string>$(EXECUTABLE_NAME)</string>
|
|
15
15
|
<key>CFBundleIdentifier</key>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<key>NSExtensionPointIdentifier</key>
|
|
26
26
|
<string>com.apple.usernotifications.service</string>
|
|
27
27
|
<key>NSExtensionPrincipalClass</key>
|
|
28
|
-
<string>
|
|
28
|
+
<string>NotificationService</string>
|
|
29
29
|
</dict>
|
|
30
30
|
</dict>
|
|
31
31
|
</plist>
|
|
File without changes
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
#import "
|
|
3
|
-
|
|
4
|
-
// Import "Your-target-name-Swift.h" file
|
|
5
|
-
#import "CIONotificationService-Swift.h"
|
|
2
|
+
#import "NotificationService.h"
|
|
3
|
+
#import "NotificationService-Swift.h"
|
|
6
4
|
|
|
7
5
|
@interface NotificationService ()
|
|
8
6
|
|
|
@@ -14,7 +12,6 @@
|
|
|
14
12
|
@implementation NotificationService
|
|
15
13
|
|
|
16
14
|
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
|
|
17
|
-
// MARK: - CIO-TECH-ASSISTANCE
|
|
18
15
|
NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
|
|
19
16
|
[cioManagerObj didReceive:request withContentHandler:contentHandler];
|
|
20
17
|
}
|
|
@@ -22,7 +19,6 @@
|
|
|
22
19
|
- (void)serviceExtensionTimeWillExpire {
|
|
23
20
|
// Called just before the extension will be terminated by the system.
|
|
24
21
|
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
|
|
25
|
-
// MARK: - CIO-TECH-ASSISTANCE
|
|
26
22
|
NotificationServiceCioManager* cioManagerObj = [[NotificationServiceCioManager alloc] init];
|
|
27
23
|
[cioManagerObj serviceExtensionTimeWillExpire];
|
|
28
24
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PushNotification.swift
|
|
3
|
-
// testandroidapp
|
|
4
|
-
//
|
|
5
|
-
// Created by Segun Xtreem on 10/09/2022.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
1
|
import Foundation
|
|
9
2
|
import CioMessagingPushAPN
|
|
10
3
|
import CioTracking
|
|
@@ -16,12 +9,11 @@ public class CIOAppPushNotificationsHandler : NSObject {
|
|
|
16
9
|
|
|
17
10
|
public override init() {}
|
|
18
11
|
|
|
19
|
-
// MARK: - ObjCNEW
|
|
20
12
|
@objc(registerPushNotification:)
|
|
21
13
|
public func registerPushNotification(withNotificationDelegate notificationDelegate: UNUserNotificationCenterDelegate) {
|
|
22
14
|
|
|
23
15
|
let center = UNUserNotificationCenter.current()
|
|
24
|
-
center.delegate = notificationDelegate
|
|
16
|
+
center.delegate = notificationDelegate
|
|
25
17
|
center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in
|
|
26
18
|
if error == nil{
|
|
27
19
|
DispatchQueue.main.async {
|
|
@@ -41,7 +33,6 @@ public class CIOAppPushNotificationsHandler : NSObject {
|
|
|
41
33
|
MessagingPush.shared.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
// MARK: - ObjCNEW
|
|
45
36
|
@objc(userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:)
|
|
46
37
|
public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
|
47
38
|
let handled = MessagingPush.shared.userNotificationCenter(center, didReceive: response,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.injectCodeByLineNumber = injectCodeByLineNumber;
|
|
7
|
+
exports.injectCodeByMultiLineRegex = injectCodeByMultiLineRegex;
|
|
8
|
+
exports.injectCodeByMultiLineRegexAndReplaceLine = injectCodeByMultiLineRegexAndReplaceLine;
|
|
9
|
+
exports.injectCodeByRegex = injectCodeByRegex;
|
|
10
|
+
function injectCodeByRegex(fileContent, lineRegex, snippet) {
|
|
11
|
+
const lines = fileContent.split('\n');
|
|
12
|
+
const index = lines.findIndex(line => lineRegex.test(line));
|
|
13
|
+
let content = lines;
|
|
14
|
+
if (index > -1) {
|
|
15
|
+
content = [...lines.slice(0, index), snippet, ...lines.slice(index)];
|
|
16
|
+
}
|
|
17
|
+
return content;
|
|
18
|
+
}
|
|
19
|
+
function injectCodeByMultiLineRegex(fileContent, lineRegex, snippet) {
|
|
20
|
+
return fileContent.replace(lineRegex, `$&\n${snippet}`);
|
|
21
|
+
}
|
|
22
|
+
function injectCodeByMultiLineRegexAndReplaceLine(fileContent, lineRegex, snippet) {
|
|
23
|
+
return fileContent.replace(lineRegex, `${snippet}`);
|
|
24
|
+
}
|
|
25
|
+
function injectCodeByLineNumber(fileContent, index, snippet) {
|
|
26
|
+
const lines = fileContent.split('\n');
|
|
27
|
+
let content = lines;
|
|
28
|
+
if (index > -1) {
|
|
29
|
+
content = [...lines.slice(0, index), snippet, ...lines.slice(index)];
|
|
30
|
+
}
|
|
31
|
+
return content;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=codeInjection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["injectCodeByRegex","fileContent","lineRegex","snippet","lines","split","index","findIndex","line","test","content","slice","injectCodeByMultiLineRegex","replace","injectCodeByMultiLineRegexAndReplaceLine","injectCodeByLineNumber"],"sources":["codeInjection.ts"],"sourcesContent":["export function injectCodeByRegex(\n fileContent: string,\n lineRegex: RegExp,\n snippet: string\n) {\n const lines = fileContent.split('\\n');\n const index = lines.findIndex((line) => lineRegex.test(line));\n let content: string[] = lines;\n\n if (index > -1) {\n content = [...lines.slice(0, index), snippet, ...lines.slice(index)];\n }\n\n return content;\n}\n\nexport function injectCodeByMultiLineRegex(\n fileContent: string,\n lineRegex: RegExp,\n snippet: string\n) {\n return fileContent.replace(lineRegex, `$&\\n${snippet}`);\n}\n\nexport function injectCodeByMultiLineRegexAndReplaceLine(\n fileContent: string,\n lineRegex: RegExp,\n snippet: string\n) {\n return fileContent.replace(lineRegex, `${snippet}`);\n}\n\nexport function injectCodeByLineNumber(\n fileContent: string,\n index: number,\n snippet: string\n) {\n const lines = fileContent.split('\\n');\n let content: string[] = lines;\n\n if (index > -1) {\n content = [...lines.slice(0, index), snippet, ...lines.slice(index)];\n }\n\n return content;\n}\n"],"mappings":";;;;;;;;;AAAO,SAASA,iBAAiB,CAC/BC,WAAmB,EACnBC,SAAiB,EACjBC,OAAe,EACf;EACA,MAAMC,KAAK,GAAGH,WAAW,CAACI,KAAK,CAAC,IAAI,CAAC;EACrC,MAAMC,KAAK,GAAGF,KAAK,CAACG,SAAS,CAAEC,IAAI,IAAKN,SAAS,CAACO,IAAI,CAACD,IAAI,CAAC,CAAC;EAC7D,IAAIE,OAAiB,GAAGN,KAAK;EAE7B,IAAIE,KAAK,GAAG,CAAC,CAAC,EAAE;IACdI,OAAO,GAAG,CAAC,GAAGN,KAAK,CAACO,KAAK,CAAC,CAAC,EAAEL,KAAK,CAAC,EAAEH,OAAO,EAAE,GAAGC,KAAK,CAACO,KAAK,CAACL,KAAK,CAAC,CAAC;EACtE;EAEA,OAAOI,OAAO;AAChB;AAEO,SAASE,0BAA0B,CACxCX,WAAmB,EACnBC,SAAiB,EACjBC,OAAe,EACf;EACA,OAAOF,WAAW,CAACY,OAAO,CAACX,SAAS,EAAG,OAAMC,OAAQ,EAAC,CAAC;AACzD;AAEO,SAASW,wCAAwC,CACtDb,WAAmB,EACnBC,SAAiB,EACjBC,OAAe,EACf;EACA,OAAOF,WAAW,CAACY,OAAO,CAACX,SAAS,EAAG,GAAEC,OAAQ,EAAC,CAAC;AACrD;AAEO,SAASY,sBAAsB,CACpCd,WAAmB,EACnBK,KAAa,EACbH,OAAe,EACf;EACA,MAAMC,KAAK,GAAGH,WAAW,CAACI,KAAK,CAAC,IAAI,CAAC;EACrC,IAAIK,OAAiB,GAAGN,KAAK;EAE7B,IAAIE,KAAK,GAAG,CAAC,CAAC,EAAE;IACdI,OAAO,GAAG,CAAC,GAAGN,KAAK,CAACO,KAAK,CAAC,CAAC,EAAEL,KAAK,CAAC,EAAEH,OAAO,EAAE,GAAGC,KAAK,CAACO,KAAK,CAACL,KAAK,CAAC,CAAC;EACtE;EAEA,OAAOI,OAAO;AAChB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FileManagement = void 0;
|
|
7
|
+
var _fs = require("fs");
|
|
8
|
+
class FileManagement {
|
|
9
|
+
static async read(path) {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
(0, _fs.readFile)(path, 'utf8', (err, data) => {
|
|
12
|
+
if (err || !data) {
|
|
13
|
+
reject(err);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
resolve(data);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
static async write(path, contents) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
(0, _fs.writeFile)(path, contents, 'utf8', err => {
|
|
23
|
+
if (err) {
|
|
24
|
+
reject(err);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
static async append(path, contents) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
(0, _fs.appendFile)(path, contents, 'utf8', err => {
|
|
34
|
+
if (err) {
|
|
35
|
+
reject(err);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
resolve();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
static exists(path) {
|
|
43
|
+
return (0, _fs.existsSync)(path);
|
|
44
|
+
}
|
|
45
|
+
static copyFile(src, dest) {
|
|
46
|
+
try {
|
|
47
|
+
(0, _fs.copyFileSync)(src, dest);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.log(`Error copying file from ${src} to ${dest}: `, err);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static mkdir(path, options) {
|
|
53
|
+
try {
|
|
54
|
+
(0, _fs.mkdirSync)(path, options);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.log(`Error creating directory ${path}: `, err);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
static writeFile(path, data) {
|
|
60
|
+
try {
|
|
61
|
+
(0, _fs.writeFileSync)(path, data);
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.log(`Error writing to file ${path}: `, err);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
static readFile(path) {
|
|
67
|
+
try {
|
|
68
|
+
return (0, _fs.readFileSync)(path, 'utf-8');
|
|
69
|
+
} catch (err) {
|
|
70
|
+
console.log(`Error reading file ${path}: `, err);
|
|
71
|
+
}
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.FileManagement = FileManagement;
|
|
76
|
+
//# sourceMappingURL=fileManagement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FileManagement","read","path","Promise","resolve","reject","readFile","err","data","write","contents","writeFile","append","appendFile","exists","existsSync","copyFile","src","dest","copyFileSync","console","log","mkdir","options","mkdirSync","writeFileSync","readFileSync"],"sources":["fileManagement.ts"],"sourcesContent":["import {\n readFile,\n writeFile,\n appendFile,\n existsSync,\n copyFileSync,\n mkdirSync,\n writeFileSync,\n readFileSync,\n MakeDirectoryOptions,\n} from 'fs';\n\nexport class FileManagement {\n static async read(path: string): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n readFile(path, 'utf8', (err, data) => {\n if (err || !data) {\n reject(err);\n return;\n }\n resolve(data);\n });\n });\n }\n\n static async write(path: string, contents: string): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n writeFile(path, contents, 'utf8', (err) => {\n if (err) {\n reject(err);\n return;\n }\n resolve();\n });\n });\n }\n\n static async append(path: string, contents: string): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n appendFile(path, contents, 'utf8', (err) => {\n if (err) {\n reject(err);\n return;\n }\n resolve();\n });\n });\n }\n\n static exists(path: string) {\n return existsSync(path);\n }\n\n static copyFile(src: string, dest: string) {\n try {\n copyFileSync(src, dest);\n } catch (err) {\n console.log(`Error copying file from ${src} to ${dest}: `, err);\n }\n }\n\n static mkdir(path: string, options: MakeDirectoryOptions) {\n try {\n mkdirSync(path, options);\n } catch (err) {\n console.log(`Error creating directory ${path}: `, err);\n }\n }\n\n static writeFile(path: string, data: string) {\n try {\n writeFileSync(path, data);\n } catch (err) {\n console.log(`Error writing to file ${path}: `, err);\n }\n }\n\n static readFile(path: string) {\n try {\n return readFileSync(path, 'utf-8');\n } catch (err) {\n console.log(`Error reading file ${path}: `, err);\n }\n\n return '';\n }\n}\n"],"mappings":";;;;;;AAAA;AAYO,MAAMA,cAAc,CAAC;EAC1B,aAAaC,IAAI,CAACC,IAAY,EAAmB;IAC/C,OAAO,IAAIC,OAAO,CAAS,CAACC,OAAO,EAAEC,MAAM,KAAK;MAC9C,IAAAC,YAAQ,EAACJ,IAAI,EAAE,MAAM,EAAE,CAACK,GAAG,EAAEC,IAAI,KAAK;QACpC,IAAID,GAAG,IAAI,CAACC,IAAI,EAAE;UAChBH,MAAM,CAACE,GAAG,CAAC;UACX;QACF;QACAH,OAAO,CAACI,IAAI,CAAC;MACf,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEA,aAAaC,KAAK,CAACP,IAAY,EAAEQ,QAAgB,EAAiB;IAChE,OAAO,IAAIP,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;MAC5C,IAAAM,aAAS,EAACT,IAAI,EAAEQ,QAAQ,EAAE,MAAM,EAAGH,GAAG,IAAK;QACzC,IAAIA,GAAG,EAAE;UACPF,MAAM,CAACE,GAAG,CAAC;UACX;QACF;QACAH,OAAO,EAAE;MACX,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEA,aAAaQ,MAAM,CAACV,IAAY,EAAEQ,QAAgB,EAAiB;IACjE,OAAO,IAAIP,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;MAC5C,IAAAQ,cAAU,EAACX,IAAI,EAAEQ,QAAQ,EAAE,MAAM,EAAGH,GAAG,IAAK;QAC1C,IAAIA,GAAG,EAAE;UACPF,MAAM,CAACE,GAAG,CAAC;UACX;QACF;QACAH,OAAO,EAAE;MACX,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEA,OAAOU,MAAM,CAACZ,IAAY,EAAE;IAC1B,OAAO,IAAAa,cAAU,EAACb,IAAI,CAAC;EACzB;EAEA,OAAOc,QAAQ,CAACC,GAAW,EAAEC,IAAY,EAAE;IACzC,IAAI;MACF,IAAAC,gBAAY,EAACF,GAAG,EAAEC,IAAI,CAAC;IACzB,CAAC,CAAC,OAAOX,GAAG,EAAE;MACZa,OAAO,CAACC,GAAG,CAAE,2BAA0BJ,GAAI,OAAMC,IAAK,IAAG,EAAEX,GAAG,CAAC;IACjE;EACF;EAEA,OAAOe,KAAK,CAACpB,IAAY,EAAEqB,OAA6B,EAAE;IACxD,IAAI;MACF,IAAAC,aAAS,EAACtB,IAAI,EAAEqB,OAAO,CAAC;IAC1B,CAAC,CAAC,OAAOhB,GAAG,EAAE;MACZa,OAAO,CAACC,GAAG,CAAE,4BAA2BnB,IAAK,IAAG,EAAEK,GAAG,CAAC;IACxD;EACF;EAEA,OAAOI,SAAS,CAACT,IAAY,EAAEM,IAAY,EAAE;IAC3C,IAAI;MACF,IAAAiB,iBAAa,EAACvB,IAAI,EAAEM,IAAI,CAAC;IAC3B,CAAC,CAAC,OAAOD,GAAG,EAAE;MACZa,OAAO,CAACC,GAAG,CAAE,yBAAwBnB,IAAK,IAAG,EAAEK,GAAG,CAAC;IACrD;EACF;EAEA,OAAOD,QAAQ,CAACJ,IAAY,EAAE;IAC5B,IAAI;MACF,OAAO,IAAAwB,gBAAY,EAACxB,IAAI,EAAE,OAAO,CAAC;IACpC,CAAC,CAAC,OAAOK,GAAG,EAAE;MACZa,OAAO,CAACC,GAAG,CAAE,sBAAqBnB,IAAK,IAAG,EAAEK,GAAG,CAAC;IAClD;IAEA,OAAO,EAAE;EACX;AACF;AAAC"}
|