Skip to content

Commit 2a912d7

Browse files
committed
fix: update addDevice definition and bump RNFB versions
1 parent c4b8a15 commit 2a912d7

File tree

6 files changed

+840
-236
lines changed

6 files changed

+840
-236
lines changed

examples/SampleApp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"@react-native-async-storage/async-storage": "^1.21.0",
2828
"@react-native-camera-roll/camera-roll": "^7.8.4",
2929
"@react-native-community/netinfo": "^11.3.2",
30-
"@react-native-firebase/app": "^19.3.0",
31-
"@react-native-firebase/messaging": "^19.3.0",
30+
"@react-native-firebase/app": "21.6.0",
31+
"@react-native-firebase/messaging": "21.6.0",
3232
"@react-navigation/bottom-tabs": "6.6.0",
3333
"@react-navigation/drawer": "6.7.0",
3434
"@react-navigation/native": "^6.1.17",

examples/SampleApp/src/hooks/useChatClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ export const useChatClient = () => {
105105
if (isEnabled) {
106106
// Register FCM token with stream chat server.
107107
const token = await messaging().getToken();
108-
await client.addDevice(token, 'firebase');
108+
await client.addDevice(token, 'firebase', client.userID, 'rn-fcm');
109109

110110
// Listen to new FCM tokens and register them with stream chat server.
111111
const unsubscribeTokenRefresh = messaging().onTokenRefresh(async (newToken) => {
112-
await client.addDevice(newToken, 'firebase');
112+
await client.addDevice(newToken, 'firebase', client.userID, 'rn-fcm');
113113
});
114114
// show notifications when on foreground
115115
const unsubscribeForegroundMessageReceive = messaging().onMessage(async (remoteMessage) => {

examples/SampleApp/src/types.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import type { Immutable } from 'seamless-immutable';
2-
import type { Channel, UserResponse } from 'stream-chat';
2+
import type { Channel, ExtendableGenerics, UserResponse, DefaultGenerics } from 'stream-chat';
33
import type { ThreadContextValue } from 'stream-chat-react-native';
44
import type { Theme } from '@react-navigation/native';
5+
import { DefaultStreamChatGenerics } from 'stream-chat-react-native';
56

67
export type LocalAttachmentType = {
78
file_size?: number;
89
mime_type?: string;
910
};
1011
export type LocalChannelType = Record<string, unknown>;
11-
export type LocalCommandType = string;
12+
export type LocalCommandType = string & {};
1213
export type LocalEventType = Record<string, unknown>;
1314
export type LocalMessageType = Record<string, unknown>;
1415
export type LocalReactionType = Record<string, unknown>;
@@ -30,7 +31,9 @@ export type StreamChatGenerics = {
3031
pollType: LocalPollType;
3132
reactionType: LocalReactionType;
3233
userType: LocalUserType;
33-
};
34+
}
35+
36+
// export type StreamChatGenerics = DefaultGenerics;
3437

3538
export type DrawerNavigatorParamList = {
3639
HomeScreen: undefined;

0 commit comments

Comments
 (0)