Skip to content

Commit 88ee175

Browse files
authored
chore: Remove ffmpeg and notifee from android (#934)
1 parent a3def28 commit 88ee175

File tree

5 files changed

+39
-32
lines changed

5 files changed

+39
-32
lines changed

app.config.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@ export default ({ config }: ConfigContext): ExpoConfig => {
3131
},
3232
// Please use the relative path to the google-services.json file
3333
googleServicesFile: process.env.EXPO_PUBLIC_IOS_GOOGLE_SERVICES_FILE,
34-
entitlements: {
35-
'aps-environment': 'production',
36-
},
34+
entitlements: { 'aps-environment': 'production' },
3735
associatedDomains: ['applinks:app.chatwoot.com'],
3836
},
3937
android: {
40-
adaptiveIcon: {
41-
foregroundImage: './assets/adaptive-icon.png',
42-
backgroundColor: '#ffffff',
43-
},
38+
adaptiveIcon: { foregroundImage: './assets/adaptive-icon.png', backgroundColor: '#ffffff' },
4439
package: 'com.chatwoot.app',
4540
permissions: [
4641
'android.permission.CAMERA',
@@ -76,12 +71,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
7671
owner: 'chatwoot',
7772
plugins: [
7873
'expo-font',
79-
[
80-
'react-native-permissions',
81-
{
82-
iosPermissions: ['Camera', 'PhotoLibrary', 'MediaLibrary'],
83-
},
84-
],
74+
['react-native-permissions', { iosPermissions: ['Camera', 'PhotoLibrary', 'MediaLibrary'] }],
8575
[
8676
'@sentry/react-native/expo',
8777
{
@@ -100,19 +90,13 @@ export default ({ config }: ConfigContext): ExpoConfig => {
10090
minSdkVersion: 24,
10191
compileSdkVersion: 35,
10292
targetSdkVersion: 34,
103-
extraMavenRepos: ['$rootDir/../../../node_modules/@notifee/react-native/android/libs'],
10493
enableProguardInReleaseBuilds: true,
105-
exclude: ['ffmpeg-kit-react-native'],
106-
},
107-
ios: {
108-
useFrameworks: 'static',
10994
},
95+
ios: { useFrameworks: 'static' },
11096
},
11197
],
11298
'./with-ffmpeg-pod.js',
11399
],
114-
androidNavigationBar: {
115-
backgroundColor: '#ffffff',
116-
},
100+
androidNavigationBar: { backgroundColor: '#ffffff' },
117101
};
118102
};

react-native.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
dependencies: {
3+
'ffmpeg-kit-react-native': {
4+
platforms: {
5+
android: null, // 👈 prevents Android autolinking
6+
},
7+
},
8+
'@notifee/react-native': {
9+
platforms: {
10+
android: null, // 👈 prevents Android autolinking
11+
},
12+
},
13+
},
14+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const convertOggToWav = async (oggUrl: string): Promise<string | Error> => {
2+
return '';
3+
};
4+
5+
export const convertAacToWav = async (inputPath: string): Promise<string> => {
6+
return '';
7+
};

src/utils/audioConverter.ts renamed to src/utils/audioConverter.ios.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ export const convertOggToWav = async (oggUrl: string): Promise<string | Error> =
99

1010
try {
1111
// Download the OGG file and wait for completion
12-
const downloadResult = await RNFS.downloadFile({
13-
fromUrl: oggUrl,
14-
toFile: tempOggPath,
15-
}).promise;
12+
const downloadResult = await RNFS.downloadFile({ fromUrl: oggUrl, toFile: tempOggPath })
13+
.promise;
1614

1715
// Verify download was successful
1816
if (downloadResult.statusCode !== 200) {

src/utils/pushUtils.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import { Platform } from 'react-native';
22
import { NOTIFICATION_TYPES } from '@/constants';
3-
import notifee from '@notifee/react-native';
43
import { Notification } from '@/types/Notification';
54

6-
export const clearAllDeliveredNotifications = () => {
7-
if (Platform.OS === 'android') {
8-
} else {
9-
notifee.cancelAllNotifications();
5+
let notifee: any;
6+
7+
if (Platform.OS === 'ios') {
8+
notifee = require('@notifee/react-native').default;
9+
}
10+
11+
export const clearAllDeliveredNotifications = async () => {
12+
if (Platform.OS === 'ios') {
13+
await notifee.cancelAllNotifications();
1014
}
1115
};
1216

13-
export const updateBadgeCount = ({ count = 0 }) => {
17+
export const updateBadgeCount = async ({ count = 0 }) => {
1418
if (Platform.OS === 'ios' && count >= 0) {
15-
notifee.setBadgeCount(count);
19+
await notifee.setBadgeCount(count);
1620
}
1721
};
1822

0 commit comments

Comments
 (0)