Skip to content

Commit 26de952

Browse files
authored
Merge pull request #137 from sendbird/feat/voice-message/base
feat(UIKIT-4280): voice message
2 parents 4da1ff0 + e1e069b commit 26de952

File tree

127 files changed

+2978
-806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2978
-806
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Sendbird UIKit for React-Native is a development kit with an user interface that
1111
This mono-repository the UIKit source code is consists as explained below.
1212

1313
- [**packages/uikit-react-native**](/packages/uikit-react-native) is where you can find the open source code. Check out [UIKit Open Source Guidelines](/OPENSOURCE_GUIDELINES.md) for more information regarding our stance on open source.
14-
- [**sample**](/sample) is a chat app with UIKit’s core features in which you can see items such as push notifications, total unread message count and auto sign-in are demonstrated. When you sign in to the sample app, you will only see a list of channels rendered by the [GroupChannelListFragment](https://sendbird.com/docs/uikit/v3/react-native/key-functions/list-channels) on the screen.
14+
- [**sample**](/sample) is a chat app with UIKit’s core features in which you can see items such as push notifications, total unread message count and auto sign-in are demonstrated. When you sign in to the sample app, you will only see a list of channels rendered by the [GroupChannelListFragment](https://sendbird.com/docs/chat/uikit/v3/react-native/key-functions/list-channels) on the screen.
1515
- [**packages/uikit-react-native-foundation**](/packages/uikit-react-native-foundation) is a UI package for `uikit-react-native`.
1616
- [**packages/uikit-chat-hooks**](/packages/uikit-chat-hooks) is a react hooks package for `uikit-react-native`.
1717
- [**packages/uikit-utils**](/packages/uikit-utils) is a utility package for `uikit-react-native`.
1818

1919
### More about Sendbird UIKit for React-Native
2020

21-
Find out more about Sendbird UIKit for React-Native at [UIKit for React Native doc](https://sendbird.com/docs/uikit/v3/react-native/overview).
21+
Find out more about Sendbird UIKit for React-Native at [UIKit for React Native doc](https://sendbird.com/docs/chat/uikit/v3/react-native/overview).
2222
If you need any help in resolving any issues or have questions, visit [our community](https://community.sendbird.com).
2323

2424
<br/>

docs-validation/1_introduction/Authentication.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const PROFILE_FILE: FileType = { name: '', size: 0, type: '', uri: '' };
55

66
/**
77
* Connect to the Sendbird server
8-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/authentication#2-connect-to-the-sendbird-server}
8+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/authentication#2-connect-to-the-sendbird-server}
99
* */
1010
import { useConnection } from '@sendbird/uikit-react-native';
1111

@@ -27,7 +27,7 @@ const Component = () => {
2727

2828
/**
2929
* Disconnect from the Sendbird server
30-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/authentication#2-disconnect-from-the-sendbird-server}
30+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/authentication#2-disconnect-from-the-sendbird-server}
3131
* */
3232
const Component2 = () => {
3333
const { disconnect } = useConnection();
@@ -37,7 +37,7 @@ const Component2 = () => {
3737

3838
/**
3939
* Retrieve online status of current user
40-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/authentication#2-retrieve-online-status-of-current-user}
40+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/authentication#2-retrieve-online-status-of-current-user}
4141
* */
4242
import { useSendbirdChat } from '@sendbird/uikit-react-native';
4343

@@ -54,7 +54,7 @@ const Component3 = () => {
5454

5555
/**
5656
* Register for push notifications
57-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/authentication#2-register-for-push-notifications}
57+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/authentication#2-register-for-push-notifications}
5858
* */
5959
import RNFBMessaging from '@react-native-firebase/messaging';
6060
import * as Permissions from 'react-native-permissions';
@@ -77,7 +77,7 @@ const App = () => {
7777

7878
/**
7979
* Unregister push notifications
80-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/authentication#2-unregister-push-notifications}
80+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/authentication#2-unregister-push-notifications}
8181
* */
8282
const App2 = () => {
8383
return (
@@ -92,7 +92,7 @@ const App2 = () => {
9292

9393
/**
9494
* Update user profile
95-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/authentication#2-update-user-profile}
95+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/authentication#2-update-user-profile}
9696
* */
9797
const Component4 = () => {
9898
const { updateCurrentUserInfo } = useSendbirdChat();

docs-validation/1_introduction/NativeModules.tsx

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ import {
33
createExpoFileService,
44
createExpoMediaService,
55
createExpoNotificationService,
6+
createExpoPlayerService,
7+
createExpoRecorderService,
68
createNativeClipboardService,
79
createNativeFileService,
810
createNativeMediaService,
911
createNativeNotificationService,
12+
createNativePlayerService,
13+
createNativeRecorderService,
1014
} from '@sendbird/uikit-react-native';
1115

1216
/**
1317
* Helper functions#React Native CLI
14-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/native-modules#2-helper-functions-3-react-native-cli}
18+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/native-modules#2-helper-functions-3-react-native-cli}
1519
* */
1620
import Clipboard from '@react-native-clipboard/clipboard';
1721
import { CameraRoll } from '@react-native-camera-roll/camera-roll';
@@ -23,29 +27,40 @@ import * as ImagePicker from 'react-native-image-picker';
2327
import * as Permissions from 'react-native-permissions';
2428
import * as CreateThumbnail from 'react-native-create-thumbnail';
2529
import * as ImageResizer from '@bam.tech/react-native-image-resizer';
30+
import * as AudioRecorderPlayer from 'react-native-audio-recorder-player';
2631

27-
const NativeClipboardService = createNativeClipboardService(Clipboard);
28-
const NativeNotificationService = createNativeNotificationService({
29-
messagingModule: RNFBMessaging,
30-
permissionModule: Permissions,
31-
});
32-
const NativeFileService = createNativeFileService({
33-
fsModule: FileAccess,
34-
permissionModule: Permissions,
35-
imagePickerModule: ImagePicker,
36-
mediaLibraryModule: CameraRoll,
37-
documentPickerModule: DocumentPicker,
38-
});
39-
const NativeMediaService = createNativeMediaService({
40-
VideoComponent: Video,
41-
thumbnailModule: CreateThumbnail,
42-
imageResizerModule: ImageResizer,
43-
});
32+
const nativePlatformServices = {
33+
clipboard: createNativeClipboardService(Clipboard),
34+
notification: createNativeNotificationService({
35+
messagingModule: RNFBMessaging,
36+
permissionModule: Permissions,
37+
}),
38+
file: createNativeFileService({
39+
imagePickerModule: ImagePicker,
40+
documentPickerModule: DocumentPicker,
41+
permissionModule: Permissions,
42+
fsModule: FileAccess,
43+
mediaLibraryModule: CameraRoll,
44+
}),
45+
media: createNativeMediaService({
46+
VideoComponent: Video,
47+
thumbnailModule: CreateThumbnail,
48+
imageResizerModule: ImageResizer,
49+
}),
50+
player: createNativePlayerService({
51+
audioRecorderModule: AudioRecorderPlayer,
52+
permissionModule: Permissions,
53+
}),
54+
recorder: createNativeRecorderService({
55+
audioRecorderModule: AudioRecorderPlayer,
56+
permissionModule: Permissions,
57+
}),
58+
};
4459
/** ------------------ **/
4560

4661
/**
4762
* Helper functions#Expo CLI
48-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/native-modules#2-helper-functions-3-expo-cli}
63+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/native-modules#2-helper-functions-3-expo-cli}
4964
* */
5065
import * as ExpoClipboard from 'expo-clipboard';
5166
import * as ExpoDocumentPicker from 'expo-document-picker';
@@ -57,18 +72,26 @@ import * as ExpoAV from 'expo-av';
5772
import * as ExpoVideoThumbnail from 'expo-video-thumbnails';
5873
import * as ExpoImageManipulator from 'expo-image-manipulator';
5974

60-
const ExpoNotificationService = createExpoNotificationService(ExpoNotifications);
61-
const ExpoClipboardService = createExpoClipboardService(ExpoClipboard);
62-
const ExpoFileService = createExpoFileService({
63-
fsModule: ExpoFS,
64-
imagePickerModule: ExpoImagePicker,
65-
mediaLibraryModule: ExpoMediaLibrary,
66-
documentPickerModule: ExpoDocumentPicker,
67-
});
68-
const ExpoMediaService = createExpoMediaService({
69-
avModule: ExpoAV,
70-
thumbnailModule: ExpoVideoThumbnail,
71-
imageManipulator: ExpoImageManipulator,
72-
fsModule: ExpoFS,
73-
})
75+
const expoPlatformServices = {
76+
clipboard: createExpoClipboardService(ExpoClipboard),
77+
notification: createExpoNotificationService(ExpoNotifications),
78+
file: createExpoFileService({
79+
fsModule: ExpoFS,
80+
imagePickerModule: ExpoImagePicker,
81+
mediaLibraryModule: ExpoMediaLibrary,
82+
documentPickerModule: ExpoDocumentPicker,
83+
}),
84+
media: createExpoMediaService({
85+
avModule: ExpoAV,
86+
thumbnailModule: ExpoVideoThumbnail,
87+
imageManipulator: ExpoImageManipulator,
88+
fsModule: ExpoFS,
89+
}),
90+
player: createExpoPlayerService({
91+
avModule: ExpoAV,
92+
}),
93+
recorder: createExpoRecorderService({
94+
avModule: ExpoAV,
95+
}),
96+
};
7497
/** ------------------ **/

docs-validation/1_introduction/ScreenNavigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const GroupChannelScreen = () => <React.Fragment />;
44

55
/**
66
* Set up navigation in a fragment
7-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/screen-navigation#2-set-up-navigation-in-a-fragment}
7+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/screen-navigation#2-set-up-navigation-in-a-fragment}
88
* */
99
// @ts-ignore
1010
import { Navigation } from 'react-native-navigation';
@@ -34,7 +34,7 @@ const GroupChannelListScreen = (props: { componentId: string }) => {
3434

3535
/**
3636
* Integrate navigation library
37-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/screen-navigation#2-integrate-navigation-library}
37+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/screen-navigation#2-integrate-navigation-library}
3838
* */
3939
Navigation.registerComponent('GroupChannel', () => GroupChannelScreen);
4040
Navigation.registerComponent('GroupChannelList', () => GroupChannelListScreen);

docs-validation/1_introduction/SendYourFirstMessage.tsx

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import React from 'react';
22

33
/**
44
* Implement platform service interfaces using native modules
5-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-4-implement-platform-service-interfaces-using-native-modules}
5+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-4-implement-platform-service-interfaces-using-native-modules}
66
* */
77
import {
88
createNativeClipboardService,
99
createNativeFileService,
1010
createNativeMediaService,
1111
createNativeNotificationService,
12-
} from '@sendbird/uikit-react-native';
12+
createNativePlayerService,
13+
createNativeRecorderService,
14+
SendbirdUIKitContainerProps
15+
} from "@sendbird/uikit-react-native";
1316

1417
import Clipboard from '@react-native-clipboard/clipboard';
1518
import { CameraRoll } from '@react-native-camera-roll/camera-roll';
@@ -21,29 +24,41 @@ import * as ImagePicker from 'react-native-image-picker';
2124
import * as Permissions from 'react-native-permissions';
2225
import * as CreateThumbnail from 'react-native-create-thumbnail';
2326
import * as ImageResizer from '@bam.tech/react-native-image-resizer';
24-
25-
const ClipboardService = createNativeClipboardService(Clipboard);
26-
const NotificationService = createNativeNotificationService({
27-
messagingModule: RNFBMessaging,
28-
permissionModule: Permissions,
29-
});
30-
const FileService = createNativeFileService({
31-
fsModule: FileAccess,
32-
permissionModule: Permissions,
33-
imagePickerModule: ImagePicker,
34-
mediaLibraryModule: CameraRoll,
35-
documentPickerModule: DocumentPicker,
36-
});
37-
const MediaService = createNativeMediaService({
38-
VideoComponent: Video,
39-
thumbnailModule: CreateThumbnail,
40-
imageResizerModule: ImageResizer,
41-
});
27+
import * as AudioRecorderPlayer from 'react-native-audio-recorder-player';
28+
29+
30+
export const platformServices: SendbirdUIKitContainerProps['platformServices'] = {
31+
clipboard: createNativeClipboardService(Clipboard),
32+
notification: createNativeNotificationService({
33+
messagingModule: RNFBMessaging,
34+
permissionModule: Permissions,
35+
}),
36+
file: createNativeFileService({
37+
imagePickerModule: ImagePicker,
38+
documentPickerModule: DocumentPicker,
39+
permissionModule: Permissions,
40+
fsModule: FileAccess,
41+
mediaLibraryModule: CameraRoll,
42+
}),
43+
media: createNativeMediaService({
44+
VideoComponent: Video,
45+
thumbnailModule: CreateThumbnail,
46+
imageResizerModule: ImageResizer,
47+
}),
48+
player: createNativePlayerService({
49+
audioRecorderModule: AudioRecorderPlayer,
50+
permissionModule: Permissions,
51+
}),
52+
recorder: createNativeRecorderService({
53+
audioRecorderModule: AudioRecorderPlayer,
54+
permissionModule: Permissions,
55+
}),
56+
};
4257
/** ------------------ **/
4358

4459
/**
4560
* Wrap your app in SendbirdUIKitContainer
46-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-5-wrap-your-app-in-sendbirduikitcontainer}
61+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-5-wrap-your-app-in-sendbirduikitcontainer}
4762
* */
4863
import { SendbirdUIKitContainer } from '@sendbird/uikit-react-native';
4964
import AsyncStorage from '@react-native-async-storage/async-storage';
@@ -53,12 +68,7 @@ const App = () => {
5368
<SendbirdUIKitContainer
5469
appId={'APP_ID'}
5570
chatOptions={{ localCacheStorage: AsyncStorage }}
56-
platformServices={{
57-
file: FileService,
58-
notification: NotificationService,
59-
clipboard: ClipboardService,
60-
media: MediaService,
61-
}}
71+
platformServices={platformServices}
6272
>
6373
{/* Rest of your app */}
6474
</SendbirdUIKitContainer>
@@ -68,7 +78,7 @@ const App = () => {
6878

6979
/**
7080
* Create a fragment and module components
71-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-7-create-a-fragment-and-module-components}
81+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-7-create-a-fragment-and-module-components}
7282
* */
7383
import { useNavigation, useRoute } from '@react-navigation/native';
7484
import { useGroupChannel } from '@sendbird/uikit-chat-hooks';
@@ -146,7 +156,7 @@ const GroupChannelScreen = () => {
146156

147157
/**
148158
* Register navigation library to the screen
149-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-8-register-navigation-library-to-the-screen}
159+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-8-register-navigation-library-to-the-screen}
150160
* */
151161
import { NavigationContainer } from '@react-navigation/native';
152162
import { createNativeStackNavigator } from '@react-navigation/native-stack';
@@ -177,12 +187,7 @@ const App2 = () => {
177187
<SendbirdUIKitContainer
178188
appId={'APP_ID'}
179189
chatOptions={{ localCacheStorage: AsyncStorage }}
180-
platformServices={{
181-
file: FileService,
182-
notification: NotificationService,
183-
clipboard: ClipboardService,
184-
media: MediaService,
185-
}}
190+
platformServices={platformServices}
186191
>
187192
<Navigation />
188193
</SendbirdUIKitContainer>
@@ -192,7 +197,7 @@ const App2 = () => {
192197

193198
/**
194199
* Connect to the Sendbird server
195-
* {@link https://sendbird.com/docs/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-9-connect-to-the-sendbird-server}
200+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/introduction/send-first-message#2-get-started-3-step-9-connect-to-the-sendbird-server}
196201
* */
197202
import { Pressable, Text, View } from 'react-native';
198203
import { useConnection } from '@sendbird/uikit-react-native';

docs-validation/2_features/DeliveryReceipt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* How to use
3-
* {@link https://sendbird.com/docs/uikit/v3/react-native/features/delivery-receipt#2-how-to-use}
3+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/features/delivery-receipt#2-how-to-use}
44
* */
55
import { SendbirdUIKitContainer } from '@sendbird/uikit-react-native';
66

@@ -12,7 +12,7 @@ const App = () => {
1212

1313
/**
1414
* Icon resource
15-
* {@link https://sendbird.com/docs/uikit/v3/react-native/features/delivery-receipt#2-customize-the-ui-for-delivery-receipt-3-icon-resource}
15+
* {@link https://sendbird.com/docs/chat/uikit/v3/react-native/features/delivery-receipt#2-customize-the-ui-for-delivery-receipt-3-icon-resource}
1616
* */
1717
import { Icon } from '@sendbird/uikit-react-native-foundation';
1818

0 commit comments

Comments
 (0)