Skip to content

Commit 02ccfea

Browse files
authored
feat: Add custom FFmpeg binary integration for iOS using chatwoot-hosted podspec (#926)
* chore: add ffmpeg custom binaries * chore: add `ITSAppUsesNonExemptEncryption` * chore: code cleanup * Update audioConverter.ts * chore: disable ffmpeg for android * Update react-native.config.js * chore: combine build and submit commands * Delete react-native.config.js * chore: remove logs * Update main.ts * chore: upgrade app version * Update pnpm-lock.yaml * Update pnpm-lock.yaml
1 parent fe81a9d commit 02ccfea

File tree

12 files changed

+4182
-4085
lines changed

12 files changed

+4182
-4085
lines changed

.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StorybookConfig } from '@storybook/react-native';
1+
import type { StorybookConfig } from '@storybook/react-native';
22

33
const main: StorybookConfig = {
44
stories: ['../src/**/*.stories.?(ts|tsx|js|jsx)'],

app.config.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
44
return {
55
name: 'Chatwoot',
66
slug: process.env.EXPO_PUBLIC_APP_SLUG || 'chatwoot-mobile',
7-
version: '4.0.16',
7+
version: '4.0.17',
88
orientation: 'portrait',
99
icon: './assets/icon.png',
1010
userInterfaceStyle: 'light',
@@ -27,6 +27,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
2727
NSAppleMusicUsageDescription:
2828
'This app does not use Apple Music, but a system API may require this permission.',
2929
UIBackgroundModes: ['fetch', 'remote-notification'],
30+
ITSAppUsesNonExemptEncryption: false,
3031
},
3132
// Please use the relative path to the google-services.json file
3233
googleServicesFile: process.env.EXPO_PUBLIC_IOS_GOOGLE_SERVICES_FILE,
@@ -101,21 +102,14 @@ export default ({ config }: ConfigContext): ExpoConfig => {
101102
targetSdkVersion: 34,
102103
extraMavenRepos: ['$rootDir/../../../node_modules/@notifee/react-native/android/libs'],
103104
enableProguardInReleaseBuilds: true,
105+
exclude: ['ffmpeg-kit-react-native'],
104106
},
105107
ios: {
106108
useFrameworks: 'static',
107109
},
108110
},
109111
],
110-
[
111-
'@config-plugins/ffmpeg-kit-react-native',
112-
{
113-
package: 'min',
114-
ios: {
115-
package: 'audio',
116-
},
117-
},
118-
],
112+
'./with-ffmpeg-pod.js',
119113
],
120114
androidNavigationBar: {
121115
backgroundColor: '#ffffff',

package.json

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"name": "@chatwoot/mobile-app",
3-
"version": "4.0.16",
4-
"main": "expo/AppEntry.js",
3+
"version": "4.0.17",
54
"scripts": {
6-
"start": "expo start",
5+
"start": "expo start --dev-client",
76
"start:production": "expo start --no-dev --minify",
87
"android": "expo run:android",
98
"ios": "expo run:ios",
@@ -15,6 +14,7 @@
1514
"run:ios": "npx expo run:ios -d",
1615
"run:android": "npx expo run:android -d",
1716
"run:doctor": "npx expo-doctor",
17+
"check:config": "npx expo-config check",
1818
"build:android:local": "dotenv -c -- eas build -p android --profile production --local",
1919
"build:android": "eas build -p android --profile production",
2020
"build:ios:local": "dotenv -c -- eas build -p ios --profile production --local",
@@ -24,6 +24,8 @@
2424
"submit:android": "dotenv -c -- eas submit -p android --profile production",
2525
"submit:ios": "dotenv -e .env -- eas submit --platform ios",
2626
"submit:all": "dotenv -e .env -- eas submit -p ios --profile production && dotenv -e .env -- eas submit -p android --profile production",
27+
"build-and-submit:ios:local": "dotenv -c -- eas build -p ios --profile production --local && dotenv -c -- eas submit --platform ios --path ./*.ipa",
28+
"build-and-submit:android:local": "dotenv -c -- eas build -p android --profile production --local && dotenv -c -- eas submit --platform android --path ./*.aab",
2729
"storybook-generate": "sb-rn-get-stories",
2830
"start:storybook": "cross-env EXPO_STORYBOOK_ENABLED='true' expo start",
2931
"storybook:ios": "cross-env EXPO_STORYBOOK_ENABLED='true' pnpm run:ios",
@@ -35,8 +37,7 @@
3537
"@chatwoot/markdown-to-txt": "^2.0.4",
3638
"@chatwoot/react-native-widget": "^0.0.21",
3739
"@chatwoot/utils": "^0.0.33",
38-
"@config-plugins/ffmpeg-kit-react-native": "^9.0.0",
39-
"@gorhom/bottom-sheet": "^5.1.1",
40+
"@gorhom/bottom-sheet": "^5.1.2",
4041
"@kesha-antonov/react-native-action-cable": "^1.1.5",
4142
"@notifee/react-native": "^9.1.1",
4243
"@react-native-async-storage/async-storage": "^1.23.1",
@@ -50,7 +51,7 @@
5051
"@react-navigation/native": "^6.1.18",
5152
"@react-navigation/native-stack": "^6.10.1",
5253
"@reduxjs/toolkit": "^2.5.1",
53-
"@sentry/react-native": "^6.3.0",
54+
"@sentry/react-native": "^6.10.0",
5455
"@shopify/flash-list": "^1.7.3",
5556
"@types/lodash": "^4.17.9",
5657
"axios": "^1.6.4",
@@ -59,24 +60,25 @@
5960
"cross-env": "^7.0.3",
6061
"date-fns": "2.21.1",
6162
"diff": "5.0.0",
62-
"expo": "~52.0.35",
63+
"expo": "~52.0.46",
6364
"expo-application": "~6.0.2",
6465
"expo-av": "~15.0.2",
6566
"expo-build-properties": "~0.13.2",
66-
"expo-constants": "^17.0.6",
67-
"expo-font": "~13.0.3",
67+
"expo-constants": "^17.0.8",
68+
"expo-file-system": "~18.0.12",
69+
"expo-font": "~13.0.4",
6870
"expo-haptics": "~14.0.1",
69-
"expo-image": "~2.0.5",
70-
"expo-splash-screen": "~0.29.22",
71+
"expo-image": "~2.0.7",
72+
"expo-splash-screen": "~0.29.24",
7173
"expo-status-bar": "~2.0.1",
72-
"expo-system-ui": "~4.0.8",
74+
"expo-system-ui": "~4.0.9",
7375
"expo-web-browser": "~14.0.2",
7476
"ffmpeg-kit-react-native": "^6.0.2",
7577
"i18n-js": "^3.8.0",
7678
"lodash": "^4.17.21",
7779
"react": "18.3.1",
7880
"react-hook-form": "^7.52.1",
79-
"react-native": "0.76.7",
81+
"react-native": "0.76.9",
8082
"react-native-audio-recorder-player": "^3.6.11",
8183
"react-native-autoheight-webview": "^1.6.5",
8284
"react-native-device-info": "^11.1.0",
@@ -146,18 +148,17 @@
146148
"react-native-document-picker",
147149
"react-native-file-viewer",
148150
"react-native-file-viewer",
149-
"ffmpeg-kit-react-native",
150151
"react-native-fs",
151152
"react-native-snackbar",
152153
"@react-native-community/blur",
153154
"react-native-autoheight-webview",
154155
"redux-persist",
155156
"rn-fetch-blob",
156157
"@alantoa/lightbox",
158+
"ffmpeg-kit-react-native",
157159
"@chatwoot/markdown-to-txt",
158160
"@chatwoot/react-native-widget",
159161
"@chatwoot/utils",
160-
"@config-plugins/ffmpeg-kit-react-native",
161162
"camelcase",
162163
"camelcase-keys",
163164
"cross-env",
@@ -167,10 +168,16 @@
167168
"tailwindcss",
168169
"use-deep-compare-effect",
169170
"diff",
170-
"string.prototype.matchall"
171+
"string.prototype.matchall",
172+
"snakecase-keys"
171173
],
172174
"listUnknownPackages": true
173175
}
174176
}
177+
},
178+
"pnpm": {
179+
"patchedDependencies": {
180+
"[email protected]": "patches/ffmpeg-kit-react-native.patch"
181+
}
175182
}
176-
}
183+
}
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
diff --git a/ffmpeg-kit-react-native.podspec b/ffmpeg-kit-react-native.podspec
2+
index 889d3e8f308f94a338869afedc8c25d8b1ebb53a..d41913064e7da4511cbb9ebec7374fc24cc0a6c4 100644
3+
--- a/ffmpeg-kit-react-native.podspec
4+
+++ b/ffmpeg-kit-react-native.podspec
5+
@@ -15,121 +15,13 @@ Pod::Spec.new do |s|
6+
s.static_framework = true
7+
8+
s.source = { :git => "https://github.com/arthenica/ffmpeg-kit.git", :tag => "react.native.v#{s.version}" }
9+
-
10+
- s.default_subspec = 'https'
11+
-
12+
+ s.default_subspec = 'https' # Just change to whatever subspec you want to use, e.g 'min-gpl'
13+
s.dependency "React-Core"
14+
15+
- s.subspec 'min' do |ss|
16+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
17+
- '**/FFmpegKitReactNativeModule.h'
18+
- ss.dependency 'ffmpeg-kit-ios-min', "6.0"
19+
- ss.ios.deployment_target = '12.1'
20+
- end
21+
-
22+
- s.subspec 'min-lts' do |ss|
23+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
24+
- '**/FFmpegKitReactNativeModule.h'
25+
- ss.dependency 'ffmpeg-kit-ios-min', "6.0.LTS"
26+
- ss.ios.deployment_target = '10'
27+
- end
28+
-
29+
- s.subspec 'min-gpl' do |ss|
30+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
31+
- '**/FFmpegKitReactNativeModule.h'
32+
- ss.dependency 'ffmpeg-kit-ios-min-gpl', "6.0"
33+
- ss.ios.deployment_target = '12.1'
34+
- end
35+
-
36+
- s.subspec 'min-gpl-lts' do |ss|
37+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
38+
- '**/FFmpegKitReactNativeModule.h'
39+
- ss.dependency 'ffmpeg-kit-ios-min-gpl', "6.0.LTS"
40+
- ss.ios.deployment_target = '10'
41+
- end
42+
-
43+
s.subspec 'https' do |ss|
44+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
45+
- '**/FFmpegKitReactNativeModule.h'
46+
- ss.dependency 'ffmpeg-kit-ios-https', "6.0"
47+
- ss.ios.deployment_target = '12.1'
48+
- end
49+
-
50+
- s.subspec 'https-lts' do |ss|
51+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
52+
- '**/FFmpegKitReactNativeModule.h'
53+
- ss.dependency 'ffmpeg-kit-ios-https', "6.0.LTS"
54+
- ss.ios.deployment_target = '10'
55+
- end
56+
-
57+
- s.subspec 'https-gpl' do |ss|
58+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
59+
- '**/FFmpegKitReactNativeModule.h'
60+
- ss.dependency 'ffmpeg-kit-ios-https-gpl', "6.0"
61+
- ss.ios.deployment_target = '12.1'
62+
- end
63+
-
64+
- s.subspec 'https-gpl-lts' do |ss|
65+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
66+
- '**/FFmpegKitReactNativeModule.h'
67+
- ss.dependency 'ffmpeg-kit-ios-https-gpl', "6.0.LTS"
68+
- ss.ios.deployment_target = '10'
69+
+ ss.source_files = '**/FFmpegKitReactNativeModule.m',
70+
+ '**/FFmpegKitReactNativeModule.h'
71+
+ ss.dependency 'chatwoot-ffmpeg-kit-ios-https', "6.0.2"
72+
+ ss.ios.deployment_target = '12.1'
73+
end
74+
-
75+
- s.subspec 'audio' do |ss|
76+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
77+
- '**/FFmpegKitReactNativeModule.h'
78+
- ss.dependency 'ffmpeg-kit-ios-audio', "6.0"
79+
- ss.ios.deployment_target = '12.1'
80+
- end
81+
-
82+
- s.subspec 'audio-lts' do |ss|
83+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
84+
- '**/FFmpegKitReactNativeModule.h'
85+
- ss.dependency 'ffmpeg-kit-ios-audio', "6.0.LTS"
86+
- ss.ios.deployment_target = '10'
87+
- end
88+
-
89+
- s.subspec 'video' do |ss|
90+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
91+
- '**/FFmpegKitReactNativeModule.h'
92+
- ss.dependency 'ffmpeg-kit-ios-video', "6.0"
93+
- ss.ios.deployment_target = '12.1'
94+
- end
95+
-
96+
- s.subspec 'video-lts' do |ss|
97+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
98+
- '**/FFmpegKitReactNativeModule.h'
99+
- ss.dependency 'ffmpeg-kit-ios-video', "6.0.LTS"
100+
- ss.ios.deployment_target = '10'
101+
- end
102+
-
103+
- s.subspec 'full' do |ss|
104+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
105+
- '**/FFmpegKitReactNativeModule.h'
106+
- ss.dependency 'ffmpeg-kit-ios-full', "6.0"
107+
- ss.ios.deployment_target = '12.1'
108+
- end
109+
-
110+
- s.subspec 'full-lts' do |ss|
111+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
112+
- '**/FFmpegKitReactNativeModule.h'
113+
- ss.dependency 'ffmpeg-kit-ios-full', "6.0.LTS"
114+
- ss.ios.deployment_target = '10'
115+
- end
116+
-
117+
- s.subspec 'full-gpl' do |ss|
118+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
119+
- '**/FFmpegKitReactNativeModule.h'
120+
- ss.dependency 'ffmpeg-kit-ios-full-gpl', "6.0"
121+
- ss.ios.deployment_target = '12.1'
122+
- end
123+
-
124+
- s.subspec 'full-gpl-lts' do |ss|
125+
- ss.source_files = '**/FFmpegKitReactNativeModule.m',
126+
- '**/FFmpegKitReactNativeModule.h'
127+
- ss.dependency 'ffmpeg-kit-ios-full-gpl', "6.0.LTS"
128+
- ss.ios.deployment_target = '10'
129+
- end
130+
-
131+
end

0 commit comments

Comments
 (0)