Skip to content

Commit 01ef65b

Browse files
committed
Merge branch 'develop' of github.com:GetStream/stream-chat-react-native into channel-pinning-and-archiving
2 parents cae4458 + e917101 commit 01ef65b

File tree

36 files changed

+614
-370
lines changed

36 files changed

+614
-370
lines changed

.github/workflows/next-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ jobs:
3535
run: yarn test:coverage
3636
- name: Publish Next Release
3737
run: GITHUB_SHORT_SHA="$(git rev-parse --short $GITHUB_SHA)" yarn release-next
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

examples/ExpoMessaging/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"expo-image-picker",
4040
{
4141
"photosPermission": "The app accesses your photos to let them share with others.",
42-
"cameraPermission": "The app accesses your camera to let you take photos and share with others."
42+
"cameraPermission": "The app accesses your camera to let you take photos and share with others.",
43+
"microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone for video recording."
4344
}
4445
],
4546
[

examples/ExpoMessaging/components/ChatWrapper.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { AuthProgressLoader } from './AuthProgressLoader';
1010
import { StreamChatGenerics } from '../types';
1111
import { STREAM_API_KEY, user, userToken } from '../constants';
1212
import { useSafeAreaInsets } from 'react-native-safe-area-context';
13+
import { useStreamChatTheme } from '../useStreamChatTheme';
1314

1415
const streami18n = new Streami18n({
1516
language: 'en',
@@ -26,13 +27,18 @@ export const ChatWrapper = ({ children }: PropsWithChildren<{}>) => {
2627
userData: user,
2728
tokenOrProvider: userToken,
2829
});
30+
const theme = useStreamChatTheme();
2931

3032
if (!chatClient) {
3133
return <AuthProgressLoader />;
3234
}
3335

3436
return (
35-
<OverlayProvider<StreamChatGenerics> bottomInset={bottom} i18nInstance={streami18n}>
37+
<OverlayProvider<StreamChatGenerics>
38+
bottomInset={bottom}
39+
i18nInstance={streami18n}
40+
value={{ style: theme }}
41+
>
3642
<Chat client={chatClient} i18nInstance={streami18n}>
3743
{children}
3844
</Chat>

examples/ExpoMessaging/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,28 @@
1313
"@op-engineering/op-sqlite": "^9.3.0",
1414
"@react-native-community/netinfo": "11.4.1",
1515
"@react-navigation/elements": "^1.3.30",
16-
"expo": "^52.0.0",
16+
"expo": "~52.0.20",
1717
"expo-av": "~15.0.1",
1818
"expo-clipboard": "~7.0.0",
1919
"expo-constants": "~17.0.3",
2020
"expo-document-picker": "~13.0.1",
21-
"expo-file-system": "~18.0.4",
21+
"expo-file-system": "~18.0.6",
2222
"expo-haptics": "~14.0.0",
2323
"expo-image-manipulator": "~13.0.5",
2424
"expo-image-picker": "^16.0.3",
2525
"expo-linking": "~7.0.3",
26-
"expo-router": "~4.0.11",
26+
"expo-media-library": "~17.0.4",
27+
"expo-router": "~4.0.15",
2728
"expo-sharing": "~13.0.0",
28-
"expo-splash-screen": "~0.29.13",
29+
"expo-splash-screen": "~0.29.18",
2930
"expo-status-bar": "~2.0.0",
3031
"react": "18.3.1",
3132
"react-dom": "18.3.1",
32-
"react-native": "0.76.3",
33+
"react-native": "0.76.5",
3334
"react-native-gesture-handler": "~2.20.2",
3435
"react-native-reanimated": "~3.16.1",
3536
"react-native-safe-area-context": "4.12.0",
36-
"react-native-screens": "~4.1.0",
37+
"react-native-screens": "~4.4.0",
3738
"react-native-svg": "15.8.0",
3839
"react-native-web": "~0.19.13",
3940
"stream-chat-expo": "link:../../package/expo-package",

examples/ExpoMessaging/yarn.lock

Lines changed: 219 additions & 171 deletions
Large diffs are not rendered by default.

package/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Change Log
22

3+
## [6.2.0](https://github.com/GetStream/stream-chat-react-native/compare/v6.1.1...v6.2.0) (2025-01-17)
4+
5+
6+
### Features
7+
8+
* add support for video recording take and upload ([#2870](https://github.com/GetStream/stream-chat-react-native/issues/2870)) ([7e50994](https://github.com/GetStream/stream-chat-react-native/commit/7e50994c717487c9cc2abe29389b963c2932f8c6))
9+
10+
11+
### Bug Fixes
12+
13+
* add size prop to ChannelAvatar component ([f7eeec8](https://github.com/GetStream/stream-chat-react-native/commit/f7eeec86b9e8cf305b666689fbe7e30c46da2231))
14+
* change default value of audioRecordingEnabled and not rely on package availability for default value ([#2884](https://github.com/GetStream/stream-chat-react-native/issues/2884)) ([b0a566f](https://github.com/GetStream/stream-chat-react-native/commit/b0a566fdc1b22acd7d3361189fa38da99c39cea8))
15+
* incorrect read state for messages ([#2888](https://github.com/GetStream/stream-chat-react-native/issues/2888)) ([be05c94](https://github.com/GetStream/stream-chat-react-native/commit/be05c947fb4bf5a2af6d0764e5346a1b11d950a5))
16+
* message list connection reconciliation ([#2896](https://github.com/GetStream/stream-chat-react-native/issues/2896)) ([020cecc](https://github.com/GetStream/stream-chat-react-native/commit/020cecc11ed043ac18479981b64dd8c0721158d3))
17+
18+
### [6.1.1](https://github.com/GetStream/stream-chat-react-native/compare/v6.1.0...v6.1.1) (2025-01-08)
19+
20+
21+
### Bug Fixes
22+
23+
* customize channel avatar size using theme ([#2874](https://github.com/GetStream/stream-chat-react-native/issues/2874)) ([88ed5e3](https://github.com/GetStream/stream-chat-react-native/commit/88ed5e36750bca3ea4735aa1b6d376ce538eb8a9))
24+
325
## [6.1.0](https://github.com/GetStream/stream-chat-react-native/compare/v6.0.2...v6.1.0) (2024-12-24)
426

527

package/expo-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-expo",
33
"description": "The official Expo SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.1.0",
4+
"version": "6.2.0",
55
"author": {
66
"company": "Stream.io Inc",
77
"name": "Stream.io Inc"
@@ -10,7 +10,7 @@
1010
"main": "src/index.js",
1111
"types": "types/index.d.ts",
1212
"dependencies": {
13-
"stream-chat-react-native-core": "6.1.0"
13+
"stream-chat-react-native-core": "6.2.0"
1414
},
1515
"peerDependencies": {
1616
"expo": ">=51.0.0",

package/expo-package/src/optionalDependencies/takePhoto.ts

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ try {
1010

1111
if (!ImagePicker) {
1212
console.log(
13-
'expo-image-picker is not installed. Installing this package will enable campturing photos through the app, and thereby send it.',
13+
'expo-image-picker is not installed. Installing this package will enable capturing photos and videos(for iOS) through the app, and thereby send it.',
1414
);
1515
}
1616

@@ -19,8 +19,15 @@ type Size = {
1919
width?: number;
2020
};
2121

22+
// Media type mapping for iOS and Android
23+
const mediaTypeMap = {
24+
image: 'images',
25+
mixed: ['images', 'videos'],
26+
video: 'videos',
27+
};
28+
2229
export const takePhoto = ImagePicker
23-
? async ({ compressImageQuality = 1 }) => {
30+
? async ({ compressImageQuality = 1, mediaType = Platform.OS === 'ios' ? 'mixed' : 'image' }) => {
2431
try {
2532
const permissionCheck = await ImagePicker.getCameraPermissionsAsync();
2633
const canRequest = permissionCheck.canAskAgain;
@@ -35,45 +42,65 @@ export const takePhoto = ImagePicker
3542
}
3643

3744
if (permissionGranted) {
38-
const imagePickerSuccessResult = await ImagePicker.launchCameraAsync({
45+
const result = await ImagePicker.launchCameraAsync({
46+
mediaTypes: mediaTypeMap[mediaType],
3947
quality: Math.min(Math.max(0, compressImageQuality), 1),
4048
});
41-
const canceled = imagePickerSuccessResult.canceled;
42-
const assets = imagePickerSuccessResult.assets;
49+
if (!result || !result.assets || !result.assets.length || result.canceled) {
50+
return { cancelled: true };
51+
}
4352
// since we only support single photo upload for now we will only be focusing on 0'th element.
44-
const photo = assets && assets[0];
45-
46-
if (canceled === false && photo && photo.height && photo.width && photo.uri) {
47-
let size: Size = {};
48-
if (Platform.OS === 'android') {
49-
const getSize = (): Promise<Size> =>
50-
new Promise((resolve) => {
51-
Image.getSize(photo.uri, (width, height) => {
52-
resolve({ height, width });
53-
});
54-
});
55-
56-
try {
57-
const { height, width } = await getSize();
58-
size.height = height;
59-
size.width = width;
60-
} catch (e) {
61-
console.warn('Error get image size of picture caputred from camera ', e);
62-
}
63-
} else {
64-
size = {
65-
height: photo.height,
66-
width: photo.width,
67-
};
68-
}
69-
53+
const photo = result.assets[0];
54+
if (!photo) {
55+
return { cancelled: true };
56+
}
57+
if (photo.mimeType.includes('video')) {
58+
const clearFilter = new RegExp('[.:]', 'g');
59+
const date = new Date().toISOString().replace(clearFilter, '_');
7060
return {
61+
...photo,
7162
cancelled: false,
63+
duration: photo.duration, // in milliseconds
64+
name: 'video_recording_' + date + photo.uri.split('.').pop(),
7265
size: photo.fileSize,
7366
source: 'camera',
67+
type: photo.mimeType,
7468
uri: photo.uri,
75-
...size,
7669
};
70+
} else {
71+
if (photo && photo.height && photo.width && photo.uri) {
72+
let size: Size = {};
73+
if (Platform.OS === 'android') {
74+
const getSize = (): Promise<Size> =>
75+
new Promise((resolve) => {
76+
Image.getSize(photo.uri, (width, height) => {
77+
resolve({ height, width });
78+
});
79+
});
80+
81+
try {
82+
const { height, width } = await getSize();
83+
size.height = height;
84+
size.width = width;
85+
} catch (e) {
86+
console.warn('Error get image size of picture caputred from camera ', e);
87+
}
88+
} else {
89+
size = {
90+
height: photo.height,
91+
width: photo.width,
92+
};
93+
}
94+
95+
return {
96+
cancelled: false,
97+
size: photo.fileSize,
98+
source: 'camera',
99+
type: photo.mimeType,
100+
uri: photo.uri,
101+
...size,
102+
};
103+
}
77104
}
78105
}
79106
} catch (error) {

package/expo-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,10 +5113,10 @@ [email protected], stream-buffers@~2.2.0:
51135113
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
51145114
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
51155115

5116-
stream-chat-react-native-core@6.0.2:
5117-
version "6.0.2"
5118-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.0.2.tgz#c0d497975e036055616c10362203ddb553f5aaeb"
5119-
integrity sha512-wD+bJAplVLvfRv3nXExqu95A3KCDvR3Veg11i8EOcFh59SIf2loMEp8kCSEh/hqhvViDILA8kvBFMKJpJxlMrw==
5116+
stream-chat-react-native-core@6.1.1:
5117+
version "6.1.1"
5118+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.1.1.tgz#6baf31cf1cf347f2a19f2e3afccd3d540bebd036"
5119+
integrity sha512-kzVrs4lJRJq6gxbnx3dwmF3c8dnZ/RDLZJC0LLtYOeyc2AuYypFFM9ChFzo1TwMGT5siiZByg/bLnvBCUTrNAA==
51205120
dependencies:
51215121
"@gorhom/bottom-sheet" "^5.0.6"
51225122
dayjs "1.10.5"

package/native-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-react-native",
33
"description": "The official React Native SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.1.0",
4+
"version": "6.2.0",
55
"homepage": "https://www.npmjs.com/package/stream-chat-react-native",
66
"author": {
77
"company": "Stream.io Inc",
@@ -20,7 +20,7 @@
2020
"types": "types/index.d.ts",
2121
"dependencies": {
2222
"es6-symbol": "^3.1.3",
23-
"stream-chat-react-native-core": "6.1.0"
23+
"stream-chat-react-native-core": "6.2.0"
2424
},
2525
"peerDependencies": {
2626
"@react-native-camera-roll/camera-roll": ">=7.8.0",

0 commit comments

Comments
 (0)