customerio-expo-plugin 0.0.2 → 0.0.3
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.
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "customerio-expo-plugin",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Expo config plugin for the Customer IO React Native SDK",
|
|
5
|
+
"main": "build/src/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"files": [
|
|
9
|
+
"build/**/*"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"copy-native-files": "cp -r src/helpers/native-files build/helpers/",
|
|
13
|
+
"build": "rm -rf build && tsc && npm run copy-native-files",
|
|
14
|
+
"build:watch": "npm run build && tsc --watch",
|
|
15
|
+
"clean": "rm -rf build",
|
|
16
|
+
"expo-module": "expo-module",
|
|
17
|
+
"lint": "eslint .",
|
|
18
|
+
"tc": "tsc --noEmit",
|
|
19
|
+
"prepare": "npm run clean && npm run build",
|
|
20
|
+
"prepublishOnly": "npm run tc && npm run lint"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@expo/config-plugins": "^4.1.4",
|
|
24
|
+
"@expo/config-types": "^44.0.0",
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
26
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
27
|
+
"eslint": "^8.14.0",
|
|
28
|
+
"eslint-config-prettier": "^8.5.0",
|
|
29
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
30
|
+
"expo-module-scripts": "^2.0.0",
|
|
31
|
+
"expo-build-properties": "^0.2.0",
|
|
32
|
+
"prettier": "^2.6.2",
|
|
33
|
+
"typescript": "^4.6.4",
|
|
34
|
+
"xcode": "^3.0.1"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = exports.CIO_PODFILE_POST_INSTALL_SNIPPET = exports.CIO_PODFILE_TARGET_NAMES_SNIPPET = exports.CIO_PODFILE_SNIPPET = exports.CIO_PODFILE_NOTIFICATION_SNIPPET = exports.CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = exports.CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = exports.CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = exports.CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = exports.CIO_APPDELEGATEHEADER_SNIPPET = exports.CIO_NOTIFICATION_TARGET_NAME = exports.CIO_TARGET_NAME = exports.DEFAULT_BUNDLE_SHORT_VERSION = exports.DEFAULT_BUNDLE_VERSION = exports.CIO_APPDELEGATEHEADER_REGEX = exports.CIO_APPDELEGATEDECLARATION_REGEX = exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = exports.CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = exports.CIO_PODFILE_POST_INSTALL_REGEX = exports.BUNDLE_VERSION_TEMPLATE_REGEX = exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = exports.CIO_PODFILE_NOTIFICATION_REGEX = exports.CIO_PODFILE_REGEX = exports.IOS_DEPLOYMENT_TARGET = void 0;
|
|
3
|
+
exports.CIO_PODFILE_POST_INSTALL_FALLBACK_SNIPPET = exports.CIO_PODFILE_POST_INSTALL_SNIPPET = exports.CIO_PODFILE_TARGET_NAMES_SNIPPET = exports.CIO_PODFILE_SNIPPET = exports.CIO_PODFILE_NOTIFICATION_SNIPPET = exports.CIO_WILLPRESENTNOTIFICATIONHANDLER_SNIPPET = exports.CIO_DIDRECEIVENOTIFICATIONRESPONSEHANDLER_SNIPPET = exports.CIO_CONFIGURECIOSDKPUSHNOTIFICATION_SNIPPET = exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_SNIPPET = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_SNIPPET = exports.CIO_PUSHNOTIFICATIONHANDLERDECLARATION_SNIPPET = exports.CIO_APPDELEGATEHEADER_SNIPPET = exports.CIO_NOTIFICATION_TARGET_NAME = exports.CIO_TARGET_NAME = exports.DEFAULT_BUNDLE_SHORT_VERSION = exports.DEFAULT_BUNDLE_VERSION = exports.CIO_APPDELEGATEHEADER_REGEX = exports.CIO_APPDELEGATEDECLARATION_REGEX = exports.CIO_DIDREGISTERFORREMOTENOTIFICATIONSWITHDEVICETOKEN_REGEX = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERRORFULL_REGEX = exports.CIO_DIDFAILTOREGISTERFORREMOTENOTIFICATIONSWITHERROR_REGEX = exports.CIO_DIDFINISHLAUNCHINGMETHOD_REGEX = exports.CIO_PODFILE_POST_INSTALL_REGEX = exports.BUNDLE_VERSION_TEMPLATE_REGEX = exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = exports.CIO_PODFILE_NOTIFICATION_REGEX = exports.CIO_PODFILE_REGEX = exports.IOS_DEPLOYMENT_TARGET = exports.LOCAL_PATH_TO_CIO_NSE_FILES = void 0;
|
|
4
|
+
const package_json_1 = require("../../../package.json");
|
|
5
|
+
exports.LOCAL_PATH_TO_CIO_NSE_FILES = `node_modules/${package_json_1.name}/build/ios`;
|
|
4
6
|
exports.IOS_DEPLOYMENT_TARGET = '13.0';
|
|
5
7
|
exports.CIO_PODFILE_REGEX = /pod 'RCT-Folly'/;
|
|
6
8
|
exports.CIO_PODFILE_NOTIFICATION_REGEX = /target 'CIONotificationService' do/;
|
|
@@ -7,9 +7,7 @@ exports.withCioAppdelegateXcodeProject = void 0;
|
|
|
7
7
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const xcode_1 = __importDefault(require("xcode"));
|
|
10
|
-
// import { name as thisPackageName } from '../../package.json';
|
|
11
10
|
const ios_1 = require("../helpers/constants/ios");
|
|
12
|
-
// const LOCAL_PATH_TO_NSE_FILES = `node_modules/${thisPackageName}/build/${appName}`;
|
|
13
11
|
const addNotificationServiceExtensionFile = async (options) => {
|
|
14
12
|
const { iosPath, appName } = options;
|
|
15
13
|
const projPath = `${iosPath}/${appName}.xcodeproj/project.pbxproj`;
|
|
@@ -23,9 +21,8 @@ const addNotificationServiceExtensionFile = async (options) => {
|
|
|
23
21
|
});
|
|
24
22
|
const file = 'PushNotification.swift';
|
|
25
23
|
const getTargetFile = (filename) => `${iosPath}/${appName}/${filename}`;
|
|
26
|
-
const sourceDir = 'plugin/helpers/ios';
|
|
27
24
|
const targetFile = getTargetFile(file);
|
|
28
|
-
fs_1.default.copyFileSync(`${
|
|
25
|
+
fs_1.default.copyFileSync(`${ios_1.LOCAL_PATH_TO_CIO_NSE_FILES}/${file}`, targetFile);
|
|
29
26
|
// Create new PBXGroup for the extension
|
|
30
27
|
const extGroup = xcodeProject.addPbxGroup([file], appName, appName);
|
|
31
28
|
// Add the new PBXGroup to the top level group. This makes the
|
|
@@ -7,11 +7,9 @@ exports.withCioNotificationsXcodeProject = void 0;
|
|
|
7
7
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const xcode_1 = __importDefault(require("xcode"));
|
|
10
|
-
// import { name as thisPackageName } from '../../package.json';
|
|
11
10
|
const ios_1 = require("../helpers/constants/ios");
|
|
12
11
|
const injectCIOPodfileCode_1 = require("../helpers/utils/injectCIOPodfileCode");
|
|
13
12
|
const PLIST_FILENAME = `${ios_1.CIO_NOTIFICATION_TARGET_NAME}-Info.plist`;
|
|
14
|
-
// const LOCAL_PATH_TO_NSE_FILES = `node_modules/${thisPackageName}/build/${CIO_NOTIFICATION_TARGET_NAME}`;
|
|
15
13
|
const TARGETED_DEVICE_FAMILY = `"1,2"`;
|
|
16
14
|
const addNotificationServiceExtension = async (options) => {
|
|
17
15
|
const { appleTeamId, bundleIdentifier, bundleShortVersion, bundleVersion, iosPath, appName, iosDeploymentTarget, } = options;
|
|
@@ -32,10 +30,9 @@ const addNotificationServiceExtension = async (options) => {
|
|
|
32
30
|
'CIONotificationService.m',
|
|
33
31
|
];
|
|
34
32
|
const getTargetFile = (filename) => `${iosPath}/${ios_1.CIO_NOTIFICATION_TARGET_NAME}/${filename}`;
|
|
35
|
-
const sourceDir = 'plugin/helpers/ios';
|
|
36
33
|
files.forEach((filename) => {
|
|
37
34
|
const targetFile = getTargetFile(filename);
|
|
38
|
-
fs_1.default.copyFileSync(`${
|
|
35
|
+
fs_1.default.copyFileSync(`${ios_1.LOCAL_PATH_TO_CIO_NSE_FILES}/${filename}`, targetFile);
|
|
39
36
|
});
|
|
40
37
|
/* MODIFY COPIED EXTENSION FILES */
|
|
41
38
|
const infoPlistTargetFile = getTargetFile(PLIST_FILENAME);
|