Skip to content

Commit

Permalink
Merge pull request #1801 from GetStream/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
madsroskar authored Nov 15, 2022
2 parents 316ce99 + e02a134 commit ce96cc5
Show file tree
Hide file tree
Showing 39 changed files with 48 additions and 1,049 deletions.
5 changes: 4 additions & 1 deletion docusaurus/docs/reactnative/basics/offline_support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ yarn add [email protected]

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

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

Expand Down
8 changes: 0 additions & 8 deletions docusaurus/docs/reactnative/customization/native_handlers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ This should be done outside of the component lifecycle to prevent unnecessarily

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.

### BlurView

A component that blurs the view behind it.

**React Native:** [`@react-native-community/blur`](https://github.com/Kureev/react-native-blur)

**Expo:** [`expo-blur`](https://docs.expo.io/versions/latest/sdk/blur-view/)

### compressImage

An async function that compresses an image and returns the local `uri` of the compressed image.
Expand Down
6 changes: 4 additions & 2 deletions docusaurus/docs/reactnative/guides/push_notifications_v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ const requestPermission = async () => {
const App = () => {
const [isReady, setIsReady] = useState(false);
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();
useEffect(() => {
let unsubscribeTokenRefreshListener;
// Register FCM token with stream chat server.
const registerPushToken = async () => {
// unsubscribe any previous listener
unsubscribeTokenRefreshListenerRef.current?.();
const token = await messaging().getToken();
await client.addDevice(token, 'firebase');
Expand All @@ -144,7 +146,7 @@ const App = () => {
return async () => {
await client?.disconnectUser();
unsubscribeTokenRefreshListener?.();
unsubscribeTokenRefreshListenerRef.current?.();
};
}, []);
Expand Down
9 changes: 5 additions & 4 deletions docusaurus/docs/reactnative/guides/push_notifications_v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Easiest way to integrate push notifications in your Chat applications is using F
- They were mentioned
- Messages from muted users are not sent.
- Messages are sent to all registered devices for a user (up to 25).
- Up to 100 members of a channel will receive push notifications.
- skip_push is marked as false, as described [here](https://getstream.io/chat/docs/javascript/send_message/?language=javascript#complex-example).
- push_notifications is enabled (default) on the channel type for the sent message.

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

const App = () => {
const [isReady, setIsReady] = useState(false);
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();

useEffect(() => {
let unsubscribeTokenRefreshListener;
// Register FCM token with stream chat server.
const registerPushToken = async () => {
// unsubscribe any previous listener
unsubscribeTokenRefreshListenerRef.current?.();
const token = await messaging().getToken();
const push_provider = 'firebase';
const push_provider_name = 'MyRNAppFirebasePush'; // name an alias for your push provider (optional)
Expand All @@ -161,7 +162,7 @@ const App = () => {
}
};

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

return async () => {
await client?.disconnectUser();
unsubscribeTokenRefreshListener?.();
unsubscribeTokenRefreshListenerRef.current?.();
};
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ const requestPermission = async () => {
const App = () => {
const [isReady, setIsReady] = useState(false);
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();
useEffect(() => {
let unsubscribeTokenRefreshListener;
// Register FCM token with stream chat server.
const registerPushToken = async () => {
// unsubscribe any previous listener
unsubscribeTokenRefreshListenerRef.current?.();
const token = await messaging().getToken();
await client.addDevice(token, 'firebase');
Expand All @@ -144,7 +146,7 @@ const App = () => {
return async () => {
await client?.disconnectUser();
unsubscribeTokenRefreshListener?.();
unsubscribeTokenRefreshListenerRef.current?.();
};
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ const requestPermission = async () => {

const App = () => {
const [isReady, setIsReady] = useState(false);
const unsubscribeTokenRefreshListenerRef = useRef<() => void>();

useEffect(() => {
let unsubscribeTokenRefreshListener;
// Register FCM token with stream chat server.
const registerPushToken = async () => {
// unsubscribe any previous listener
unsubscribeTokenRefreshListenerRef.current?.();
const token = await messaging().getToken();
const push_provider = 'firebase';
const push_provider_name = 'MyRNAppFirebasePush'; // name an alias for your push provider (optional)
Expand All @@ -156,7 +158,7 @@ const App = () => {
}
};

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

return async () => {
await client?.disconnectUser();
unsubscribeTokenRefreshListener?.();
unsubscribeTokenRefreshListenerRef.current?.();
};
}, []);

Expand Down
6 changes: 5 additions & 1 deletion examples/SampleApp/src/screens/ChannelImagesScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export const ChannelImagesScreen: React.FC<ChannelImagesScreenProps> = ({
params: { channel },
},
}) => {
const { images, setImage, setImages } = useImageGalleryContext<StreamChatGenerics>();
const {
messages: images,
setMessages: setImages,
setSelectedMessage: setImage,
} = useImageGalleryContext<StreamChatGenerics>();
const { setOverlay } = useOverlayContext();
const { loading, loadMore, messages } = usePaginatedAttachments(channel, 'image');
const {
Expand Down
39 changes: 0 additions & 39 deletions package/src/components/Channel/Channel.md

This file was deleted.

18 changes: 0 additions & 18 deletions package/src/components/ChannelList/ChannelList.md

This file was deleted.

19 changes: 0 additions & 19 deletions package/src/components/ChannelList/ChannelListMessenger.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('useAppSettings', () => {
auto_translation_enabled: true,
}),
),
userID: 'some-user-id',
} as unknown as StreamChat,
isOnline,
);
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/Chat/hooks/useAppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useAppSettings = <
}
}

if (isOnline) {
if (isOnline && client.userID) {
getAppSettings();
}

Expand Down
22 changes: 0 additions & 22 deletions package/src/components/Message/Message.md

This file was deleted.

4 changes: 0 additions & 4 deletions package/src/components/Message/MessageSimple/MessageText.md

This file was deleted.

11 changes: 0 additions & 11 deletions package/src/components/Message/MessageSimple/utils/renderText.md

This file was deleted.

1 change: 0 additions & 1 deletion package/src/components/docs/AttachmentProps.md

This file was deleted.

14 changes: 0 additions & 14 deletions package/src/components/docs/ListProps.md

This file was deleted.

1 change: 0 additions & 1 deletion package/src/components/docs/MessageProps.md

This file was deleted.

7 changes: 0 additions & 7 deletions package/src/components/docs/PreviewProps.md

This file was deleted.

37 changes: 0 additions & 37 deletions package/src/contexts/channelContext/ChannelContext.md

This file was deleted.

Loading

0 comments on commit ce96cc5

Please sign in to comment.