customerio-expo-plugin 0.0.4 → 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/lib/commonjs/android/withAppGoogleServices.js +16 -0
  2. package/lib/commonjs/android/withAppGoogleServices.js.map +1 -0
  3. package/lib/commonjs/android/withCIOAndroid.js +18 -0
  4. package/lib/commonjs/android/withCIOAndroid.js.map +1 -0
  5. package/lib/commonjs/android/withGistMavenRepository.js +16 -0
  6. package/lib/commonjs/android/withGistMavenRepository.js.map +1 -0
  7. package/lib/commonjs/android/withGoogleServicesJSON.js +30 -0
  8. package/lib/commonjs/android/withGoogleServicesJSON.js.map +1 -0
  9. package/lib/commonjs/android/withProjectGoogleServices.js +16 -0
  10. package/lib/commonjs/android/withProjectGoogleServices.js.map +1 -0
  11. package/lib/commonjs/helpers/constants/android.js +19 -0
  12. package/lib/commonjs/helpers/constants/android.js.map +1 -0
  13. package/lib/commonjs/helpers/constants/globals.d.js +2 -0
  14. package/lib/commonjs/helpers/constants/globals.d.js.map +1 -0
  15. package/lib/commonjs/helpers/constants/ios.js +138 -0
  16. package/lib/commonjs/helpers/constants/ios.js.map +1 -0
  17. package/{build/helpers → lib/commonjs/helpers/native-files}/ios/CIONotificationService-Info.plist +0 -0
  18. package/{build/helpers → lib/commonjs/helpers/native-files}/ios/CIONotificationService.h +0 -0
  19. package/{build/helpers → lib/commonjs/helpers/native-files}/ios/CIONotificationService.m +0 -0
  20. package/{build/helpers → lib/commonjs/helpers/native-files}/ios/CIONotificationService.swift +0 -0
  21. package/{build/helpers → lib/commonjs/helpers/native-files}/ios/PushNotification.swift +0 -0
  22. package/lib/commonjs/helpers/utils/codeInjection.js +33 -0
  23. package/lib/commonjs/helpers/utils/codeInjection.js.map +1 -0
  24. package/lib/commonjs/helpers/utils/fileManagement.js +44 -0
  25. package/lib/commonjs/helpers/utils/fileManagement.js.map +1 -0
  26. package/lib/commonjs/helpers/utils/injectCIOPodfileCode.js +32 -0
  27. package/lib/commonjs/helpers/utils/injectCIOPodfileCode.js.map +1 -0
  28. package/lib/commonjs/index.js +17 -0
  29. package/lib/commonjs/index.js.map +1 -0
  30. package/lib/commonjs/ios/withAppDelegateModifications.js +76 -0
  31. package/lib/commonjs/ios/withAppDelegateModifications.js.map +1 -0
  32. package/lib/commonjs/ios/withAppDelegateXcodeProject.js +96 -0
  33. package/lib/commonjs/ios/withAppDelegateXcodeProject.js.map +1 -0
  34. package/lib/commonjs/ios/withCIOIos.js +18 -0
  35. package/lib/commonjs/ios/withCIOIos.js.map +1 -0
  36. package/lib/commonjs/ios/withNotificationsXcodeProject.js +157 -0
  37. package/lib/commonjs/ios/withNotificationsXcodeProject.js.map +1 -0
  38. package/lib/commonjs/ios/withXcodeProject.js +28 -0
  39. package/lib/commonjs/ios/withXcodeProject.js.map +1 -0
  40. package/lib/commonjs/types/cio-types.js +15 -0
  41. package/lib/commonjs/types/cio-types.js.map +1 -0
  42. package/lib/module/android/withAppGoogleServices.js +9 -0
  43. package/lib/module/android/withAppGoogleServices.js.map +1 -0
  44. package/lib/module/android/withCIOAndroid.js +12 -0
  45. package/lib/module/android/withCIOAndroid.js.map +1 -0
  46. package/lib/module/android/withGistMavenRepository.js +9 -0
  47. package/lib/module/android/withGistMavenRepository.js.map +1 -0
  48. package/lib/module/android/withGoogleServicesJSON.js +23 -0
  49. package/lib/module/android/withGoogleServicesJSON.js.map +1 -0
  50. package/lib/module/android/withProjectGoogleServices.js +9 -0
  51. package/lib/module/android/withProjectGoogleServices.js.map +1 -0
  52. package/lib/module/helpers/constants/android.js +7 -0
  53. package/lib/module/helpers/constants/android.js.map +1 -0
  54. package/lib/module/helpers/constants/globals.d.js +2 -0
  55. package/lib/module/helpers/constants/globals.d.js.map +1 -0
  56. package/lib/module/helpers/constants/ios.js +102 -0
  57. package/lib/module/helpers/constants/ios.js.map +1 -0
  58. package/lib/module/helpers/native-files/ios/CIONotificationService-Info.plist +31 -0
  59. package/lib/module/helpers/native-files/ios/CIONotificationService.h +5 -0
  60. package/lib/module/helpers/native-files/ios/CIONotificationService.m +30 -0
  61. package/lib/module/helpers/native-files/ios/CIONotificationService.swift +21 -0
  62. package/lib/module/helpers/native-files/ios/PushNotification.swift +56 -0
  63. package/lib/module/helpers/utils/codeInjection.js +24 -0
  64. package/lib/module/helpers/utils/codeInjection.js.map +1 -0
  65. package/lib/module/helpers/utils/fileManagement.js +37 -0
  66. package/lib/module/helpers/utils/fileManagement.js.map +1 -0
  67. package/lib/module/helpers/utils/injectCIOPodfileCode.js +25 -0
  68. package/lib/module/helpers/utils/injectCIOPodfileCode.js.map +1 -0
  69. package/lib/module/index.js +10 -0
  70. package/lib/module/index.js.map +1 -0
  71. package/lib/module/ios/withAppDelegateModifications.js +69 -0
  72. package/lib/module/ios/withAppDelegateModifications.js.map +1 -0
  73. package/lib/module/ios/withAppDelegateXcodeProject.js +88 -0
  74. package/lib/module/ios/withAppDelegateXcodeProject.js.map +1 -0
  75. package/lib/module/ios/withCIOIos.js +12 -0
  76. package/lib/module/ios/withCIOIos.js.map +1 -0
  77. package/lib/module/ios/withNotificationsXcodeProject.js +149 -0
  78. package/lib/module/ios/withNotificationsXcodeProject.js.map +1 -0
  79. package/lib/module/ios/withXcodeProject.js +21 -0
  80. package/lib/module/ios/withXcodeProject.js.map +1 -0
  81. package/lib/module/types/cio-types.js +10 -0
  82. package/lib/module/types/cio-types.js.map +1 -0
  83. package/lib/typescript/android/withAppGoogleServices.d.ts +3 -0
  84. package/lib/typescript/android/withCIOAndroid.d.ts +3 -0
  85. package/lib/typescript/android/withGistMavenRepository.d.ts +3 -0
  86. package/lib/typescript/android/withGoogleServicesJSON.d.ts +3 -0
  87. package/lib/typescript/android/withProjectGoogleServices.d.ts +3 -0
  88. package/lib/typescript/helpers/constants/android.d.ts +6 -0
  89. package/lib/typescript/helpers/constants/ios.d.ts +30 -0
  90. package/lib/typescript/helpers/utils/codeInjection.d.ts +4 -0
  91. package/lib/typescript/helpers/utils/fileManagement.d.ts +5 -0
  92. package/lib/typescript/helpers/utils/injectCIOPodfileCode.d.ts +2 -0
  93. package/lib/typescript/index.d.ts +4 -0
  94. package/lib/typescript/ios/withAppDelegateModifications.d.ts +2 -0
  95. package/lib/typescript/ios/withAppDelegateXcodeProject.d.ts +3 -0
  96. package/lib/typescript/ios/withCIOIos.d.ts +3 -0
  97. package/lib/typescript/ios/withNotificationsXcodeProject.d.ts +3 -0
  98. package/lib/typescript/ios/withXcodeProject.d.ts +3 -0
  99. package/lib/typescript/types/cio-types.d.ts +22 -0
  100. package/package.json +87 -13
  101. package/src/android/withAppGoogleServices.ts +19 -0
  102. package/src/android/withCIOAndroid.ts +19 -0
  103. package/src/android/withGistMavenRepository.ts +19 -0
  104. package/src/android/withGoogleServicesJSON.ts +30 -0
  105. package/src/android/withProjectGoogleServices.ts +19 -0
  106. package/src/helpers/constants/android.ts +12 -0
  107. package/src/helpers/constants/globals.d.ts +8 -0
  108. package/src/helpers/constants/ios.ts +116 -0
  109. package/src/helpers/native-files/ios/CIONotificationService-Info.plist +31 -0
  110. package/src/helpers/native-files/ios/CIONotificationService.h +5 -0
  111. package/src/helpers/native-files/ios/CIONotificationService.m +30 -0
  112. package/src/helpers/native-files/ios/CIONotificationService.swift +21 -0
  113. package/src/helpers/native-files/ios/PushNotification.swift +56 -0
  114. package/src/helpers/utils/codeInjection.ts +46 -0
  115. package/src/helpers/utils/fileManagement.ts +39 -0
  116. package/src/helpers/utils/injectCIOPodfileCode.ts +47 -0
  117. package/src/index.ts +21 -0
  118. package/src/ios/withAppDelegateModifications.ts +150 -0
  119. package/src/ios/withAppDelegateXcodeProject.ts +110 -0
  120. package/src/ios/withCIOIos.ts +19 -0
  121. package/src/ios/withNotificationsXcodeProject.ts +231 -0
  122. package/src/ios/withXcodeProject.ts +25 -0
  123. package/src/types/cio-types.ts +28 -0
  124. package/build/helpers/.DS_Store +0 -0
  125. package/build/helpers/ios/.DS_Store +0 -0
  126. package/build/package.json +0 -36
  127. package/build/src/android/withAppGoogleServices.js +0 -12
  128. package/build/src/android/withCIOAndroid.js +0 -15
  129. package/build/src/android/withGistMavenRepository.js +0 -12
  130. package/build/src/android/withGoogleServicesJSON.js +0 -24
  131. package/build/src/android/withProjectGoogleServices.js +0 -12
  132. package/build/src/helpers/constants/android.js +0 -9
  133. package/build/src/helpers/constants/ios.js +0 -102
  134. package/build/src/helpers/utils/codeInjection.js +0 -30
  135. package/build/src/helpers/utils/fileManagement.js +0 -40
  136. package/build/src/helpers/utils/injectCIOPodfileCode.js +0 -37
  137. package/build/src/index.js +0 -11
  138. package/build/src/ios/withAppDelegateModifications.js +0 -77
  139. package/build/src/ios/withAppDelegateXcodeProject.js +0 -78
  140. package/build/src/ios/withCIOIos.js +0 -15
  141. package/build/src/ios/withNotificationsXcodeProject.js +0 -133
  142. package/build/src/ios/withXcodeProject.js +0 -22
  143. package/build/src/types/cio-types.js +0 -8
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withCioAppdelegateXcodeProject = void 0;
7
+ var _configPlugins = require("@expo/config-plugins");
8
+ var _fs = _interopRequireDefault(require("fs"));
9
+ var _xcode = _interopRequireDefault(require("xcode"));
10
+ var _ios = require("../helpers/constants/ios");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ const addNotificationServiceExtensionFile = async options => {
13
+ const {
14
+ iosPath,
15
+ appName
16
+ } = options;
17
+ const projPath = `${iosPath}/${appName}.xcodeproj/project.pbxproj`;
18
+ const xcodeProject = _xcode.default.project(projPath);
19
+ xcodeProject.parse(async function (err) {
20
+ if (err) {
21
+ throw new Error(`Error parsing iOS project: ${JSON.stringify(err)}`);
22
+ }
23
+ _fs.default.mkdirSync(`${iosPath}/${appName}`, {
24
+ recursive: true
25
+ });
26
+ const file = 'PushNotification.swift';
27
+ const getTargetFile = filename => `${iosPath}/${appName}/${filename}`;
28
+ const targetFile = getTargetFile(file);
29
+ _fs.default.copyFileSync(`${_ios.LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`, targetFile);
30
+
31
+ // Create new PBXGroup for the extension
32
+ const extGroup = xcodeProject.addPbxGroup([file], appName, appName);
33
+
34
+ // Add the new PBXGroup to the top level group. This makes the
35
+ // files / folder appear in the file explorer in Xcode.
36
+ const groups = xcodeProject.hash.project.objects['PBXGroup'];
37
+ Object.keys(groups).forEach(key => {
38
+ if (groups[key].name === undefined) {
39
+ xcodeProject.addToPbxGroup(extGroup.uuid, key);
40
+ }
41
+ });
42
+
43
+ // WORK AROUND for codeProject.addTarget BUG
44
+ // Xcode projects don't contain these if there is only one target
45
+ // An upstream fix should be made to the code referenced in this link:
46
+ // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860
47
+ const projObjects = xcodeProject.hash.project.objects;
48
+ projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};
49
+ projObjects['PBXContainerItemProxy'] = projObjects['PBXTargetDependency'] || {};
50
+ _fs.default.writeFileSync(projPath, xcodeProject.writeSync());
51
+ });
52
+ };
53
+ const withCioAppdelegateXcodeProject = (configOuter, props) => {
54
+ return (0, _configPlugins.withXcodeProject)(configOuter, async config => {
55
+ const {
56
+ modRequest,
57
+ ios,
58
+ version: bundleShortVersion
59
+ } = config;
60
+ const {
61
+ appleTeamId,
62
+ iosDeploymentTarget
63
+ } = props;
64
+ if (ios === undefined) throw new Error('Adding NotificationServiceExtension failed: ios config missing from app.config.js.');
65
+ const {
66
+ projectName,
67
+ platformProjectRoot
68
+ } = modRequest;
69
+ const {
70
+ bundleIdentifier,
71
+ buildNumber
72
+ } = ios;
73
+ if (bundleShortVersion === undefined) {
74
+ throw new Error('Adding NotificationServiceExtension failed: version missing from app.config.js');
75
+ }
76
+ if (bundleIdentifier === undefined) {
77
+ throw new Error('Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js');
78
+ }
79
+ if (projectName === undefined) {
80
+ throw new Error('Adding NotificationServiceExtension failed: name missing from app.config.js');
81
+ }
82
+ const options = {
83
+ appleTeamId,
84
+ bundleIdentifier,
85
+ bundleShortVersion,
86
+ bundleVersion: buildNumber ?? _ios.DEFAULT_BUNDLE_VERSION,
87
+ iosPath: platformProjectRoot,
88
+ appName: projectName,
89
+ iosDeploymentTarget
90
+ };
91
+ await addNotificationServiceExtensionFile(options);
92
+ return config;
93
+ });
94
+ };
95
+ exports.withCioAppdelegateXcodeProject = withCioAppdelegateXcodeProject;
96
+ //# sourceMappingURL=withAppDelegateXcodeProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["addNotificationServiceExtensionFile","options","iosPath","appName","projPath","xcodeProject","xcode","project","parse","err","Error","JSON","stringify","fs","mkdirSync","recursive","file","getTargetFile","filename","targetFile","copyFileSync","LOCAL_PATH_TO_CIO_NSE_FILES","extGroup","addPbxGroup","groups","hash","objects","Object","keys","forEach","key","name","undefined","addToPbxGroup","uuid","projObjects","writeFileSync","writeSync","withCioAppdelegateXcodeProject","configOuter","props","withXcodeProject","config","modRequest","ios","version","bundleShortVersion","appleTeamId","iosDeploymentTarget","projectName","platformProjectRoot","bundleIdentifier","buildNumber","bundleVersion","DEFAULT_BUNDLE_VERSION"],"sources":["withAppDelegateXcodeProject.ts"],"sourcesContent":["import { ConfigPlugin, withXcodeProject } from '@expo/config-plugins';\nimport fs from 'fs';\nimport xcode from 'xcode';\n\nimport {\n DEFAULT_BUNDLE_VERSION,\n LOCAL_PATH_TO_CIO_NSE_FILES,\n} from '../helpers/constants/ios';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\n\nconst addNotificationServiceExtensionFile = async (\n options: CustomerIOPluginOptionsIOS\n) => {\n const { iosPath, appName } = options;\n\n const projPath = `${iosPath}/${appName}.xcodeproj/project.pbxproj`;\n\n const xcodeProject = xcode.project(projPath);\n\n xcodeProject.parse(async function (err: Error) {\n if (err) {\n throw new Error(`Error parsing iOS project: ${JSON.stringify(err)}`);\n }\n\n fs.mkdirSync(`${iosPath}/${appName}`, {\n recursive: true,\n });\n\n const file = 'PushNotification.swift';\n\n const getTargetFile = (filename: string) =>\n `${iosPath}/${appName}/${filename}`;\n\n const targetFile = getTargetFile(file);\n fs.copyFileSync(`${LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`, targetFile);\n\n // Create new PBXGroup for the extension\n const extGroup = xcodeProject.addPbxGroup([file], appName, appName);\n\n // Add the new PBXGroup to the top level group. This makes the\n // files / folder appear in the file explorer in Xcode.\n const groups = xcodeProject.hash.project.objects['PBXGroup'];\n Object.keys(groups).forEach((key) => {\n if (groups[key].name === undefined) {\n xcodeProject.addToPbxGroup(extGroup.uuid, key);\n }\n });\n\n // WORK AROUND for codeProject.addTarget BUG\n // Xcode projects don't contain these if there is only one target\n // An upstream fix should be made to the code referenced in this link:\n // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860\n const projObjects = xcodeProject.hash.project.objects;\n projObjects['PBXTargetDependency'] =\n projObjects['PBXTargetDependency'] || {};\n projObjects['PBXContainerItemProxy'] =\n projObjects['PBXTargetDependency'] || {};\n\n fs.writeFileSync(projPath, xcodeProject.writeSync());\n });\n};\n\nexport const withCioAppdelegateXcodeProject: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (configOuter, props) => {\n return withXcodeProject(configOuter, async (config) => {\n const { modRequest, ios, version: bundleShortVersion } = config;\n const { appleTeamId, iosDeploymentTarget } = props;\n\n if (ios === undefined)\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios config missing from app.config.js.'\n );\n\n const { projectName, platformProjectRoot } = modRequest;\n const { bundleIdentifier, buildNumber } = ios;\n\n if (bundleShortVersion === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: version missing from app.config.js'\n );\n }\n\n if (bundleIdentifier === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js'\n );\n }\n\n if (projectName === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: name missing from app.config.js'\n );\n }\n\n const options = {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion: buildNumber ?? DEFAULT_BUNDLE_VERSION,\n iosPath: platformProjectRoot,\n appName: projectName,\n iosDeploymentTarget,\n };\n\n await addNotificationServiceExtensionFile(options);\n\n return config;\n });\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAEA;AAGkC;AAGlC,MAAMA,mCAAmC,GAAG,MAC1CC,OAAmC,IAChC;EACH,MAAM;IAAEC,OAAO;IAAEC;EAAQ,CAAC,GAAGF,OAAO;EAEpC,MAAMG,QAAQ,GAAI,GAAEF,OAAQ,IAAGC,OAAQ,4BAA2B;EAElE,MAAME,YAAY,GAAGC,cAAK,CAACC,OAAO,CAACH,QAAQ,CAAC;EAE5CC,YAAY,CAACG,KAAK,CAAC,gBAAgBC,GAAU,EAAE;IAC7C,IAAIA,GAAG,EAAE;MACP,MAAM,IAAIC,KAAK,CAAE,8BAA6BC,IAAI,CAACC,SAAS,CAACH,GAAG,CAAE,EAAC,CAAC;IACtE;IAEAI,WAAE,CAACC,SAAS,CAAE,GAAEZ,OAAQ,IAAGC,OAAQ,EAAC,EAAE;MACpCY,SAAS,EAAE;IACb,CAAC,CAAC;IAEF,MAAMC,IAAI,GAAG,wBAAwB;IAErC,MAAMC,aAAa,GAAIC,QAAgB,IACpC,GAAEhB,OAAQ,IAAGC,OAAQ,IAAGe,QAAS,EAAC;IAErC,MAAMC,UAAU,GAAGF,aAAa,CAACD,IAAI,CAAC;IACtCH,WAAE,CAACO,YAAY,CAAE,GAAEC,gCAA4B,IAAGL,IAAK,EAAC,EAAEG,UAAU,CAAC;;IAErE;IACA,MAAMG,QAAQ,GAAGjB,YAAY,CAACkB,WAAW,CAAC,CAACP,IAAI,CAAC,EAAEb,OAAO,EAAEA,OAAO,CAAC;;IAE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;MACpC,MAAM,IAAItB,KAAK,CACb,gFAAgF,CACjF;IACH;IAEA,IAAIyC,gBAAgB,KAAKnB,SAAS,EAAE;MAClC,MAAM,IAAItB,KAAK,CACb,6FAA6F,CAC9F;IACH;IAEA,IAAIuC,WAAW,KAAKjB,SAAS,EAAE;MAC7B,MAAM,IAAItB,KAAK,CACb,6EAA6E,CAC9E;IACH;IAEA,MAAMT,OAAO,GAAG;MACd8C,WAAW;MACXI,gBAAgB;MAChBL,kBAAkB;MAClBO,aAAa,EAAED,WAAW,IAAIE,2BAAsB;MACpDpD,OAAO,EAAEgD,mBAAmB;MAC5B/C,OAAO,EAAE8C,WAAW;MACpBD;IACF,CAAC;IAED,MAAMhD,mCAAmC,CAACC,OAAO,CAAC;IAElD,OAAOyC,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withCIOIos = withCIOIos;
7
+ var _withAppDelegateModifications = require("./withAppDelegateModifications");
8
+ var _withAppDelegateXcodeProject = require("./withAppDelegateXcodeProject");
9
+ var _withNotificationsXcodeProject = require("./withNotificationsXcodeProject");
10
+ var _withXcodeProject = require("./withXcodeProject");
11
+ function withCIOIos(config, props) {
12
+ config = (0, _withNotificationsXcodeProject.withCioNotificationsXcodeProject)(config, props);
13
+ config = (0, _withAppDelegateModifications.withAppDelegateModifications)(config, props);
14
+ config = (0, _withXcodeProject.withCioXcodeProject)(config, props);
15
+ config = (0, _withAppDelegateXcodeProject.withCioAppdelegateXcodeProject)(config, props);
16
+ return config;
17
+ }
18
+ //# sourceMappingURL=withCIOIos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withCIOIos","config","props","withCioNotificationsXcodeProject","withAppDelegateModifications","withCioXcodeProject","withCioAppdelegateXcodeProject"],"sources":["withCIOIos.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\nimport { withAppDelegateModifications } from './withAppDelegateModifications';\nimport { withCioAppdelegateXcodeProject } from './withAppDelegateXcodeProject';\nimport { withCioNotificationsXcodeProject } from './withNotificationsXcodeProject';\nimport { withCioXcodeProject } from './withXcodeProject';\n\nexport function withCIOIos(\n config: ExpoConfig,\n props: CustomerIOPluginOptionsIOS\n) {\n config = withCioNotificationsXcodeProject(config, props);\n config = withAppDelegateModifications(config, props);\n config = withCioXcodeProject(config, props);\n config = withCioAppdelegateXcodeProject(config, props);\n\n return config;\n}\n"],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AAEO,SAASA,UAAU,CACxBC,MAAkB,EAClBC,KAAiC,EACjC;EACAD,MAAM,GAAG,IAAAE,+DAAgC,EAACF,MAAM,EAAEC,KAAK,CAAC;EACxDD,MAAM,GAAG,IAAAG,0DAA4B,EAACH,MAAM,EAAEC,KAAK,CAAC;EACpDD,MAAM,GAAG,IAAAI,qCAAmB,EAACJ,MAAM,EAAEC,KAAK,CAAC;EAC3CD,MAAM,GAAG,IAAAK,2DAA8B,EAACL,MAAM,EAAEC,KAAK,CAAC;EAEtD,OAAOD,MAAM;AACf"}
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withCioNotificationsXcodeProject = void 0;
7
+ var _configPlugins = require("@expo/config-plugins");
8
+ var _fs = _interopRequireDefault(require("fs"));
9
+ var _xcode = _interopRequireDefault(require("xcode"));
10
+ var _ios = require("../helpers/constants/ios");
11
+ var _injectCIOPodfileCode = require("../helpers/utils/injectCIOPodfileCode");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ const PLIST_FILENAME = `${_ios.CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;
14
+ const TARGETED_DEVICE_FAMILY = `"1,2"`;
15
+ const addNotificationServiceExtension = async options => {
16
+ const {
17
+ appleTeamId,
18
+ bundleIdentifier,
19
+ bundleShortVersion,
20
+ bundleVersion,
21
+ iosPath,
22
+ appName,
23
+ iosDeploymentTarget
24
+ } = options;
25
+ const projPath = `${iosPath}/${appName}.xcodeproj/project.pbxproj`;
26
+ const xcodeProject = _xcode.default.project(projPath);
27
+ xcodeProject.parse(async function (err) {
28
+ if (err) {
29
+ throw new Error(`Error parsing iOS project: ${JSON.stringify(err)}`);
30
+ }
31
+ await (0, _injectCIOPodfileCode.injectCIONotificationPodfileCode)(iosPath);
32
+ _fs.default.mkdirSync(`${iosPath}/${_ios.CIO_NOTIFICATION_TARGET_NAME}`, {
33
+ recursive: true
34
+ });
35
+ const files = [PLIST_FILENAME, 'CIONotificationService.h', 'CIONotificationService.swift', 'CIONotificationService.m'];
36
+ const getTargetFile = filename => `${iosPath}/${_ios.CIO_NOTIFICATION_TARGET_NAME}/${filename}`;
37
+ files.forEach(filename => {
38
+ const targetFile = getTargetFile(filename);
39
+ _fs.default.copyFileSync(`${_ios.LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`, targetFile);
40
+ });
41
+
42
+ /* MODIFY COPIED EXTENSION FILES */
43
+ const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);
44
+ updateNseInfoPlist({
45
+ bundleVersion,
46
+ bundleShortVersion,
47
+ infoPlistTargetFile
48
+ });
49
+
50
+ // Create new PBXGroup for the extension
51
+ const extGroup = xcodeProject.addPbxGroup(files, _ios.CIO_NOTIFICATION_TARGET_NAME, _ios.CIO_NOTIFICATION_TARGET_NAME);
52
+
53
+ // Add the new PBXGroup to the top level group. This makes the
54
+ // files / folder appear in the file explorer in Xcode.
55
+ const groups = xcodeProject.hash.project.objects['PBXGroup'];
56
+ Object.keys(groups).forEach(key => {
57
+ if (groups[key].name === undefined) {
58
+ xcodeProject.addToPbxGroup(extGroup.uuid, key);
59
+ }
60
+ });
61
+
62
+ // WORK AROUND for codeProject.addTarget BUG
63
+ // Xcode projects don't contain these if there is only one target
64
+ // An upstream fix should be made to the code referenced in this link:
65
+ // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860
66
+ const projObjects = xcodeProject.hash.project.objects;
67
+ projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};
68
+ projObjects['PBXContainerItemProxy'] = projObjects['PBXTargetDependency'] || {};
69
+ if (xcodeProject.pbxTargetByName(_ios.CIO_NOTIFICATION_TARGET_NAME)) {
70
+ console.warn(`${_ios.CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`);
71
+ return;
72
+ }
73
+
74
+ // Add the NSE target
75
+ // This also adds PBXTargetDependency and PBXContainerItemProxy
76
+ const nseTarget = xcodeProject.addTarget(_ios.CIO_NOTIFICATION_TARGET_NAME, 'app_extension', _ios.CIO_NOTIFICATION_TARGET_NAME, `${bundleIdentifier}.richpush`);
77
+
78
+ // Add build phases to the new target
79
+ xcodeProject.addBuildPhase(['CIONotificationService.m', 'CIONotificationService.swift'], 'PBXSourcesBuildPhase', 'Sources', nseTarget.uuid);
80
+ xcodeProject.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', nseTarget.uuid);
81
+ xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', nseTarget.uuid);
82
+
83
+ // Edit the Deployment info of the target
84
+ const configurations = xcodeProject.pbxXCBuildConfigurationSection();
85
+ for (const key in configurations) {
86
+ if (typeof configurations[key].buildSettings !== 'undefined' && configurations[key].buildSettings.PRODUCT_NAME === `"${_ios.CIO_NOTIFICATION_TARGET_NAME}"`) {
87
+ const buildSettingsObj = configurations[key].buildSettings;
88
+ buildSettingsObj.DEVELOPMENT_TEAM = appleTeamId;
89
+ buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = iosDeploymentTarget ?? '13.0';
90
+ buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY;
91
+ buildSettingsObj.CODE_SIGN_STYLE = 'Automatic';
92
+ buildSettingsObj.SWIFT_VERSION = 4.2;
93
+ }
94
+ }
95
+
96
+ // Add development team to the target & the main
97
+ xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId, nseTarget);
98
+ xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId);
99
+ _fs.default.writeFileSync(projPath, xcodeProject.writeSync());
100
+ });
101
+ };
102
+ const withCioNotificationsXcodeProject = (configOuter, props) => {
103
+ return (0, _configPlugins.withXcodeProject)(configOuter, async config => {
104
+ const {
105
+ modRequest,
106
+ ios,
107
+ version: bundleShortVersion
108
+ } = config;
109
+ const {
110
+ appleTeamId,
111
+ iosDeploymentTarget
112
+ } = props;
113
+ if (ios === undefined) throw new Error('Adding NotificationServiceExtension failed: ios config missing from app.config.js.');
114
+ const {
115
+ projectName,
116
+ platformProjectRoot
117
+ } = modRequest;
118
+ const {
119
+ bundleIdentifier,
120
+ buildNumber
121
+ } = ios;
122
+ if (bundleShortVersion === undefined) {
123
+ throw new Error('Adding NotificationServiceExtension failed: version missing from app.config.js');
124
+ }
125
+ if (bundleIdentifier === undefined) {
126
+ throw new Error('Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js');
127
+ }
128
+ if (projectName === undefined) {
129
+ throw new Error('Adding NotificationServiceExtension failed: name missing from app.config.js');
130
+ }
131
+ const options = {
132
+ appleTeamId,
133
+ bundleIdentifier,
134
+ bundleShortVersion,
135
+ bundleVersion: buildNumber ?? _ios.DEFAULT_BUNDLE_VERSION,
136
+ iosPath: platformProjectRoot,
137
+ appName: projectName,
138
+ iosDeploymentTarget
139
+ };
140
+ await addNotificationServiceExtension(options);
141
+ return config;
142
+ });
143
+ };
144
+ exports.withCioNotificationsXcodeProject = withCioNotificationsXcodeProject;
145
+ const updateNseInfoPlist = payload => {
146
+ const BUNDLE_SHORT_VERSION_RE = /\{\{BUNDLE_SHORT_VERSION\}\}/;
147
+ const BUNDLE_VERSION_RE = /\{\{BUNDLE_VERSION\}\}/;
148
+ let plistFileString = _fs.default.readFileSync(payload.infoPlistTargetFile, 'utf-8');
149
+ if (payload.bundleVersion) {
150
+ plistFileString = plistFileString.replace(BUNDLE_VERSION_RE, payload.bundleVersion);
151
+ }
152
+ if (payload.bundleShortVersion) {
153
+ plistFileString = plistFileString.replace(BUNDLE_SHORT_VERSION_RE, payload.bundleShortVersion);
154
+ }
155
+ _fs.default.writeFileSync(payload.infoPlistTargetFile, plistFileString);
156
+ };
157
+ //# sourceMappingURL=withNotificationsXcodeProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PLIST_FILENAME","CIO_NOTIFICATION_TARGET_NAME","TARGETED_DEVICE_FAMILY","addNotificationServiceExtension","options","appleTeamId","bundleIdentifier","bundleShortVersion","bundleVersion","iosPath","appName","iosDeploymentTarget","projPath","xcodeProject","xcode","project","parse","err","Error","JSON","stringify","injectCIONotificationPodfileCode","fs","mkdirSync","recursive","files","getTargetFile","filename","forEach","targetFile","copyFileSync","LOCAL_PATH_TO_CIO_NSE_FILES","infoPlistTargetFile","updateNseInfoPlist","extGroup","addPbxGroup","groups","hash","objects","Object","keys","key","name","undefined","addToPbxGroup","uuid","projObjects","pbxTargetByName","console","warn","nseTarget","addTarget","addBuildPhase","configurations","pbxXCBuildConfigurationSection","buildSettings","PRODUCT_NAME","buildSettingsObj","DEVELOPMENT_TEAM","IPHONEOS_DEPLOYMENT_TARGET","CODE_SIGN_STYLE","SWIFT_VERSION","addTargetAttribute","writeFileSync","writeSync","withCioNotificationsXcodeProject","configOuter","props","withXcodeProject","config","modRequest","ios","version","projectName","platformProjectRoot","buildNumber","DEFAULT_BUNDLE_VERSION","payload","BUNDLE_SHORT_VERSION_RE","BUNDLE_VERSION_RE","plistFileString","readFileSync","replace"],"sources":["withNotificationsXcodeProject.ts"],"sourcesContent":["import { ConfigPlugin, withXcodeProject } from '@expo/config-plugins';\nimport fs from 'fs';\nimport xcode from 'xcode';\n\nimport {\n CIO_NOTIFICATION_TARGET_NAME,\n DEFAULT_BUNDLE_VERSION,\n LOCAL_PATH_TO_CIO_NSE_FILES,\n} from '../helpers/constants/ios';\nimport { injectCIONotificationPodfileCode } from '../helpers/utils/injectCIOPodfileCode';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\n\nconst PLIST_FILENAME = `${CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;\n\nconst TARGETED_DEVICE_FAMILY = `\"1,2\"`;\n\nconst addNotificationServiceExtension = async (\n options: CustomerIOPluginOptionsIOS\n) => {\n const {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion,\n iosPath,\n appName,\n iosDeploymentTarget,\n } = options;\n\n const projPath = `${iosPath}/${appName}.xcodeproj/project.pbxproj`;\n\n const xcodeProject = xcode.project(projPath);\n\n xcodeProject.parse(async function (err: Error) {\n if (err) {\n throw new Error(`Error parsing iOS project: ${JSON.stringify(err)}`);\n }\n\n await injectCIONotificationPodfileCode(iosPath);\n\n fs.mkdirSync(`${iosPath}/${CIO_NOTIFICATION_TARGET_NAME}`, {\n recursive: true,\n });\n\n const files = [\n PLIST_FILENAME,\n 'CIONotificationService.h',\n 'CIONotificationService.swift',\n 'CIONotificationService.m',\n ];\n\n const getTargetFile = (filename: string) =>\n `${iosPath}/${CIO_NOTIFICATION_TARGET_NAME}/${filename}`;\n\n files.forEach((filename) => {\n const targetFile = getTargetFile(filename);\n fs.copyFileSync(`${LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`, targetFile);\n });\n\n /* MODIFY COPIED EXTENSION FILES */\n const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);\n updateNseInfoPlist({\n bundleVersion,\n bundleShortVersion,\n infoPlistTargetFile,\n });\n\n // Create new PBXGroup for the extension\n const extGroup = xcodeProject.addPbxGroup(\n files,\n CIO_NOTIFICATION_TARGET_NAME,\n CIO_NOTIFICATION_TARGET_NAME\n );\n\n // Add the new PBXGroup to the top level group. This makes the\n // files / folder appear in the file explorer in Xcode.\n const groups = xcodeProject.hash.project.objects['PBXGroup'];\n Object.keys(groups).forEach((key) => {\n if (groups[key].name === undefined) {\n xcodeProject.addToPbxGroup(extGroup.uuid, key);\n }\n });\n\n // WORK AROUND for codeProject.addTarget BUG\n // Xcode projects don't contain these if there is only one target\n // An upstream fix should be made to the code referenced in this link:\n // - https://github.com/apache/cordova-node-xcode/blob/8b98cabc5978359db88dc9ff2d4c015cba40f150/lib/pbxProject.js#L860\n const projObjects = xcodeProject.hash.project.objects;\n projObjects['PBXTargetDependency'] =\n projObjects['PBXTargetDependency'] || {};\n projObjects['PBXContainerItemProxy'] =\n projObjects['PBXTargetDependency'] || {};\n\n if (xcodeProject.pbxTargetByName(CIO_NOTIFICATION_TARGET_NAME)) {\n console.warn(\n `${CIO_NOTIFICATION_TARGET_NAME} already exists in project. Skipping...`\n );\n return;\n }\n\n // Add the NSE target\n // This also adds PBXTargetDependency and PBXContainerItemProxy\n const nseTarget = xcodeProject.addTarget(\n CIO_NOTIFICATION_TARGET_NAME,\n 'app_extension',\n CIO_NOTIFICATION_TARGET_NAME,\n `${bundleIdentifier}.richpush`\n );\n\n // Add build phases to the new target\n xcodeProject.addBuildPhase(\n ['CIONotificationService.m', 'CIONotificationService.swift'],\n 'PBXSourcesBuildPhase',\n 'Sources',\n nseTarget.uuid\n );\n xcodeProject.addBuildPhase(\n [],\n 'PBXResourcesBuildPhase',\n 'Resources',\n nseTarget.uuid\n );\n\n xcodeProject.addBuildPhase(\n [],\n 'PBXFrameworksBuildPhase',\n 'Frameworks',\n nseTarget.uuid\n );\n\n // Edit the Deployment info of the target\n const configurations = xcodeProject.pbxXCBuildConfigurationSection();\n for (const key in configurations) {\n if (\n typeof configurations[key].buildSettings !== 'undefined' &&\n configurations[key].buildSettings.PRODUCT_NAME ===\n `\"${CIO_NOTIFICATION_TARGET_NAME}\"`\n ) {\n const buildSettingsObj = configurations[key].buildSettings;\n buildSettingsObj.DEVELOPMENT_TEAM = appleTeamId;\n buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET =\n iosDeploymentTarget ?? '13.0';\n buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY;\n buildSettingsObj.CODE_SIGN_STYLE = 'Automatic';\n buildSettingsObj.SWIFT_VERSION = 4.2;\n }\n }\n\n // Add development team to the target & the main\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId, nseTarget);\n xcodeProject.addTargetAttribute('DevelopmentTeam', appleTeamId);\n\n fs.writeFileSync(projPath, xcodeProject.writeSync());\n });\n};\n\nexport const withCioNotificationsXcodeProject: ConfigPlugin<\n CustomerIOPluginOptionsIOS\n> = (configOuter, props) => {\n return withXcodeProject(configOuter, async (config) => {\n const { modRequest, ios, version: bundleShortVersion } = config;\n const { appleTeamId, iosDeploymentTarget } = props;\n\n if (ios === undefined)\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios config missing from app.config.js.'\n );\n\n const { projectName, platformProjectRoot } = modRequest;\n const { bundleIdentifier, buildNumber } = ios;\n\n if (bundleShortVersion === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: version missing from app.config.js'\n );\n }\n\n if (bundleIdentifier === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: ios.bundleIdentifier missing from app.config.js'\n );\n }\n\n if (projectName === undefined) {\n throw new Error(\n 'Adding NotificationServiceExtension failed: name missing from app.config.js'\n );\n }\n\n const options = {\n appleTeamId,\n bundleIdentifier,\n bundleShortVersion,\n bundleVersion: buildNumber ?? DEFAULT_BUNDLE_VERSION,\n iosPath: platformProjectRoot,\n appName: projectName,\n iosDeploymentTarget,\n };\n\n await addNotificationServiceExtension(options);\n\n return config;\n });\n};\n\nconst updateNseInfoPlist = (payload: {\n bundleVersion?: string;\n bundleShortVersion?: string;\n infoPlistTargetFile: string;\n}) => {\n const BUNDLE_SHORT_VERSION_RE = /\\{\\{BUNDLE_SHORT_VERSION\\}\\}/;\n const BUNDLE_VERSION_RE = /\\{\\{BUNDLE_VERSION\\}\\}/;\n\n let plistFileString = fs.readFileSync(payload.infoPlistTargetFile, 'utf-8');\n\n if (payload.bundleVersion) {\n plistFileString = plistFileString.replace(\n BUNDLE_VERSION_RE,\n payload.bundleVersion\n );\n }\n\n if (payload.bundleShortVersion) {\n plistFileString = plistFileString.replace(\n BUNDLE_SHORT_VERSION_RE,\n payload.bundleShortVersion\n );\n }\n\n fs.writeFileSync(payload.infoPlistTargetFile, plistFileString);\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAEA;AAKA;AAAyF;AAGzF,MAAMA,cAAc,GAAI,GAAEC,iCAA6B,aAAY;AAEnE,MAAMC,sBAAsB,GAAI,OAAM;AAEtC,MAAMC,+BAA+B,GAAG,MACtCC,OAAmC,IAChC;EACH,MAAM;IACJC,WAAW;IACXC,gBAAgB;IAChBC,kBAAkB;IAClBC,aAAa;IACbC,OAAO;IACPC,OAAO;IACPC;EACF,CAAC,GAAGP,OAAO;EAEX,MAAMQ,QAAQ,GAAI,GAAEH,OAAQ,IAAGC,OAAQ,4BAA2B;EAElE,MAAMG,YAAY,GAAGC,cAAK,CAACC,OAAO,CAACH,QAAQ,CAAC;EAE5CC,YAAY,CAACG,KAAK,CAAC,gBAAgBC,GAAU,EAAE;IAC7C,IAAIA,GAAG,EAAE;MACP,MAAM,IAAIC,KAAK,CAAE,8BAA6BC,IAAI,CAACC,SAAS,CAACH,GAAG,CAAE,EAAC,CAAC;IACtE;IAEA,MAAM,IAAAI,sDAAgC,EAACZ,OAAO,CAAC;IAE/Ca,WAAE,CAACC,SAAS,CAAE,GAAEd,OAAQ,IAAGR,iCAA6B,EAAC,EAAE;MACzDuB,SAAS,EAAE;IACb,CAAC,CAAC;IAEF,MAAMC,KAAK,GAAG,CACZzB,cAAc,EACd,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,CAC3B;IAED,MAAM0B,aAAa,GAAIC,QAAgB,IACpC,GAAElB,OAAQ,IAAGR,iCAA6B,IAAG0B,QAAS,EAAC;IAE1DF,KAAK,CAACG,OAAO,CAAED,QAAQ,IA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mB,EAAE,OAAO,CAAC;EAE3E,IAAI6C,OAAO,CAACrE,aAAa,EAAE;IACzBwE,eAAe,GAAGA,eAAe,CAACE,OAAO,CACvCH,iBAAiB,EACjBF,OAAO,CAACrE,aAAa,CACtB;EACH;EAEA,IAAIqE,OAAO,CAACtE,kBAAkB,EAAE;IAC9ByE,eAAe,GAAGA,eAAe,CAACE,OAAO,CACvCJ,uBAAuB,EACvBD,OAAO,CAACtE,kBAAkB,CAC3B;EACH;EAEAe,WAAE,CAACyC,aAAa,CAACc,OAAO,CAAC7C,mBAAmB,EAAEgD,eAAe,CAAC;AAChE,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withCioXcodeProject = void 0;
7
+ var _configPlugins = require("@expo/config-plugins");
8
+ var _injectCIOPodfileCode = require("../helpers/utils/injectCIOPodfileCode");
9
+ const withCioXcodeProject = (config, cioProps) => {
10
+ return (0, _configPlugins.withXcodeProject)(config, async props => {
11
+ var _props$ios, _props$ios2;
12
+ const options = {
13
+ iosPath: props.modRequest.platformProjectRoot,
14
+ bundleIdentifier: (_props$ios = props.ios) === null || _props$ios === void 0 ? void 0 : _props$ios.bundleIdentifier,
15
+ devTeam: cioProps === null || cioProps === void 0 ? void 0 : cioProps.devTeam,
16
+ bundleVersion: (_props$ios2 = props.ios) === null || _props$ios2 === void 0 ? void 0 : _props$ios2.buildNumber,
17
+ bundleShortVersion: props === null || props === void 0 ? void 0 : props.version,
18
+ iosDeploymentTarget: cioProps === null || cioProps === void 0 ? void 0 : cioProps.iosDeploymentTarget
19
+ };
20
+ const {
21
+ iosPath
22
+ } = options;
23
+ await (0, _injectCIOPodfileCode.injectCIOPodfileCode)(iosPath);
24
+ return props;
25
+ });
26
+ };
27
+ exports.withCioXcodeProject = withCioXcodeProject;
28
+ //# sourceMappingURL=withXcodeProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withCioXcodeProject","config","cioProps","withXcodeProject","props","options","iosPath","modRequest","platformProjectRoot","bundleIdentifier","ios","devTeam","bundleVersion","buildNumber","bundleShortVersion","version","iosDeploymentTarget","injectCIOPodfileCode"],"sources":["withXcodeProject.ts"],"sourcesContent":["import { ConfigPlugin, withXcodeProject } from '@expo/config-plugins';\n\nimport { injectCIOPodfileCode } from '../helpers/utils/injectCIOPodfileCode';\nimport type { CustomerIOPluginOptionsIOS } from '../types/cio-types';\n\nexport const withCioXcodeProject: ConfigPlugin<CustomerIOPluginOptionsIOS> = (\n config,\n cioProps\n) => {\n return withXcodeProject(config, async (props) => {\n const options: CustomerIOPluginOptionsIOS = {\n iosPath: props.modRequest.platformProjectRoot,\n bundleIdentifier: props.ios?.bundleIdentifier,\n devTeam: cioProps?.devTeam,\n bundleVersion: props.ios?.buildNumber,\n bundleShortVersion: props?.version,\n iosDeploymentTarget: cioProps?.iosDeploymentTarget,\n };\n const { iosPath } = options;\n\n await injectCIOPodfileCode(iosPath);\n\n return props;\n });\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAGO,MAAMA,mBAA6D,GAAG,CAC3EC,MAAM,EACNC,QAAQ,KACL;EACH,OAAO,IAAAC,+BAAgB,EAACF,MAAM,EAAE,MAAOG,KAAK,IAAK;IAAA;IAC/C,MAAMC,OAAmC,GAAG;MAC1CC,OAAO,EAAEF,KAAK,CAACG,UAAU,CAACC,mBAAmB;MAC7CC,gBAAgB,gBAAEL,KAAK,CAACM,GAAG,+CAAT,WAAWD,gBAAgB;MAC7CE,OAAO,EAAET,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAES,OAAO;MAC1BC,aAAa,iBAAER,KAAK,CAACM,GAAG,gDAAT,YAAWG,WAAW;MACrCC,kBAAkB,EAAEV,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEW,OAAO;MAClCC,mBAAmB,EAAEd,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEc;IACjC,CAAC;IACD,MAAM;MAAEV;IAAQ,CAAC,GAAGD,OAAO;IAE3B,MAAM,IAAAY,0CAAoB,EAACX,OAAO,CAAC;IAEnC,OAAOF,KAAK;EACd,CAAC,CAAC;AACJ,CAAC;AAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Mode = void 0;
7
+ // properties set by the user in their app config file (e.g: app.json or app.plugin.js)
8
+ // Plugin options for pre-build
9
+ let Mode;
10
+ exports.Mode = Mode;
11
+ (function (Mode) {
12
+ Mode["Dev"] = "development";
13
+ Mode["Prod"] = "production";
14
+ })(Mode || (exports.Mode = Mode = {}));
15
+ //# sourceMappingURL=cio-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Mode"],"sources":["cio-types.ts"],"sourcesContent":["// properties set by the user in their app config file (e.g: app.json or app.plugin.js)\nexport type CustomerIOPluginProperties = {\n // (iOS only) Environment name and bundle identifier\n devTeam: string;\n iosDeploymentTarget: string;\n};\n\n// Plugin options for pre-build\nexport type CustomerIOPluginOptionsIOS = {\n iosPath: string;\n devTeam?: string;\n bundleVersion?: string;\n bundleShortVersion?: string;\n bundleIdentifier?: string;\n iosDeploymentTarget?: string;\n appleTeamId?: string;\n appName?: string;\n};\n\nexport type CustomerIOPluginOptionsAndroid = {\n androidPath: string;\n googleServicesFilePath?: string;\n};\n\nexport enum Mode {\n Dev = 'development',\n Prod = 'production',\n}\n"],"mappings":";;;;;;AAAA;AAOA;AAAA,IAiBYA,IAAI;AAAA;AAAA,WAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;AAAA,GAAJA,IAAI,oBAAJA,IAAI"}
@@ -0,0 +1,9 @@
1
+ import { withAppBuildGradle } from '@expo/config-plugins';
2
+ import { CIO_APP_APPLY_REGEX, CIO_APP_GOOGLE_SNIPPET } from '../helpers/constants/android';
3
+ export const withAppGoogleServices = configOuter => {
4
+ return withAppBuildGradle(configOuter, props => {
5
+ props.modResults.contents = props.modResults.contents.replace(CIO_APP_APPLY_REGEX, `$1\n${CIO_APP_GOOGLE_SNIPPET}`);
6
+ return props;
7
+ });
8
+ };
9
+ //# sourceMappingURL=withAppGoogleServices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withAppBuildGradle","CIO_APP_APPLY_REGEX","CIO_APP_GOOGLE_SNIPPET","withAppGoogleServices","configOuter","props","modResults","contents","replace"],"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 props.modResults.contents = props.modResults.contents.replace(\n CIO_APP_APPLY_REGEX,\n `$1\\n${CIO_APP_GOOGLE_SNIPPET}`\n );\n return props;\n });\n};\n"],"mappings":"AAAA,SAAuBA,kBAAkB,QAAQ,sBAAsB;AAEvE,SACEC,mBAAmB,EACnBC,sBAAsB,QACjB,8BAA8B;AAGrC,OAAO,MAAMC,qBAEZ,GAAIC,WAAW,IAAK;EACnB,OAAOJ,kBAAkB,CAACI,WAAW,EAAGC,KAAK,IAAK;IAChDA,KAAK,CAACC,UAAU,CAACC,QAAQ,GAAGF,KAAK,CAACC,UAAU,CAACC,QAAQ,CAACC,OAAO,CAC3DP,mBAAmB,EAClB,OAAMC,sBAAuB,EAAC,CAChC;IACD,OAAOG,KAAK;EACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { withAppGoogleServices } from './withAppGoogleServices';
2
+ import { withGistMavenRepository } from './withGistMavenRepository';
3
+ import { withGoogleServicesJSON } from './withGoogleServicesJSON';
4
+ import { withProjectGoogleServices } from './withProjectGoogleServices';
5
+ export function withCIOAndroid(config, props) {
6
+ config = withGistMavenRepository(config, props);
7
+ config = withProjectGoogleServices(config, props);
8
+ config = withAppGoogleServices(config, props);
9
+ config = withGoogleServicesJSON(config, props);
10
+ return config;
11
+ }
12
+ //# sourceMappingURL=withCIOAndroid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withAppGoogleServices","withGistMavenRepository","withGoogleServicesJSON","withProjectGoogleServices","withCIOAndroid","config","props"],"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,SAASA,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,yBAAyB,QAAQ,6BAA6B;AAEvE,OAAO,SAASC,cAAc,CAC5BC,MAAkB,EAClBC,KAAqC,EACzB;EACZD,MAAM,GAAGJ,uBAAuB,CAACI,MAAM,EAAEC,KAAK,CAAC;EAC/CD,MAAM,GAAGF,yBAAyB,CAACE,MAAM,EAAEC,KAAK,CAAC;EACjDD,MAAM,GAAGL,qBAAqB,CAACK,MAAM,EAAEC,KAAK,CAAC;EAC7CD,MAAM,GAAGH,sBAAsB,CAACG,MAAM,EAAEC,KAAK,CAAC;EAE9C,OAAOD,MAAM;AACf"}
@@ -0,0 +1,9 @@
1
+ import { withProjectBuildGradle } from '@expo/config-plugins';
2
+ import { CIO_PROJECT_ALLPROJECTS_REGEX, CIO_PROJECT_GIST_MAVEN_SNIPPET } from '../helpers/constants/android';
3
+ export const withGistMavenRepository = configOuter => {
4
+ return withProjectBuildGradle(configOuter, props => {
5
+ props.modResults.contents = props.modResults.contents.replace(CIO_PROJECT_ALLPROJECTS_REGEX, `$1\n${CIO_PROJECT_GIST_MAVEN_SNIPPET}`);
6
+ return props;
7
+ });
8
+ };
9
+ //# sourceMappingURL=withGistMavenRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withProjectBuildGradle","CIO_PROJECT_ALLPROJECTS_REGEX","CIO_PROJECT_GIST_MAVEN_SNIPPET","withGistMavenRepository","configOuter","props","modResults","contents","replace"],"sources":["withGistMavenRepository.ts"],"sourcesContent":["import { withProjectBuildGradle, ConfigPlugin } from '@expo/config-plugins';\n\nimport {\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 props.modResults.contents = props.modResults.contents.replace(\n CIO_PROJECT_ALLPROJECTS_REGEX,\n `$1\\n${CIO_PROJECT_GIST_MAVEN_SNIPPET}`\n );\n return props;\n });\n};\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAsB,sBAAsB;AAE3E,SACEC,6BAA6B,EAC7BC,8BAA8B,QACzB,8BAA8B;AAGrC,OAAO,MAAMC,uBAEZ,GAAIC,WAAW,IAAK;EACnB,OAAOJ,sBAAsB,CAACI,WAAW,EAAGC,KAAK,IAAK;IACpDA,KAAK,CAACC,UAAU,CAACC,QAAQ,GAAGF,KAAK,CAACC,UAAU,CAACC,QAAQ,CAACC,OAAO,CAC3DP,6BAA6B,EAC5B,OAAMC,8BAA+B,EAAC,CACxC;IACD,OAAOG,KAAK;EACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { withProjectBuildGradle } from '@expo/config-plugins';
2
+ import { copyFileSync } from 'fs';
3
+ export const withGoogleServicesJSON = (configOuter, cioProps) => {
4
+ return withProjectBuildGradle(configOuter, props => {
5
+ const options = {
6
+ androidPath: props.modRequest.platformProjectRoot,
7
+ googleServicesFilePath: cioProps === null || cioProps === void 0 ? void 0 : cioProps.googleServicesFilePath
8
+ };
9
+ const {
10
+ androidPath,
11
+ googleServicesFilePath
12
+ } = options;
13
+ if (googleServicesFilePath) {
14
+ try {
15
+ copyFileSync(`${googleServicesFilePath}google-services.json`, `${androidPath}/app/google-services.json`);
16
+ } catch (e) {
17
+ console.log('There was an error copying your google-services.json file.');
18
+ }
19
+ }
20
+ return props;
21
+ });
22
+ };
23
+ //# sourceMappingURL=withGoogleServicesJSON.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withProjectBuildGradle","copyFileSync","withGoogleServicesJSON","configOuter","cioProps","props","options","androidPath","modRequest","platformProjectRoot","googleServicesFilePath","e","console","log"],"sources":["withGoogleServicesJSON.ts"],"sourcesContent":["import { withProjectBuildGradle, ConfigPlugin } from '@expo/config-plugins';\nimport { copyFileSync } from 'fs';\n\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 (googleServicesFilePath) {\n try {\n copyFileSync(\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.'\n );\n }\n }\n\n return props;\n });\n};\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAsB,sBAAsB;AAC3E,SAASC,YAAY,QAAQ,IAAI;AAIjC,OAAO,MAAMC,sBAEZ,GAAG,CAACC,WAAW,EAAEC,QAAQ,KAAK;EAC7B,OAAOJ,sBAAsB,CAACG,WAAW,EAAGE,KAAK,IAAK;IACpD,MAAMC,OAAuC,GAAG;MAC9CC,WAAW,EAAEF,KAAK,CAACG,UAAU,CAACC,mBAAmB;MACjDC,sBAAsB,EAAEN,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEM;IACpC,CAAC;IACD,MAAM;MAAEH,WAAW;MAAEG;IAAuB,CAAC,GAAGJ,OAAO;IACvD,IAAII,sBAAsB,EAAE;MAC1B,IAAI;QACFT,YAAY,CACT,GAAES,sBAAuB,sBAAqB,EAC9C,GAAEH,WAAY,2BAA0B,CAC1C;MACH,CAAC,CAAC,OAAOI,CAAC,EAAE;QACVC,OAAO,CAACC,GAAG,CACT,4DAA4D,CAC7D;MACH;IACF;IAEA,OAAOR,KAAK;EACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { withProjectBuildGradle } from '@expo/config-plugins';
2
+ import { CIO_PROJECT_BUILDSCRIPTS_REGEX, CIO_PROJECT_GOOGLE_SNIPPET } from './../helpers/constants/android';
3
+ export const withProjectGoogleServices = configOuter => {
4
+ return withProjectBuildGradle(configOuter, props => {
5
+ props.modResults.contents = props.modResults.contents.replace(CIO_PROJECT_BUILDSCRIPTS_REGEX, `$1\n${CIO_PROJECT_GOOGLE_SNIPPET}`);
6
+ return props;
7
+ });
8
+ };
9
+ //# sourceMappingURL=withProjectGoogleServices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["withProjectBuildGradle","CIO_PROJECT_BUILDSCRIPTS_REGEX","CIO_PROJECT_GOOGLE_SNIPPET","withProjectGoogleServices","configOuter","props","modResults","contents","replace"],"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 props.modResults.contents = props.modResults.contents.replace(\n CIO_PROJECT_BUILDSCRIPTS_REGEX,\n `$1\\n${CIO_PROJECT_GOOGLE_SNIPPET}`\n );\n return props;\n });\n};\n"],"mappings":"AAAA,SAAuBA,sBAAsB,QAAQ,sBAAsB;AAE3E,SACEC,8BAA8B,EAC9BC,0BAA0B,QACrB,gCAAgC;AAGvC,OAAO,MAAMC,yBAEZ,GAAIC,WAAW,IAAK;EACnB,OAAOJ,sBAAsB,CAACI,WAAW,EAAGC,KAAK,IAAK;IACpDA,KAAK,CAACC,UAAU,CAACC,QAAQ,GAAGF,KAAK,CAACC,UAAU,CAACC,QAAQ,CAACC,OAAO,CAC3DP,8BAA8B,EAC7B,OAAMC,0BAA2B,EAAC,CACpC;IACD,OAAOG,KAAK;EACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const CIO_PROJECT_BUILDSCRIPTS_REGEX = /(buildscript\s*\{(.|\n)*dependencies\s*\{)/;
2
+ export const CIO_APP_APPLY_REGEX = /(apply plugin: "com.android.application")/;
3
+ export const CIO_PROJECT_ALLPROJECTS_REGEX = /(allprojects\s*\{(.|\n)*repositories\s*\{)/;
4
+ export const CIO_PROJECT_GIST_MAVEN_SNIPPET = ' maven { url "https://maven.gist.build" }';
5
+ export const CIO_APP_GOOGLE_SNIPPET = 'apply plugin: "com.google.gms.google-services" // Google Services plugin';
6
+ export const CIO_PROJECT_GOOGLE_SNIPPET = ' classpath "com.google.gms:google-services:4.3.13" // Google Services plugin';
7
+ //# sourceMappingURL=android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CIO_PROJECT_BUILDSCRIPTS_REGEX","CIO_APP_APPLY_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_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":"AAAA,OAAO,MAAMA,8BAA8B,GACzC,4CAA4C;AAC9C,OAAO,MAAMC,mBAAmB,GAAG,2CAA2C;AAC9E,OAAO,MAAMC,6BAA6B,GACxC,4CAA4C;AAE9C,OAAO,MAAMC,8BAA8B,GACzC,kDAAkD;AACpD,OAAO,MAAMC,sBAAsB,GACjC,2EAA2E;AAC7E,OAAO,MAAMC,0BAA0B,GACrC,sFAAsF"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=globals.d.js.map
@@ -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,102 @@
1
+ export const LOCAL_PATH_TO_CIO_NSE_FILES = `node_modules/customerio-expo-plugin/src/helpers/native-files/ios`;
2
+ export const IOS_DEPLOYMENT_TARGET = '13.0';
3
+ export const CIO_PODFILE_REGEX = /pod 'RCT-Folly'/;
4
+ export const CIO_PODFILE_NOTIFICATION_REGEX = /target 'CIONotificationService' do/;
5
+ export const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;
6
+ export const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;
7
+ export const BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;
8
+ export const CIO_PODFILE_POST_INSTALL_REGEX = /post_install do \|installer\|/;
9
+ export const CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = /(- \(BOOL\)application:\(UIApplication \*\)application didFinishLaunchingWithOptions:\(NSDictionary \*\)launchOptions(\s|\n)*?\{)((.|\n)*)\[super(\s)application:application(\s)didFinishLaunchingWithOptions:launchOptions\];/;
10
+ export const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = /return \[super application:application didFailToRegisterForRemoteNotificationsWithError:error\];/;
11
+ export const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX = /(- \(void\)application:\(UIApplication \*\)application didFailToRegisterForRemoteNotificationsWithError:\(NSError \*\)error(\s|\n)*?\{)(.|\n){2}.*\n\}/;
12
+ export const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX = /return \[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken\];/;
13
+ export const CIO_APPDELEGATEDECLARATION_REGEX = /@implementation AppDelegate(.|\n)/;
14
+ export const CIO_APPDELEGATEHEADER_REGEX = /@interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate>/;
15
+ export const DEFAULT_BUNDLE_VERSION = '1';
16
+ export const DEFAULT_BUNDLE_SHORT_VERSION = '1.0';
17
+ export const CIO_TARGET_NAME = 'CustomerIOSDK';
18
+ export const CIO_NOTIFICATION_TARGET_NAME = 'CIONotificationService';
19
+ export const CIO_APPDELEGATEHEADER_SNIPPET = `
20
+ #import <UserNotifications/UserNotifications.h>
21
+
22
+ @interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate, UNUserNotificationCenterDelegate>
23
+ `;
24
+ export const CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = `
25
+ CIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];
26
+ `;
27
+ export const CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = `
28
+ [pnHandlerObj application:application error:error];
29
+ `;
30
+ export const CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = `
31
+ return [pnHandlerObj application:application deviceToken:deviceToken];
32
+ `;
33
+
34
+ // Configure Customerio push notifications SDK by adding to application:didFinishLaunchingWithOptions: delegate method
35
+ // From Braze docs: https://www.customer.io/docs/sdk/react-native/push/#obj-c-push
36
+ export const CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = `
37
+ // Register for push notifications
38
+ [pnHandlerObj registerPushNotification:self];
39
+ `;
40
+
41
+ // Enable push handling - notification response
42
+ export const CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = `
43
+ - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {
44
+ [pnHandlerObj userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
45
+ }`;
46
+
47
+ // Foreground push handling
48
+ export const CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = `
49
+ // show push when the app is in foreground
50
+ - (void)userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification:(UNNotification* )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
51
+ completionHandler( UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound);
52
+ }`;
53
+ export const CIO_PODFILE_NOTIFICATION_SNIPPET = `
54
+ target '${CIO_NOTIFICATION_TARGET_NAME}' do
55
+ pod 'CustomerIO/MessagingPushAPN', '~> 1.2.0-alpha.3'
56
+ end`;
57
+ export const CIO_PODFILE_SNIPPET = `
58
+ pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
59
+ pod 'boost', :podspec => '../node_modules/react-native/third-party-podspecs/boost.podspec'
60
+ pod 'CustomerIO/MessagingPushAPN', '~> 1.2.0-alpha.3'`;
61
+ export const CIO_PODFILE_TARGET_NAMES_SNIPPET = `
62
+ cio_target_names = [
63
+ 'CustomerIOTracking',
64
+ 'CustomerIOCommon',
65
+ 'CustomerIOMessagingPushAPN',
66
+ 'CustomerIOMessagingPush'
67
+ ]`;
68
+ export const CIO_PODFILE_POST_INSTALL_SNIPPET = `
69
+ installer.pods_project.targets.each do |target|
70
+ if cio_target_names.include? target.name
71
+ puts "Modifying target #{target.name}"
72
+
73
+ target.build_configurations.each do |config|
74
+ puts "Setting build config settings for #{target.name}"
75
+ config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
76
+ end
77
+ end
78
+ end`;
79
+ export const CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = `
80
+ cio_target_names = [
81
+ 'CustomerIOTracking',
82
+ 'CustomerIOCommon',
83
+ 'CustomerIOMessagingPushAPN',
84
+ 'CustomerIOMessagingPush'
85
+ ]
86
+
87
+ post_install do |installer|
88
+
89
+ installer.pods_project.targets.each do |target|
90
+ if cio_target_names.include? target.name
91
+ puts "Modifying target #{target.name}"
92
+
93
+ target.build_configurations.each do |config|
94
+ puts "Setting build config settings for #{target.name}"
95
+ config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
96
+ end
97
+ end
98
+ end
99
+ react_native_post_install(installer)
100
+ __apply_Xcode_12_5_M1_post_install_workaround(installer)
101
+ end`;
102
+ //# sourceMappingURL=ios.js.map