react-native-flutter-chat 1.0.8 → 1.0.10
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/android/build.gradle +5 -4
- package/android/libs/flutter_release-13.aar +0 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.aar +0 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/{12/flutter_release-12.module → 1/flutter_release-1.module} +5 -5
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.module.md5 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.module.sha1 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.module.sha256 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.module.sha512 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/{12/flutter_release-12.pom → 1/flutter_release-1.pom} +1 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.pom.md5 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.pom.sha1 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.pom.sha256 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.pom.sha512 +1 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml +4 -4
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.md5 +1 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.sha1 +1 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.sha256 +1 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.sha512 +1 -1
- package/package.json +9 -2
- package/react-native.config.js +12 -0
- package/setup.js +240 -0
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.module.md5 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.module.sha1 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.module.sha256 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.module.sha512 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.pom.md5 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.pom.sha1 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.pom.sha256 +0 -1
- package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.pom.sha512 +0 -1
- package/tsconfig.json +0 -16
- /package/android/libs/{flutter_repo/com/flutterchat/module/flutter_release/12/flutter_release-12.aar → flutter_release-1.aar} +0 -0
- /package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/{12/flutter_release-12.aar.md5 → 1/flutter_release-1.aar.md5} +0 -0
- /package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/{12/flutter_release-12.aar.sha1 → 1/flutter_release-1.aar.sha1} +0 -0
- /package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/{12/flutter_release-12.aar.sha256 → 1/flutter_release-1.aar.sha256} +0 -0
- /package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/{12/flutter_release-12.aar.sha512 → 1/flutter_release-1.aar.sha512} +0 -0
package/android/build.gradle
CHANGED
|
@@ -18,7 +18,7 @@ android {
|
|
|
18
18
|
namespace 'com.flutterchat.sdk'
|
|
19
19
|
|
|
20
20
|
defaultConfig {
|
|
21
|
-
minSdk
|
|
21
|
+
minSdk 24
|
|
22
22
|
targetSdk 34
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -35,9 +35,9 @@ android {
|
|
|
35
35
|
repositories {
|
|
36
36
|
google()
|
|
37
37
|
mavenCentral()
|
|
38
|
-
//
|
|
38
|
+
// uri() is mandatory on Windows — raw strings produce invalid Maven URLs
|
|
39
39
|
maven {
|
|
40
|
-
url "$projectDir/libs/flutter_repo"
|
|
40
|
+
url uri("$projectDir/libs/flutter_repo")
|
|
41
41
|
}
|
|
42
42
|
// Flutter engine — must come from storage.googleapis.com NOT jitpack
|
|
43
43
|
maven {
|
|
@@ -46,6 +46,7 @@ repositories {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
dependencies {
|
|
49
|
-
implementation 'com.facebook.react:react-android
|
|
49
|
+
implementation 'com.facebook.react:react-android:+'
|
|
50
|
+
// Version always matches --build-number 1 in CI
|
|
50
51
|
implementation 'com.flutterchat.module:flutter_release:1.0'
|
|
51
52
|
}
|
|
Binary file
|
package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.aar
ADDED
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "com.flutterchat.module",
|
|
5
5
|
"module": "flutter_release",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "1",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
],
|
|
55
55
|
"files": [
|
|
56
56
|
{
|
|
57
|
-
"name": "flutter_release-
|
|
58
|
-
"url": "flutter_release-
|
|
57
|
+
"name": "flutter_release-1.aar",
|
|
58
|
+
"url": "flutter_release-1.aar",
|
|
59
59
|
"size": 5411058,
|
|
60
60
|
"sha512": "e019f49ceb3a962b72ea8978c5d55be6d75bb6718e4970941c6a279f4a9e165c748abb437089ad1bcca1ccaf9cbf0babfa60cfa60786f65b280e2105a9bd3190",
|
|
61
61
|
"sha256": "715eb1b0a07c3a7219c25c8069d1b96ea1c98b3b0f957a3500b4481762352b88",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
],
|
|
105
105
|
"files": [
|
|
106
106
|
{
|
|
107
|
-
"name": "flutter_release-
|
|
108
|
-
"url": "flutter_release-
|
|
107
|
+
"name": "flutter_release-1.aar",
|
|
108
|
+
"url": "flutter_release-1.aar",
|
|
109
109
|
"size": 5411058,
|
|
110
110
|
"sha512": "e019f49ceb3a962b72ea8978c5d55be6d75bb6718e4970941c6a279f4a9e165c748abb437089ad1bcca1ccaf9cbf0babfa60cfa60786f65b280e2105a9bd3190",
|
|
111
111
|
"sha256": "715eb1b0a07c3a7219c25c8069d1b96ea1c98b3b0f957a3500b4481762352b88",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2aac917c4899e2dbce41a5e2d0ab0406
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
25f677d87c837ed76d4a9cde54ffd745060a2d18
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
47898f2036c46cb28523c7d8bd2080ead114b98f1f1d84f58cd8d5b780b4ee63
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4839938997a5cec25d1c0febd8b02d450d0bb946684010917f5fa8c3b05ae4befb40fb98e33f7594aa9cfa698f859bbdf7ad3bdbfec9f8a2d5c36f47ed494103
|
package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/1/flutter_release-1.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
62f182c2fa937ed906401a27db3048f4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
03380297f69ef66320c27cbfa6b4dc4627d7f006
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24f2e576a4722bd8fbfc6ba43867fdcf6c91370586c632e7d134baa997dbbe93
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
074563a9a652f986091e76e9de35187ed2526d42e2e0a2d02c401f0d9a874918fafb1d22d2b44b4eccf7f8e057bb600e754fb6440bf65653ac358cbac2aaca74
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>com.flutterchat.module</groupId>
|
|
4
4
|
<artifactId>flutter_release</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>
|
|
7
|
-
<release>
|
|
6
|
+
<latest>1</latest>
|
|
7
|
+
<release>1</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>
|
|
9
|
+
<version>1</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260318121125</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
56c1f4f98e628ccc7ca49829d736a2a7
|
package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2a34aad226f5c534400ad89afc0c9220703511c0
|
package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
767e499291eba185db364151282bce781d42edb27e739f81ad4c887b42d96a45
|
package/android/libs/flutter_repo/com/flutterchat/module/flutter_release/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8e6a99db8d612db44b9ae6e2bb3b1586ceaa4148f78e0c94462e48becc7ad048ccfa9b6326a0d8dd9e6fc2ee3460b10d006350749e0cca2e521db3016c24c31a
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-flutter-chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "React Native SDK that embeds a Flutter-powered chat UI via native Android bridge",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
+
"postinstall": "node setup.js",
|
|
8
9
|
"lint": "eslint src --ext .ts,.tsx",
|
|
9
10
|
"typecheck": "tsc --noEmit"
|
|
10
11
|
},
|
|
@@ -15,6 +16,13 @@
|
|
|
15
16
|
"sdk",
|
|
16
17
|
"android"
|
|
17
18
|
],
|
|
19
|
+
"files": [
|
|
20
|
+
"src",
|
|
21
|
+
"android",
|
|
22
|
+
"setup.js",
|
|
23
|
+
"react-native.config.js",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
18
26
|
"author": "",
|
|
19
27
|
"license": "MIT",
|
|
20
28
|
"peerDependencies": {
|
|
@@ -24,7 +32,6 @@
|
|
|
24
32
|
"devDependencies": {
|
|
25
33
|
"@types/react": "^18.2.0",
|
|
26
34
|
"@types/react-native": "^0.73.0",
|
|
27
|
-
"react-native": "^0.73.4",
|
|
28
35
|
"typescript": "^5.3.0"
|
|
29
36
|
}
|
|
30
37
|
}
|
package/setup.js
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* react-native-flutter-chat — postinstall setup
|
|
5
|
+
*
|
|
6
|
+
* Automatically patches the host RN app's Android files.
|
|
7
|
+
* Runs automatically after: npm install react-native-flutter-chat
|
|
8
|
+
*
|
|
9
|
+
* What it does:
|
|
10
|
+
* 1. Fixes sdk.dir backslashes in local.properties
|
|
11
|
+
* 2. Points gradle-wrapper to a cached Gradle version
|
|
12
|
+
* 3. Adds Flutter Maven repos to android/build.gradle (with uri() for Windows)
|
|
13
|
+
* 4. Bumps minSdkVersion to 24 in android/app/build.gradle
|
|
14
|
+
* 5. Adds xmlns:tools + FlutterChatActivity to AndroidManifest.xml
|
|
15
|
+
* 6. Adds :react-native-flutter-chat subproject to android/settings.gradle
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const os = require('os');
|
|
21
|
+
|
|
22
|
+
// Find the host app root (3 levels up from node_modules/react-native-flutter-chat/)
|
|
23
|
+
const PKG_DIR = path.resolve(__dirname);
|
|
24
|
+
const ROOT = path.resolve(PKG_DIR, '..', '..');
|
|
25
|
+
const ANDROID = path.join(ROOT, 'android');
|
|
26
|
+
|
|
27
|
+
const log = (msg) => console.log(`\x1b[36m[flutter-chat]\x1b[0m ${msg}`);
|
|
28
|
+
const ok = (msg) => console.log(`\x1b[32m[flutter-chat] ✔\x1b[0m ${msg}`);
|
|
29
|
+
const warning = (msg) => console.log(`\x1b[33m[flutter-chat] ⚠\x1b[0m ${msg}`);
|
|
30
|
+
const skip = (file) => warning(`${file} not found — skipping`);
|
|
31
|
+
|
|
32
|
+
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
function read(filePath) {
|
|
35
|
+
return fs.readFileSync(filePath, 'utf8');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function write(filePath, content) {
|
|
39
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function fileExists(filePath) {
|
|
43
|
+
return fs.existsSync(filePath);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ── 1. local.properties — fix backslashes ────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
function fixLocalProperties() {
|
|
49
|
+
const file = path.join(ANDROID, 'local.properties');
|
|
50
|
+
if (!fileExists(file)) { skip('local.properties'); return; }
|
|
51
|
+
|
|
52
|
+
let content = read(file);
|
|
53
|
+
const fixed = content.replace(/sdk\.dir=(.+)/g, (_, p) =>
|
|
54
|
+
`sdk.dir=${p.trim().replace(/\\/g, '/')}`
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
if (fixed === content) { ok('local.properties already clean'); return; }
|
|
58
|
+
write(file, fixed);
|
|
59
|
+
ok('local.properties — backslashes fixed in sdk.dir');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ── 2. gradle-wrapper.properties — point to cached Gradle ────────────────────
|
|
63
|
+
|
|
64
|
+
function fixGradleWrapper() {
|
|
65
|
+
const file = path.join(ANDROID, 'gradle', 'wrapper', 'gradle-wrapper.properties');
|
|
66
|
+
if (!fileExists(file)) { skip('gradle-wrapper.properties'); return; }
|
|
67
|
+
|
|
68
|
+
// Check which Gradle versions are locally cached
|
|
69
|
+
const distsDir = path.join(os.homedir(), '.gradle', 'wrapper', 'dists');
|
|
70
|
+
let bestVersion = null;
|
|
71
|
+
|
|
72
|
+
const preferred = ['gradle-8.6-bin', 'gradle-8.6-all', 'gradle-8.3-all', 'gradle-8.3-bin'];
|
|
73
|
+
|
|
74
|
+
if (fileExists(distsDir)) {
|
|
75
|
+
for (const v of preferred) {
|
|
76
|
+
const vDir = path.join(distsDir, v);
|
|
77
|
+
if (fileExists(vDir)) {
|
|
78
|
+
// Check if it's fully downloaded (has a subdir with gradle-wrapper jar)
|
|
79
|
+
const sub = fs.readdirSync(vDir);
|
|
80
|
+
if (sub.length > 0) {
|
|
81
|
+
bestVersion = v;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (!bestVersion) {
|
|
89
|
+
warning('No cached Gradle found — keeping existing wrapper version');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const zipType = bestVersion.includes('-all') ? 'all' : 'bin';
|
|
94
|
+
const version = bestVersion.replace('gradle-', '').replace(`-${zipType}`, '');
|
|
95
|
+
const newUrl = `https\\://services.gradle.org/distributions/gradle-${version}-${zipType}.zip`;
|
|
96
|
+
|
|
97
|
+
let content = read(file);
|
|
98
|
+
const updated = content.replace(/distributionUrl=.+/, `distributionUrl=${newUrl}`);
|
|
99
|
+
|
|
100
|
+
if (updated === content) { ok('gradle-wrapper.properties already correct'); return; }
|
|
101
|
+
write(file, updated);
|
|
102
|
+
ok(`gradle-wrapper.properties — using cached Gradle ${version}-${zipType}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ── 3. android/settings.gradle — add subproject ──────────────────────────────
|
|
106
|
+
|
|
107
|
+
function fixSettingsGradle() {
|
|
108
|
+
const file = path.join(ANDROID, 'settings.gradle');
|
|
109
|
+
if (!fileExists(file)) { skip('android/settings.gradle'); return; }
|
|
110
|
+
|
|
111
|
+
let content = read(file);
|
|
112
|
+
if (content.includes('react-native-flutter-chat')) {
|
|
113
|
+
ok('android/settings.gradle — subproject already included');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const block = `
|
|
118
|
+
include ':react-native-flutter-chat'
|
|
119
|
+
project(':react-native-flutter-chat').projectDir = new File(
|
|
120
|
+
rootProject.projectDir,
|
|
121
|
+
'../node_modules/react-native-flutter-chat/android'
|
|
122
|
+
)
|
|
123
|
+
`;
|
|
124
|
+
write(file, content + block);
|
|
125
|
+
ok('android/settings.gradle — :react-native-flutter-chat subproject added');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ── 4. android/build.gradle — add Maven repos ────────────────────────────────
|
|
129
|
+
|
|
130
|
+
function fixRootBuildGradle() {
|
|
131
|
+
const file = path.join(ANDROID, 'build.gradle');
|
|
132
|
+
if (!fileExists(file)) { skip('android/build.gradle'); return; }
|
|
133
|
+
|
|
134
|
+
let content = read(file);
|
|
135
|
+
if (content.includes('flutter_repo')) {
|
|
136
|
+
ok('android/build.gradle — Flutter repos already present');
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// uri() is mandatory on Windows — raw path strings fail as Maven URLs
|
|
141
|
+
const block = `
|
|
142
|
+
allprojects {
|
|
143
|
+
repositories {
|
|
144
|
+
google()
|
|
145
|
+
mavenCentral()
|
|
146
|
+
maven {
|
|
147
|
+
url uri("$rootDir/../node_modules/react-native-flutter-chat/android/libs/flutter_repo")
|
|
148
|
+
}
|
|
149
|
+
maven {
|
|
150
|
+
url "https://storage.googleapis.com/download.flutter.io"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
155
|
+
write(file, content + block);
|
|
156
|
+
ok('android/build.gradle — Flutter Maven repos added (with uri() for Windows)');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// ── 5. android/app/build.gradle — bump minSdkVersion ────────────────────────
|
|
160
|
+
|
|
161
|
+
function fixAppBuildGradle() {
|
|
162
|
+
const file = path.join(ANDROID, 'app', 'build.gradle');
|
|
163
|
+
if (!fileExists(file)) { skip('android/app/build.gradle'); return; }
|
|
164
|
+
|
|
165
|
+
let content = read(file);
|
|
166
|
+
const match = content.match(/minSdkVersion\s*[=:]?\s*(\d+)/);
|
|
167
|
+
if (!match) { warning('minSdkVersion not found in app/build.gradle'); return; }
|
|
168
|
+
|
|
169
|
+
const current = parseInt(match[1]);
|
|
170
|
+
if (current >= 24) { ok(`android/app/build.gradle — minSdkVersion already ${current}`); return; }
|
|
171
|
+
|
|
172
|
+
const updated = content.replace(
|
|
173
|
+
/minSdkVersion\s*[=:]?\s*\d+/,
|
|
174
|
+
`minSdkVersion = 24`
|
|
175
|
+
);
|
|
176
|
+
write(file, updated);
|
|
177
|
+
ok(`android/app/build.gradle — minSdkVersion bumped ${current} → 24`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ── 6. AndroidManifest.xml — add tools namespace + FlutterChatActivity ───────
|
|
181
|
+
|
|
182
|
+
function fixAndroidManifest() {
|
|
183
|
+
const file = path.join(ANDROID, 'app', 'src', 'main', 'AndroidManifest.xml');
|
|
184
|
+
if (!fileExists(file)) { skip('AndroidManifest.xml'); return; }
|
|
185
|
+
|
|
186
|
+
let content = read(file);
|
|
187
|
+
let changed = false;
|
|
188
|
+
|
|
189
|
+
// Add xmlns:tools to <manifest> tag
|
|
190
|
+
if (!content.includes('xmlns:tools')) {
|
|
191
|
+
content = content.replace(
|
|
192
|
+
'<manifest ',
|
|
193
|
+
'<manifest xmlns:tools="http://schemas.android.com/tools" '
|
|
194
|
+
);
|
|
195
|
+
changed = true;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Add FlutterChatActivity declaration with tools:replace
|
|
199
|
+
if (!content.includes('FlutterChatActivity')) {
|
|
200
|
+
const activityBlock = `
|
|
201
|
+
<activity
|
|
202
|
+
android:name="com.flutterchat.sdk.FlutterChatActivity"
|
|
203
|
+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
204
|
+
android:hardwareAccelerated="true"
|
|
205
|
+
android:windowSoftInputMode="adjustResize"
|
|
206
|
+
tools:replace="android:configChanges" />`;
|
|
207
|
+
|
|
208
|
+
content = content.replace('</application>', `${activityBlock}\n </application>`);
|
|
209
|
+
changed = true;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (!changed) { ok('AndroidManifest.xml — already patched'); return; }
|
|
213
|
+
write(file, content);
|
|
214
|
+
ok('AndroidManifest.xml — xmlns:tools + FlutterChatActivity added');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// ── Run ───────────────────────────────────────────────────────────────────────
|
|
218
|
+
|
|
219
|
+
console.log('');
|
|
220
|
+
log('Setting up react-native-flutter-chat...');
|
|
221
|
+
console.log('');
|
|
222
|
+
|
|
223
|
+
try {
|
|
224
|
+
fixLocalProperties();
|
|
225
|
+
fixGradleWrapper();
|
|
226
|
+
fixSettingsGradle();
|
|
227
|
+
fixRootBuildGradle();
|
|
228
|
+
fixAppBuildGradle();
|
|
229
|
+
fixAndroidManifest();
|
|
230
|
+
|
|
231
|
+
console.log('');
|
|
232
|
+
console.log('\x1b[32m[flutter-chat] 🎉 Setup complete!\x1b[0m');
|
|
233
|
+
console.log('');
|
|
234
|
+
console.log(' ⚡ Autolinking handles FlutterChatPackage registration automatically.');
|
|
235
|
+
console.log(' ⚡ Just run: npx react-native run-android');
|
|
236
|
+
console.log('');
|
|
237
|
+
} catch (err) {
|
|
238
|
+
console.error('\x1b[31m[flutter-chat] Setup failed:\x1b[0m', err.message);
|
|
239
|
+
process.exit(1);
|
|
240
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1fcad64fe30f709d4811c08d21b71dd4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0c8de2224bdc2498e1cfbe00bc4bfc0e66836af0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4e614fbbce07c4304c7cacd9cac4f8029df952c9101dc168400307654a7ab728
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
275f7e34cba9f7a21659b9b6d73aa04a3e801350cda7e5d16b736f4f7ae0bd24d4f6b62ad4a99bf7203afedcd980e5d7402708c1e75d5911608b1ddd59c0f122
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
eb89e76ad09eabba188cc5d112f784df
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a883487e2b008c7c83a66c1963a23f7c1d270a39
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
77d7ea0e407d8592aad1f9dd61ba89981ec80a2ccf4c2b83e63ae2f3e82b1770
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b2b2f05b0154b884093bed42d2a927c25ae69502175b1335ffb2ecd52710800e371e9b9f764fd37d14fd29a0931bc6496dffe5757eb2817bd9bcdb7ec4491c9a
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"jsx": "react-native",
|
|
8
|
-
"lib": ["ESNext"],
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"skipLibCheck": true
|
|
13
|
-
},
|
|
14
|
-
"include": ["src"],
|
|
15
|
-
"exclude": ["node_modules"]
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|