Skip to content

Commit ce96cc5

Browse files
authored
Merge pull request #1801 from GetStream/develop
2 parents 316ce99 + e02a134 commit ce96cc5

File tree

39 files changed

+48
-1049
lines changed

39 files changed

+48
-1049
lines changed

β€Ždocusaurus/docs/reactnative/basics/offline_support.mdxβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ yarn add [email protected]
3838

3939
2. **Add `react-native-quick-sqlite` dependency**
4040

41+
> At the moment, support for only v4 of `react-native-quick-sqlite` is available.
42+
> Support for v5 of `react-native-quick-sqlite` will be introduced in one of the upcoming minor release.
43+
4144
```bash
42-
yarn add react-native-quick-sqlite
45+
yarn add react-native-quick-sqlite@4.0.8
4346
npx pod-install
4447
```
4548

β€Ždocusaurus/docs/reactnative/customization/native_handlers.mdxβ€Ž

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ This should be done outside of the component lifecycle to prevent unnecessarily
3333

3434
There are 13 handlers registered as they interact with different native API packages depending on if the SDK being used on Expo or vanilla React Native.
3535

36-
### BlurView
37-
38-
A component that blurs the view behind it.
39-
40-
**React Native:** [`@react-native-community/blur`](https://github.com/Kureev/react-native-blur)
41-
42-
**Expo:** [`expo-blur`](https://docs.expo.io/versions/latest/sdk/blur-view/)
43-
4436
### compressImage
4537

4638
An async function that compresses an image and returns the local `uri` of the compressed image.

β€Ždocusaurus/docs/reactnative/guides/push_notifications_v1.mdxβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,13 @@ const requestPermission = async () => {
118118

119119
const App = () => {
120120
const [isReady, setIsReady] = useState(false);
121+
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();
121122

122123
useEffect(() => {
123-
let unsubscribeTokenRefreshListener;
124124
// Register FCM token with stream chat server.
125125
const registerPushToken = async () => {
126+
// unsubscribe any previous listener
127+
unsubscribeTokenRefreshListenerRef.current?.();
126128
const token = await messaging().getToken();
127129
await client.addDevice(token, 'firebase');
128130

@@ -144,7 +146,7 @@ const App = () => {
144146

145147
return async () => {
146148
await client?.disconnectUser();
147-
unsubscribeTokenRefreshListener?.();
149+
unsubscribeTokenRefreshListenerRef.current?.();
148150
};
149151
}, []);
150152

β€Ždocusaurus/docs/reactnative/guides/push_notifications_v2.mdxβ€Ž

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Easiest way to integrate push notifications in your Chat applications is using F
2121
- They were mentioned
2222
- Messages from muted users are not sent.
2323
- Messages are sent to all registered devices for a user (up to 25).
24-
- Up to 100 members of a channel will receive push notifications.
2524
- skip_push is marked as false, as described [here](https://getstream.io/chat/docs/javascript/send_message/?language=javascript#complex-example).
2625
- push_notifications is enabled (default) on the channel type for the sent message.
2726

@@ -138,11 +137,13 @@ const requestPermission = async () => {
138137

139138
const App = () => {
140139
const [isReady, setIsReady] = useState(false);
140+
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();
141141

142142
useEffect(() => {
143-
let unsubscribeTokenRefreshListener;
144143
// Register FCM token with stream chat server.
145144
const registerPushToken = async () => {
145+
// unsubscribe any previous listener
146+
unsubscribeTokenRefreshListenerRef.current?.();
146147
const token = await messaging().getToken();
147148
const push_provider = 'firebase';
148149
const push_provider_name = 'MyRNAppFirebasePush'; // name an alias for your push provider (optional)
@@ -161,7 +162,7 @@ const App = () => {
161162
}
162163
};
163164

164-
unsubscribeTokenRefreshListener = messaging().onTokenRefresh(async newToken => {
165+
unsubscribeTokenRefreshListenerRef.current = messaging().onTokenRefresh(async newToken => {
165166
await Promise.all([
166167
removeOldToken(),
167168
client.addDevice(newToken, push_provider, USER_ID, push_provider_name),
@@ -182,7 +183,7 @@ const App = () => {
182183

183184
return async () => {
184185
await client?.disconnectUser();
185-
unsubscribeTokenRefreshListener?.();
186+
unsubscribeTokenRefreshListenerRef.current?.();
186187
};
187188
}, []);
188189

β€Ždocusaurus/reactnative_versioned_docs/version-4.x.x/guides/push_notifications_v1.mdxβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,13 @@ const requestPermission = async () => {
118118

119119
const App = () => {
120120
const [isReady, setIsReady] = useState(false);
121+
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();
121122

122123
useEffect(() => {
123-
let unsubscribeTokenRefreshListener;
124124
// Register FCM token with stream chat server.
125125
const registerPushToken = async () => {
126+
// unsubscribe any previous listener
127+
unsubscribeTokenRefreshListenerRef.current?.();
126128
const token = await messaging().getToken();
127129
await client.addDevice(token, 'firebase');
128130

@@ -144,7 +146,7 @@ const App = () => {
144146

145147
return async () => {
146148
await client?.disconnectUser();
147-
unsubscribeTokenRefreshListener?.();
149+
unsubscribeTokenRefreshListenerRef.current?.();
148150
};
149151
}, []);
150152

β€Ždocusaurus/reactnative_versioned_docs/version-4.x.x/guides/push_notifications_v2.mdxβ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ const requestPermission = async () => {
133133

134134
const App = () => {
135135
const [isReady, setIsReady] = useState(false);
136+
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();
136137

137138
useEffect(() => {
138-
let unsubscribeTokenRefreshListener;
139139
// Register FCM token with stream chat server.
140140
const registerPushToken = async () => {
141+
// unsubscribe any previous listener
142+
unsubscribeTokenRefreshListenerRef.current?.();
141143
const token = await messaging().getToken();
142144
const push_provider = 'firebase';
143145
const push_provider_name = 'MyRNAppFirebasePush'; // name an alias for your push provider (optional)
@@ -156,7 +158,7 @@ const App = () => {
156158
}
157159
};
158160

159-
unsubscribeTokenRefreshListener = messaging().onTokenRefresh(async newToken => {
161+
unsubscribeTokenRefreshListenerRef.current = messaging().onTokenRefresh(async newToken => {
160162
await Promise.all([
161163
removeOldToken(),
162164
client.addDevice(newToken, push_provider, USER_ID, push_provider_name),
@@ -177,7 +179,7 @@ const App = () => {
177179

178180
return async () => {
179181
await client?.disconnectUser();
180-
unsubscribeTokenRefreshListener?.();
182+
unsubscribeTokenRefreshListenerRef.current?.();
181183
};
182184
}, []);
183185

β€Žexamples/SampleApp/src/screens/ChannelImagesScreen.tsxβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ export const ChannelImagesScreen: React.FC<ChannelImagesScreenProps> = ({
6666
params: { channel },
6767
},
6868
}) => {
69-
const { images, setImage, setImages } = useImageGalleryContext<StreamChatGenerics>();
69+
const {
70+
messages: images,
71+
setMessages: setImages,
72+
setSelectedMessage: setImage,
73+
} = useImageGalleryContext<StreamChatGenerics>();
7074
const { setOverlay } = useOverlayContext();
7175
const { loading, loadMore, messages } = usePaginatedAttachments(channel, 'image');
7276
const {

β€Žpackage/src/components/Channel/Channel.mdβ€Ž

Lines changed: 0 additions & 39 deletions
This file was deleted.

β€Žpackage/src/components/ChannelList/ChannelList.mdβ€Ž

Lines changed: 0 additions & 18 deletions
This file was deleted.

β€Žpackage/src/components/ChannelList/ChannelListMessenger.mdβ€Ž

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
Β (0)