mindbox-expo-plugin 1.0.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.
- package/LICENCE.md +74 -0
- package/README.md +7 -0
- package/app.plugin.js +1 -0
- package/build/android/utils/fileUtils.d.ts +2 -0
- package/build/android/utils/fileUtils.js +84 -0
- package/build/android/utils/gradleUtils.d.ts +3 -0
- package/build/android/utils/gradleUtils.js +61 -0
- package/build/android/utils/index.d.ts +5 -0
- package/build/android/utils/index.js +21 -0
- package/build/android/utils/manifestUtils.d.ts +8 -0
- package/build/android/utils/manifestUtils.js +173 -0
- package/build/android/utils/resourceUtils.d.ts +14 -0
- package/build/android/utils/resourceUtils.js +187 -0
- package/build/android/withExpoNotification.d.ts +3 -0
- package/build/android/withExpoNotification.js +186 -0
- package/build/android/withFirebase.d.ts +3 -0
- package/build/android/withFirebase.js +64 -0
- package/build/android/withHuawei.d.ts +3 -0
- package/build/android/withHuawei.js +83 -0
- package/build/android/withMindboxDependencies.d.ts +3 -0
- package/build/android/withMindboxDependencies.js +29 -0
- package/build/android/withResources.d.ts +3 -0
- package/build/android/withResources.js +28 -0
- package/build/android/withRustore.d.ts +3 -0
- package/build/android/withRustore.js +22 -0
- package/build/helpers/androidConstants.d.ts +20 -0
- package/build/helpers/androidConstants.js +28 -0
- package/build/helpers/easCredentialsConfig.d.ts +4 -0
- package/build/helpers/easCredentialsConfig.js +45 -0
- package/build/helpers/iosConstants.d.ts +48 -0
- package/build/helpers/iosConstants.js +107 -0
- package/build/index.d.ts +7 -0
- package/build/index.js +18 -0
- package/build/ios/withAppDelegate.d.ts +4 -0
- package/build/ios/withAppDelegate.js +166 -0
- package/build/ios/withEntitlements.d.ts +4 -0
- package/build/ios/withEntitlements.js +54 -0
- package/build/ios/withExtensions.d.ts +4 -0
- package/build/ios/withExtensions.js +374 -0
- package/build/ios/withInfoPlist.d.ts +4 -0
- package/build/ios/withInfoPlist.js +50 -0
- package/build/ios/withPodfile.d.ts +4 -0
- package/build/ios/withPodfile.js +120 -0
- package/build/mindboxTypes.d.ts +25 -0
- package/build/mindboxTypes.js +8 -0
- package/build/runtime/index.d.ts +1 -0
- package/build/runtime/index.js +5 -0
- package/build/utils/errorUtils.d.ts +5 -0
- package/build/utils/errorUtils.js +40 -0
- package/build/utils/isMindboxPush.d.ts +1 -0
- package/build/utils/isMindboxPush.js +24 -0
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +86 -0
- package/build/withMindbox.d.ts +6 -0
- package/build/withMindbox.js +19 -0
- package/build/withMindboxAndroid.d.ts +3 -0
- package/build/withMindboxAndroid.js +34 -0
- package/build/withMindboxIos.d.ts +3 -0
- package/build/withMindboxIos.js +38 -0
- package/package.json +82 -0
- package/src/android/support/MindboxExpoFirebaseService.kt +23 -0
- package/src/ios/support/MindboxNotificationContentExtension/Info.plist +40 -0
- package/src/ios/support/MindboxNotificationContentExtension/MindboxNotificationContentExtension.entitlements +13 -0
- package/src/ios/support/MindboxNotificationContentExtension/NotificationViewController.swift +14 -0
- package/src/ios/support/MindboxNotificationServiceExtension/Info.plist +33 -0
- package/src/ios/support/MindboxNotificationServiceExtension/MindboxNotificationServiceExtension.entitlements +12 -0
- package/src/ios/support/MindboxNotificationServiceExtension/NotificationService.swift +17 -0
package/LICENCE.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# License Agreement (Open License) Granting the Right to Use Software
|
|
2
|
+
|
|
3
|
+
## 1. Terms and Definitions
|
|
4
|
+
|
|
5
|
+
1.1 In the Agreement terms and definitions are used in the following meanings:
|
|
6
|
+
|
|
7
|
+
- **Agreement** – an agreement for subscription of Mindbox / Maestra service (software) between the User and the Company;
|
|
8
|
+
- **Use** – the scope of the User's rights under the Agreement;
|
|
9
|
+
- **User** – a legal entity or an individual who uses the Software;
|
|
10
|
+
- **Company** – Mindbox KZ LLC or the rights holder of Mindbox / Maestra service (software) or any Mindbox / Maestra company which is authorized to sell Mindbox / Maestra service (software) by the rights holder of Mindbox / Maestra service (software);
|
|
11
|
+
- **Software (Source code)** – the Mindbox / Maestra SDK software for transferring data from the mobile application to CDP Mindbox / Maestra;
|
|
12
|
+
- **Parties / Party** – the Company and/or the User;
|
|
13
|
+
- **Non-Commercial Use** – Use of the Software without the purpose of making a profit.
|
|
14
|
+
- **Commercial Use** – Use of the Software for the purpose of making a profit.
|
|
15
|
+
|
|
16
|
+
## 2. Subject of the Agreement
|
|
17
|
+
|
|
18
|
+
2.1 Under the Agreement the Company provides an unlimited number of Users with a simple (non-exclusive) license to Use the Software within the limits provided for in the Agreement.
|
|
19
|
+
|
|
20
|
+
2.2 The Agreement is an adhesion agreement and is posted in the repository of the Company’s Software on [GitHub](https://github.com/) so that the terms are available to an indefinite number of persons and the User can familiarize themselves with them before starting the Use of the Software. Any use of the Software by the User including those not permitted under the Agreement including but not limited to copying, reproduction, processing of the source code, installation and download of the Software will be considered acceptance of the terms of the Agreement.
|
|
21
|
+
|
|
22
|
+
## 3. Rights and Obligations of the Parties
|
|
23
|
+
|
|
24
|
+
3.1 The Company provides the Source code of the Software at the following links:
|
|
25
|
+
|
|
26
|
+
- **iOS**:
|
|
27
|
+
- Repository: [https://github.com/mindbox-cloud/ios-sdk](https://github.com/mindbox-cloud/ios-sdk)
|
|
28
|
+
- Package Manager: [https://cocoapods.org/pods/Mindbox](https://cocoapods.org/pods/Mindbox)
|
|
29
|
+
- **Android**:
|
|
30
|
+
- Repository: [https://github.com/mindbox-cloud/android-sdk](https://github.com/mindbox-cloud/android-sdk)
|
|
31
|
+
- Package Manager: [https://central.sonatype.com/namespace/cloud.mindbox](https://central.sonatype.com/namespace/cloud.mindbox)
|
|
32
|
+
|
|
33
|
+
The source code in the package manager and in the repository in the "Master" branch is "production ready".
|
|
34
|
+
|
|
35
|
+
The user understands that the source code in the repository that is not in the "Master" branch is not "production ready".
|
|
36
|
+
|
|
37
|
+
The Software (Source code) is provided to the User on an "as is" basis, that is, the Company does not ensure the functionality of the code and does not offer any guarantees regarding the error-free and uninterrupted operation of the Software or its suitability for the User's purposes and expectations.
|
|
38
|
+
|
|
39
|
+
3.2 The User has the right to use the Software (Source code) for Non-Commercial Use without an Agreement with the Company to the following extent:
|
|
40
|
+
|
|
41
|
+
- Reading the source code by a person.
|
|
42
|
+
|
|
43
|
+
3.3 The User may use the Software (Source code) for Commercial Use only if there is an Agreement with the Company and to the following extent:
|
|
44
|
+
|
|
45
|
+
- Reading the source code by a person;
|
|
46
|
+
- Copying, reproducing the source code "production ready" (Software) inside the User's software (mobile application) for integration with the software of the Company — Mindbox / Maestra.
|
|
47
|
+
|
|
48
|
+
After the termination of the Agreement, the User has the right not to delete the Software (Source code) or a copy thereof, provided that the Software (Source code) is prohibited from being executed to ensure the possibility of easily resuming its Use. The User has the right to resume the Use of the saved Software (Source code) upon entering into a new Agreement.
|
|
49
|
+
|
|
50
|
+
3.4 To obtain additional rights not provided for in the Agreement, including for sending requests and proposals, the User has the right to contact the Company through communication channels known to him, for example, by using "pull request", "issue" on [GitHub](https://github.com/) or sending an email to info@mindbox.cloud – for Mindbox Software / support@maestra.io – for Maestra Software.
|
|
51
|
+
|
|
52
|
+
By sending a request to merge the proposed code into "production ready" through a "pull request" on [GitHub](https://github.com/), the User represents and warrants to the Company that they do not violate the rights of third parties and also transfer the rights to the proposed code in favor of the Company in exchange for being granted the rights of Use under the Agreement without receiving any monetary compensation.
|
|
53
|
+
|
|
54
|
+
3.5 The User assures and guarantees to the Company that they will not use the Software (Source code) out of the scope of the rights and (or) on other terms than provided for in the Agreement, including will not use it for Commercial purposes without the Agreement with the Company, will not grant or alienate to third parties the rights to use the Software or a new result of intellectual activity created on the basis of the Software.
|
|
55
|
+
|
|
56
|
+
## 4. Limitation of Liability of the Company
|
|
57
|
+
|
|
58
|
+
4.1 Since the rights to Use Software (Source code) are provided to the User free of charge and on an "as is" basis, the Company shall not be liable for losses caused to the User and third parties as a result of the Use or inability to Use the Software, including if the Company does not work error-free, uninterrupted, or does not meet the User’s purposes and expectations.
|
|
59
|
+
|
|
60
|
+
4.2 The Company does not reimburse the User for indirect, indirect losses or lost profits. The total maximum liability of the Company under the Agreement is limited to 1 (one) USD (United States Dollar) or its equivalent in other currencies.
|
|
61
|
+
|
|
62
|
+
## 5. Governing Law and Dispute Resolution
|
|
63
|
+
|
|
64
|
+
5.1 This Agreement shall be governed, construed, and interpreted in accordance with the laws of the State of Delaware, USA, without regard to conflict of law rules or principles (whether of Delaware or any other jurisdiction) that would cause the Agreement of the laws of any other jurisdiction.
|
|
65
|
+
|
|
66
|
+
5.2 Any dispute arising under this Agreement or any other agreement resulting therefrom and relating thereto shall be brought before the Delaware Court of Chancery in case the Company is located in the USA or any other competent state court at the place of business of the Company, notwithstanding the Company’s right to have such dispute brought before any other competent court.
|
|
67
|
+
|
|
68
|
+
## 6. Final Provisions
|
|
69
|
+
|
|
70
|
+
6.1 The Agreement may be amended by the Company at any time without any restrictions and without special notice to the User. The new version of the Agreement comes into force from the date of its posting in the repository of the Company’s Software on [GitHub](https://github.com/) or from the date of its bringing to the attention of the User by the Company in another convenient form.
|
|
71
|
+
|
|
72
|
+
6.2 For cases of Non-Commercial use of the Software, the Agreement is valid indefinitely.
|
|
73
|
+
|
|
74
|
+
6.3 For cases of Commercial use of the Software, the Agreement is valid until the termination of the Agreement.
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Mindbox SDK for React Native Expo
|
|
2
|
+
|
|
3
|
+
The Mindbox SDK allows developers to integrate mobile push notifications, in-app messages, and client events into your React Native Expo projects.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
These instructions will help you integrate the Mindbox SDK into your React Native Expo app.
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./build/withMindbox").default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.copyKotlinFile = exports.copyServiceJsonFile = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const copyServiceJsonFile = async (sourcePath, targetPath, fileName) => {
|
|
40
|
+
try {
|
|
41
|
+
if (!fs.existsSync(sourcePath)) {
|
|
42
|
+
throw new Error(`Source file not found: ${sourcePath}`);
|
|
43
|
+
}
|
|
44
|
+
const sourceJson = fs.readFileSync(sourcePath, { encoding: "utf8" });
|
|
45
|
+
const targetDir = path.dirname(targetPath);
|
|
46
|
+
if (!fs.existsSync(targetDir)) {
|
|
47
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
48
|
+
}
|
|
49
|
+
if (fs.existsSync(targetPath)) {
|
|
50
|
+
const existing = fs.readFileSync(targetPath, { encoding: "utf8" });
|
|
51
|
+
if (existing.trim() === sourceJson.trim()) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
fs.writeFileSync(targetPath, sourceJson, { encoding: "utf8" });
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw new Error(`Failed to copy ${fileName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.copyServiceJsonFile = copyServiceJsonFile;
|
|
62
|
+
const copyKotlinFile = async (sourcePath, targetPath, fileName) => {
|
|
63
|
+
try {
|
|
64
|
+
if (!fs.existsSync(sourcePath)) {
|
|
65
|
+
throw new Error(`Source file not found: ${sourcePath}`);
|
|
66
|
+
}
|
|
67
|
+
const sourceContent = fs.readFileSync(sourcePath, { encoding: "utf8" });
|
|
68
|
+
const targetDir = path.dirname(targetPath);
|
|
69
|
+
if (!fs.existsSync(targetDir)) {
|
|
70
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
if (fs.existsSync(targetPath)) {
|
|
73
|
+
const existing = fs.readFileSync(targetPath, { encoding: "utf8" });
|
|
74
|
+
if (existing.trim() === sourceContent.trim()) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
fs.writeFileSync(targetPath, sourceContent, { encoding: "utf8" });
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
throw new Error(`Failed to copy ${fileName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
exports.copyKotlinFile = copyKotlinFile;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const addMavenRepository: (buildGradle: any, mavenUrl: string, mavenRepoConfig: string) => void;
|
|
2
|
+
export declare const addClasspathDependency: (buildGradle: any, classpathDependency: string, classpathMarker: string) => void;
|
|
3
|
+
export declare const addPluginToGradle: (buildGradle: any, pluginLine: string, pluginMarker: string, insertAtTop?: boolean) => void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addPluginToGradle = exports.addClasspathDependency = exports.addMavenRepository = void 0;
|
|
4
|
+
const addMavenRepository = (buildGradle, mavenUrl, mavenRepoConfig) => {
|
|
5
|
+
let contents = buildGradle.modResults.contents;
|
|
6
|
+
const buildscriptReposRegex = /(buildscript\s*\{[\s\S]*?repositories\s*\{)([\s\S]*?)(\n\s*\})/m;
|
|
7
|
+
contents = contents.replace(buildscriptReposRegex, (_match, p1, p2, p3) => {
|
|
8
|
+
if (p2.includes(mavenUrl)) {
|
|
9
|
+
return `${p1}${p2}${p3}`;
|
|
10
|
+
}
|
|
11
|
+
return `${p1}${p2}\n${mavenRepoConfig}\n${p3}`;
|
|
12
|
+
});
|
|
13
|
+
const allprojectsReposRegex = /(allprojects\s*\{[\s\S]*?repositories\s*\{)([\s\S]*?)(\n\s*\})/m;
|
|
14
|
+
contents = contents.replace(allprojectsReposRegex, (_match, p1, p2, p3) => {
|
|
15
|
+
if (p2.includes(mavenUrl)) {
|
|
16
|
+
return `${p1}${p2}${p3}`;
|
|
17
|
+
}
|
|
18
|
+
return `${p1}${p2}\n${mavenRepoConfig}\n${p3}`;
|
|
19
|
+
});
|
|
20
|
+
buildGradle.modResults.contents = contents;
|
|
21
|
+
};
|
|
22
|
+
exports.addMavenRepository = addMavenRepository;
|
|
23
|
+
const addClasspathDependency = (buildGradle, classpathDependency, classpathMarker) => {
|
|
24
|
+
const contents = buildGradle.modResults.contents;
|
|
25
|
+
if (contents.includes(classpathMarker)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const buildscriptDepsRegex = /(buildscript[\s\S]*?dependencies\s*\{)([\s\S]*?)(\n\s*\})/m;
|
|
29
|
+
const buildscriptDepsMatch = contents.match(buildscriptDepsRegex);
|
|
30
|
+
if (buildscriptDepsMatch) {
|
|
31
|
+
buildGradle.modResults.contents = contents.replace(buildscriptDepsRegex, `$1\n${classpathDependency}$2$3`);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.addClasspathDependency = addClasspathDependency;
|
|
35
|
+
const addPluginToGradle = (buildGradle, pluginLine, pluginMarker, insertAtTop = false) => {
|
|
36
|
+
var _a;
|
|
37
|
+
const contents = buildGradle.modResults.contents;
|
|
38
|
+
if (contents.includes(pluginMarker)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (contents.startsWith(`${pluginLine}\n`) ||
|
|
42
|
+
contents.startsWith(pluginLine)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (insertAtTop) {
|
|
46
|
+
buildGradle.modResults.contents = `${pluginLine}\n${contents}`;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const applyRegex = /^apply plugin:\s*["'][^"']+["'].*$/gm;
|
|
50
|
+
const matches = [...contents.matchAll(applyRegex)];
|
|
51
|
+
if (matches.length > 0) {
|
|
52
|
+
const last = matches[matches.length - 1];
|
|
53
|
+
const insertPos = ((_a = last.index) !== null && _a !== void 0 ? _a : 0) + last[0].length;
|
|
54
|
+
buildGradle.modResults.contents = `${contents.slice(0, insertPos)}\n${pluginLine}\n${contents.slice(insertPos)}`;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
buildGradle.modResults.contents = `${pluginLine}\n${contents}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.addPluginToGradle = addPluginToGradle;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./fileUtils"), exports);
|
|
18
|
+
__exportStar(require("./gradleUtils"), exports);
|
|
19
|
+
__exportStar(require("./manifestUtils"), exports);
|
|
20
|
+
__exportStar(require("../../utils/errorUtils"), exports);
|
|
21
|
+
__exportStar(require("./resourceUtils"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const extractPackageName: (buildGradlePath: string) => string | null;
|
|
2
|
+
export declare const extractAppIdFromAgc: (agcPath: string, packageName: string) => string | null;
|
|
3
|
+
export declare const addManifestMetaData: (manifestConfig: any, name: string, value: string, valueType?: "value" | "resource") => any;
|
|
4
|
+
export declare const ensureToolsNamespace: (manifestConfig: any) => any;
|
|
5
|
+
export declare const removeServiceFromManifest: (manifestConfig: any, serviceName: string) => any;
|
|
6
|
+
export declare const addServiceToManifest: (manifestConfig: any, serviceName: string, exported?: boolean, intentFilters?: Array<{
|
|
7
|
+
action: string;
|
|
8
|
+
}>) => any;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.addServiceToManifest = exports.removeServiceFromManifest = exports.ensureToolsNamespace = exports.addManifestMetaData = exports.extractAppIdFromAgc = exports.extractPackageName = void 0;
|
|
37
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const androidConstants_1 = require("../../helpers/androidConstants");
|
|
40
|
+
const extractPackageName = (buildGradlePath) => {
|
|
41
|
+
if (!fs.existsSync(buildGradlePath)) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const gradle = fs.readFileSync(buildGradlePath, { encoding: "utf8" });
|
|
45
|
+
const appIdMatch = gradle.match(/applicationId\s+['"]([^'"]+)['"]/);
|
|
46
|
+
if (appIdMatch) {
|
|
47
|
+
return appIdMatch[androidConstants_1.REGEX_CAPTURE_GROUPS.FIRST];
|
|
48
|
+
}
|
|
49
|
+
const nsMatch = gradle.match(/namespace\s+['"]([^'"]+)['"]/);
|
|
50
|
+
if (nsMatch) {
|
|
51
|
+
return nsMatch[androidConstants_1.REGEX_CAPTURE_GROUPS.FIRST];
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
};
|
|
55
|
+
exports.extractPackageName = extractPackageName;
|
|
56
|
+
const extractAppIdFromAgc = (agcPath, packageName) => {
|
|
57
|
+
var _a, _b, _c, _d, _e, _f;
|
|
58
|
+
if (!fs.existsSync(agcPath)) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const json = JSON.parse(fs.readFileSync(agcPath, { encoding: "utf8" }));
|
|
63
|
+
if (((_a = json === null || json === void 0 ? void 0 : json.client) === null || _a === void 0 ? void 0 : _a.package_name) === packageName &&
|
|
64
|
+
((_b = json === null || json === void 0 ? void 0 : json.client) === null || _b === void 0 ? void 0 : _b.app_id)) {
|
|
65
|
+
return String(json.client.app_id);
|
|
66
|
+
}
|
|
67
|
+
if (((_c = json === null || json === void 0 ? void 0 : json.app_info) === null || _c === void 0 ? void 0 : _c.package_name) === packageName &&
|
|
68
|
+
((_d = json === null || json === void 0 ? void 0 : json.app_info) === null || _d === void 0 ? void 0 : _d.app_id)) {
|
|
69
|
+
return String(json.app_info.app_id);
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(json === null || json === void 0 ? void 0 : json.appInfos)) {
|
|
72
|
+
const matchItem = json.appInfos.find((it) => {
|
|
73
|
+
var _a;
|
|
74
|
+
return (it === null || it === void 0 ? void 0 : it.package_name) === packageName ||
|
|
75
|
+
((_a = it === null || it === void 0 ? void 0 : it.app_info) === null || _a === void 0 ? void 0 : _a.package_name) === packageName;
|
|
76
|
+
});
|
|
77
|
+
if (matchItem) {
|
|
78
|
+
if ((_e = matchItem === null || matchItem === void 0 ? void 0 : matchItem.client) === null || _e === void 0 ? void 0 : _e.app_id)
|
|
79
|
+
return String(matchItem.client.app_id);
|
|
80
|
+
else if ((_f = matchItem === null || matchItem === void 0 ? void 0 : matchItem.app_info) === null || _f === void 0 ? void 0 : _f.app_id)
|
|
81
|
+
return String(matchItem.app_info.app_id);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.extractAppIdFromAgc = extractAppIdFromAgc;
|
|
91
|
+
const addManifestMetaData = (manifestConfig, name, value, valueType = "value") => {
|
|
92
|
+
try {
|
|
93
|
+
const mainApp = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(manifestConfig.modResults);
|
|
94
|
+
config_plugins_1.AndroidConfig.Manifest.removeMetaDataItemFromMainApplication(mainApp, name);
|
|
95
|
+
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApp, name, value, valueType);
|
|
96
|
+
return manifestConfig;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
throw new Error(`Failed to add meta-data ${name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.addManifestMetaData = addManifestMetaData;
|
|
103
|
+
const ensureToolsNamespace = (manifestConfig) => {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
try {
|
|
106
|
+
const manifestElement = (_a = manifestConfig === null || manifestConfig === void 0 ? void 0 : manifestConfig.modResults) === null || _a === void 0 ? void 0 : _a.manifest;
|
|
107
|
+
if (!manifestElement)
|
|
108
|
+
return manifestConfig;
|
|
109
|
+
const attrs = (_b = manifestElement.$) !== null && _b !== void 0 ? _b : (manifestElement.$ = {});
|
|
110
|
+
attrs["xmlns:tools"] =
|
|
111
|
+
(_c = attrs["xmlns:tools"]) !== null && _c !== void 0 ? _c : "http://schemas.android.com/tools";
|
|
112
|
+
return manifestConfig;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
throw new Error(`Failed to ensure tools namespace: ${error instanceof Error ? error.message : String(error)}`);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
exports.ensureToolsNamespace = ensureToolsNamespace;
|
|
119
|
+
const removeServiceFromManifest = (manifestConfig, serviceName) => {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
try {
|
|
122
|
+
const mainApp = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(manifestConfig.modResults);
|
|
123
|
+
const services = (_a = mainApp.service) !== null && _a !== void 0 ? _a : [];
|
|
124
|
+
const index = services.findIndex((s) => { var _a; return ((_a = s.$) === null || _a === void 0 ? void 0 : _a["android:name"]) === serviceName; });
|
|
125
|
+
if (index >= 0) {
|
|
126
|
+
const attrs = (_b = services[index].$) !== null && _b !== void 0 ? _b : (services[index].$ = {});
|
|
127
|
+
attrs["tools:node"] = "remove";
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
services.push({
|
|
131
|
+
$: {
|
|
132
|
+
"android:name": serviceName,
|
|
133
|
+
"tools:node": "remove",
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
mainApp.service = services;
|
|
138
|
+
return manifestConfig;
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
throw new Error(`Failed to remove service ${serviceName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
exports.removeServiceFromManifest = removeServiceFromManifest;
|
|
145
|
+
const addServiceToManifest = (manifestConfig, serviceName, exported = false, intentFilters) => {
|
|
146
|
+
var _a;
|
|
147
|
+
try {
|
|
148
|
+
const mainApp = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(manifestConfig.modResults);
|
|
149
|
+
const services = (_a = mainApp.service) !== null && _a !== void 0 ? _a : [];
|
|
150
|
+
const serviceElement = {
|
|
151
|
+
$: {
|
|
152
|
+
"android:name": serviceName,
|
|
153
|
+
"android:exported": String(exported),
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
if (intentFilters === null || intentFilters === void 0 ? void 0 : intentFilters.length) {
|
|
157
|
+
serviceElement["intent-filter"] = intentFilters.map(({ action }) => ({
|
|
158
|
+
action: [{ $: { "android:name": action } }],
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
const index = services.findIndex((s) => { var _a; return ((_a = s.$) === null || _a === void 0 ? void 0 : _a["android:name"]) === serviceName; });
|
|
162
|
+
if (index >= 0)
|
|
163
|
+
services[index] = serviceElement;
|
|
164
|
+
else
|
|
165
|
+
services.push(serviceElement);
|
|
166
|
+
mainApp.service = services;
|
|
167
|
+
return manifestConfig;
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
throw new Error(`Failed to add service ${serviceName}: ${error instanceof Error ? error.message : String(error)}`);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
exports.addServiceToManifest = addServiceToManifest;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type ChannelValues = {
|
|
2
|
+
androidChannelId?: string;
|
|
3
|
+
androidChannelName?: string;
|
|
4
|
+
androidChannelDescription?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const getAndroidResDir: (androidProjectRoot: string) => string;
|
|
7
|
+
export declare const writeMindboxStringsResources: (androidProjectRoot: string, values: ChannelValues) => Promise<boolean>;
|
|
8
|
+
export declare const writeMindboxColorResource: (androidProjectRoot: string, iconColor?: string) => Promise<boolean>;
|
|
9
|
+
export type CopyIconResult = {
|
|
10
|
+
resourceName: string;
|
|
11
|
+
resourceRef: string;
|
|
12
|
+
} | null;
|
|
13
|
+
export declare const copyNotificationIcon: (projectRoot: string, androidProjectRoot: string, sourceRelativePath?: string) => Promise<CopyIconResult>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.copyNotificationIcon = exports.writeMindboxColorResource = exports.writeMindboxStringsResources = exports.getAndroidResDir = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const errorUtils_1 = require("../../utils/errorUtils");
|
|
40
|
+
const VALUES_DIR_NAME = "values";
|
|
41
|
+
const STRINGS_FILE_NAME = "strings.xml";
|
|
42
|
+
const COLORS_FILE_NAME = "colors.xml";
|
|
43
|
+
const DRAWABLE_DIR_NAME = "drawable";
|
|
44
|
+
const DRAWABLE_ICON_NAME = "mindbox_notification_small_icon";
|
|
45
|
+
const getAndroidResDir = (androidProjectRoot) => {
|
|
46
|
+
return path.join(androidProjectRoot, "app", "src", "main", "res");
|
|
47
|
+
};
|
|
48
|
+
exports.getAndroidResDir = getAndroidResDir;
|
|
49
|
+
const ensureDir = (dir) => {
|
|
50
|
+
if (!fs.existsSync(dir)) {
|
|
51
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const escapeXml = (value) => {
|
|
55
|
+
return value
|
|
56
|
+
.replace(/&/g, "&")
|
|
57
|
+
.replace(/</g, "<")
|
|
58
|
+
.replace(/>/g, ">")
|
|
59
|
+
.replace(/"/g, """)
|
|
60
|
+
.replace(/'/g, "'");
|
|
61
|
+
};
|
|
62
|
+
const ensureResourceFile = (filePath) => {
|
|
63
|
+
const dir = path.dirname(filePath);
|
|
64
|
+
ensureDir(dir);
|
|
65
|
+
if (!fs.existsSync(filePath)) {
|
|
66
|
+
const content = [
|
|
67
|
+
`<?xml version="1.0" encoding="utf-8"?>`,
|
|
68
|
+
`<resources>`,
|
|
69
|
+
`</resources>`,
|
|
70
|
+
``
|
|
71
|
+
].join("\n");
|
|
72
|
+
fs.writeFileSync(filePath, content, { encoding: "utf8" });
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const upsertResourceLines = (filePath, lines) => {
|
|
76
|
+
ensureResourceFile(filePath);
|
|
77
|
+
const original = fs.readFileSync(filePath, { encoding: "utf8" });
|
|
78
|
+
const resourceNames = lines.map((line) => {
|
|
79
|
+
const match = line.match(/name=\"([^\"]+)\"/);
|
|
80
|
+
return match ? match[1] : null;
|
|
81
|
+
}).filter(Boolean);
|
|
82
|
+
const filtered = original
|
|
83
|
+
.split("\n")
|
|
84
|
+
.filter((line) => {
|
|
85
|
+
if (!line.includes("name="))
|
|
86
|
+
return true;
|
|
87
|
+
const match = line.match(/name=\"([^\"]+)\"/);
|
|
88
|
+
if (!match)
|
|
89
|
+
return true;
|
|
90
|
+
return !resourceNames.includes(match[1]);
|
|
91
|
+
});
|
|
92
|
+
const closingIndex = filtered.findIndex((l) => l.trim() === "</resources>");
|
|
93
|
+
if (closingIndex === -1) {
|
|
94
|
+
const content = [
|
|
95
|
+
`<?xml version="1.0" encoding="utf-8"?>`,
|
|
96
|
+
`<resources>`,
|
|
97
|
+
...lines,
|
|
98
|
+
`</resources>`,
|
|
99
|
+
``
|
|
100
|
+
].join("\n");
|
|
101
|
+
fs.writeFileSync(filePath, content, { encoding: "utf8" });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const updated = [
|
|
105
|
+
...filtered.slice(0, closingIndex),
|
|
106
|
+
...lines,
|
|
107
|
+
...filtered.slice(closingIndex),
|
|
108
|
+
].join("\n");
|
|
109
|
+
if (lines.length > 0 || updated.trim() !== original.trim()) {
|
|
110
|
+
fs.writeFileSync(filePath, updated, { encoding: "utf8" });
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const writeMindboxStringsResources = async (androidProjectRoot, values) => {
|
|
114
|
+
const { androidChannelId, androidChannelName, androidChannelDescription } = values;
|
|
115
|
+
const entries = [];
|
|
116
|
+
if (androidChannelId)
|
|
117
|
+
entries.push(` <string name="mindbox_default_channel_id">${escapeXml(androidChannelId)}</string>`);
|
|
118
|
+
if (androidChannelName)
|
|
119
|
+
entries.push(` <string name="mindbox_default_channel_name">${escapeXml(androidChannelName)}</string>`);
|
|
120
|
+
if (androidChannelDescription)
|
|
121
|
+
entries.push(` <string name="mindbox_default_channel_description">${escapeXml(androidChannelDescription)}</string>`);
|
|
122
|
+
if (entries.length === 0) {
|
|
123
|
+
(0, errorUtils_1.logWarning)("write strings.xml", "no string values provided, skipping update");
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const resDir = (0, exports.getAndroidResDir)(androidProjectRoot);
|
|
127
|
+
const stringsPath = path.join(resDir, VALUES_DIR_NAME, STRINGS_FILE_NAME);
|
|
128
|
+
await (0, errorUtils_1.withErrorHandling)("write strings.xml", async () => {
|
|
129
|
+
upsertResourceLines(stringsPath, entries);
|
|
130
|
+
}, { path: stringsPath });
|
|
131
|
+
return true;
|
|
132
|
+
};
|
|
133
|
+
exports.writeMindboxStringsResources = writeMindboxStringsResources;
|
|
134
|
+
const writeMindboxColorResource = async (androidProjectRoot, iconColor) => {
|
|
135
|
+
if (!iconColor) {
|
|
136
|
+
(0, errorUtils_1.logWarning)("write colors.xml", "no color provided, skipping update");
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const entry = ` <color name=\"mindbox_default_notification_color\">${escapeXml(iconColor)}</color>`;
|
|
140
|
+
const resDir = (0, exports.getAndroidResDir)(androidProjectRoot);
|
|
141
|
+
const colorsPath = path.join(resDir, VALUES_DIR_NAME, COLORS_FILE_NAME);
|
|
142
|
+
await (0, errorUtils_1.withErrorHandling)("write colors.xml", async () => {
|
|
143
|
+
upsertResourceLines(colorsPath, [entry]);
|
|
144
|
+
}, { path: colorsPath });
|
|
145
|
+
return true;
|
|
146
|
+
};
|
|
147
|
+
exports.writeMindboxColorResource = writeMindboxColorResource;
|
|
148
|
+
const validateIconExtension = (ext) => {
|
|
149
|
+
const allowed = [".png", ".xml"];
|
|
150
|
+
if (!allowed.includes(ext)) {
|
|
151
|
+
throw new Error(`Unsupported icon extension: ${ext}. Use .png or .xml`);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const copyNotificationIcon = async (projectRoot, androidProjectRoot, sourceRelativePath) => {
|
|
155
|
+
if (!sourceRelativePath) {
|
|
156
|
+
(0, errorUtils_1.logWarning)("copy notification icon", "no source path provided, skipping update");
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
const sourcePath = path.resolve(projectRoot, sourceRelativePath);
|
|
160
|
+
if (!fs.existsSync(sourcePath)) {
|
|
161
|
+
(0, errorUtils_1.logWarning)("copy notification icon", `Icon file not found: ${sourcePath}`);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const ext = path.extname(sourcePath).toLowerCase();
|
|
165
|
+
validateIconExtension(ext);
|
|
166
|
+
const resDir = (0, exports.getAndroidResDir)(androidProjectRoot);
|
|
167
|
+
const drawableDir = path.join(resDir, DRAWABLE_DIR_NAME);
|
|
168
|
+
ensureDir(drawableDir);
|
|
169
|
+
const destPath = path.join(drawableDir, `${DRAWABLE_ICON_NAME}${ext}`);
|
|
170
|
+
const copyResult = await (0, errorUtils_1.withErrorHandling)("copy notification icon", async () => {
|
|
171
|
+
const src = fs.readFileSync(sourcePath);
|
|
172
|
+
const prev = fs.existsSync(destPath) ? fs.readFileSync(destPath) : null;
|
|
173
|
+
if (prev && Buffer.compare(prev, src) === 0) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
fs.writeFileSync(destPath, src);
|
|
177
|
+
}, { sourcePath, destPath });
|
|
178
|
+
if (copyResult === null) {
|
|
179
|
+
(0, errorUtils_1.logWarning)("copy notification icon", "failed to copy icon");
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
resourceName: DRAWABLE_ICON_NAME,
|
|
184
|
+
resourceRef: `@drawable/${DRAWABLE_ICON_NAME}`,
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
exports.copyNotificationIcon = copyNotificationIcon;
|