Skip to content

Commit ca61899

Browse files
authored
Merge pull request #2168 from GetStream/develop
Next release
2 parents 0f0954a + 032b308 commit ca61899

File tree

17 files changed

+139
-109
lines changed

17 files changed

+139
-109
lines changed

docusaurus/reactnative_versioned_docs/version-4.x.x/guides/push_notifications_v2.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@ client.updateAppSettings({
112112
113113
Once you configure the Firebase server key and set it up on the Stream dashboard, a device that is supposed to receive push notifications needs to be registered at the Stream backend. This is usually done by listening for the Firebase device token.
114114
115-
:::caution
116-
117-
Please note that, `client.addDevice` call requires a user token to be set on the client.
118-
So `client.addDevice` call should be made after `client.connectUser` in code.
119-
120-
:::
121-
122115
```js
123116
// Request Push Notification permission from device.
124117
const requestPermission = async () => {
@@ -203,6 +196,12 @@ const styles = StyleSheet.create({
203196
});
204197
```
205198
199+
:::note
200+
201+
Please note that `client.setLocalDevice` should be made before `client.connectUser` in code.
202+
203+
:::
204+
206205
## The Push Notification Message Payload
207206
208207
When a message is received by the Chat API, if the [requirements](#requirements) are met, it kicks a job to send a notification message to Firebase.

examples/ExpoMessaging/Readme.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,19 @@
3535

3636
```bash
3737
yarn android
38-
```
38+
```
39+
40+
**Note:**
41+
42+
If your Android build fails please add the following snippet on the `android/gradle.properties` to make it work.
43+
44+
```
45+
# Disabled hermes in favour of broken Android build due to the package `react-native-quick-sqlite`:
46+
# To Fix:
47+
# A problem occurred evaluating project ':react-native-quick-sqlite'.
48+
# > Cannot get property 'hermesEnabled' on extra properties extension as it does not exist
49+
hermesEnabled=true
50+
# disables the check for multiple instances for gesture handler
51+
# this is needed for react-native-gesture-handler to be both a devDep of core and be a dep on the expo sample app
52+
disableMultipleInstancesCheck=true
53+
```

examples/ExpoMessaging/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7105,10 +7105,10 @@ [email protected]:
71057105
version "0.0.0"
71067106
uid ""
71077107

7108-
7109-
version "5.15.0"
7110-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.0.tgz#e4d52ca3b492b7a3f2550049fccd85e025bfed2e"
7111-
integrity sha512-MJf9qV1MZf0r4HTt0afZGxF5/HytbY+Sap/8QTDNE6OucWmxa44kOY7SfHmfdkxOLTUPHMeK7Glc+wCmYZVVLA==
7108+
7109+
version "5.15.2"
7110+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.2.tgz#26c982907728eb3ad7d3bc34f68764935596c230"
7111+
integrity sha512-sFH/Ed667lJksHBG1VQjeJdcukWfT8qINhCKEw6WfFbog0XeFmHzs6juuT8mjcJ9SSyo0hYAKNRE34lT8p/t1Q==
71127112
dependencies:
71137113
"@babel/runtime" "^7.12.5"
71147114
"@gorhom/bottom-sheet" "4.4.5"

examples/SampleApp/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7055,10 +7055,10 @@ statuses@~1.5.0:
70557055
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
70567056
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
70577057

7058-
7059-
version "5.15.0"
7060-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.0.tgz#e4d52ca3b492b7a3f2550049fccd85e025bfed2e"
7061-
integrity sha512-MJf9qV1MZf0r4HTt0afZGxF5/HytbY+Sap/8QTDNE6OucWmxa44kOY7SfHmfdkxOLTUPHMeK7Glc+wCmYZVVLA==
7058+
7059+
version "5.15.2"
7060+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.2.tgz#26c982907728eb3ad7d3bc34f68764935596c230"
7061+
integrity sha512-sFH/Ed667lJksHBG1VQjeJdcukWfT8qINhCKEw6WfFbog0XeFmHzs6juuT8mjcJ9SSyo0hYAKNRE34lT8p/t1Q==
70627062
dependencies:
70637063
"@babel/runtime" "^7.12.5"
70647064
"@gorhom/bottom-sheet" "4.4.5"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '>= 2.6.10'
4+
ruby '>= 2.7.5'
55

6-
gem 'cocoapods', '>= 1.11.3'
6+
gem 'cocoapods', '>= 1.12.1'

examples/TypeScriptMessaging/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ EXTERNAL SOURCES:
708708
:path: "../node_modules/react-native/ReactCommon/yoga"
709709

710710
SPEC CHECKSUMS:
711-
boost: 57d2868c099736d80fcd648bf211b4431e51a558
711+
boost: a7c83b31436843459a1961bfd74b96033dc77234
712712
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
713713
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
714714
FBLazyVector: a89a0525bc7ca174675045c2b492b5280d5a2470
@@ -729,7 +729,7 @@ SPEC CHECKSUMS:
729729
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
730730
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
731731
PromisesSwift: cf9eb58666a43bbe007302226e510b16c1e10959
732-
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
732+
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
733733
RCTRequired: 5a4a30ac20c86eeadd6844a9328f78d4168cf9b2
734734
RCTTypeSafety: 279fc5861a89f0f37db3a585f27f971485b4b734
735735
React: 88307a9be3bd0e71a6822271cf28b84a587fb97f
@@ -781,4 +781,4 @@ SPEC CHECKSUMS:
781781

782782
PODFILE CHECKSUM: bdd8b333b6b53d6a2a80bcd28a1af34d2155ecca
783783

784-
COCOAPODS: 1.11.3
784+
COCOAPODS: 1.12.1

examples/TypeScriptMessaging/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7183,10 +7183,10 @@ statuses@~1.5.0:
71837183
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
71847184
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
71857185

7186-
7187-
version "5.15.0"
7188-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.0.tgz#e4d52ca3b492b7a3f2550049fccd85e025bfed2e"
7189-
integrity sha512-MJf9qV1MZf0r4HTt0afZGxF5/HytbY+Sap/8QTDNE6OucWmxa44kOY7SfHmfdkxOLTUPHMeK7Glc+wCmYZVVLA==
7186+
7187+
version "5.15.2"
7188+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.2.tgz#26c982907728eb3ad7d3bc34f68764935596c230"
7189+
integrity sha512-sFH/Ed667lJksHBG1VQjeJdcukWfT8qINhCKEw6WfFbog0XeFmHzs6juuT8mjcJ9SSyo0hYAKNRE34lT8p/t1Q==
71907190
dependencies:
71917191
"@babel/runtime" "^7.12.5"
71927192
"@gorhom/bottom-sheet" "4.4.5"

package/expo-package/yarn.lock

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

3039-
3040-
version "5.15.1"
3041-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.1.tgz#a7f8f3a5f2998bdd3f779d3dc82e3a0a8e0fec22"
3042-
integrity sha512-UnybqEl9nqDrTrvb8CU4gxDamr73Iv0M56rwxhPrTtPiWiVGpG4gddkfJVGpVGYTyCBm9CKKeNmYBktuEbeW8Q==
3039+
3040+
version "5.15.2"
3041+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.2.tgz#26c982907728eb3ad7d3bc34f68764935596c230"
3042+
integrity sha512-sFH/Ed667lJksHBG1VQjeJdcukWfT8qINhCKEw6WfFbog0XeFmHzs6juuT8mjcJ9SSyo0hYAKNRE34lT8p/t1Q==
30433043
dependencies:
30443044
"@babel/runtime" "^7.12.5"
30453045
"@gorhom/bottom-sheet" "4.4.5"

package/native-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4381,10 +4381,10 @@ statuses@~1.5.0:
43814381
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
43824382
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
43834383

4384-
4385-
version "5.15.1"
4386-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.1.tgz#a7f8f3a5f2998bdd3f779d3dc82e3a0a8e0fec22"
4387-
integrity sha512-UnybqEl9nqDrTrvb8CU4gxDamr73Iv0M56rwxhPrTtPiWiVGpG4gddkfJVGpVGYTyCBm9CKKeNmYBktuEbeW8Q==
4384+
4385+
version "5.15.2"
4386+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.2.tgz#26c982907728eb3ad7d3bc34f68764935596c230"
4387+
integrity sha512-sFH/Ed667lJksHBG1VQjeJdcukWfT8qINhCKEw6WfFbog0XeFmHzs6juuT8mjcJ9SSyo0hYAKNRE34lT8p/t1Q==
43884388
dependencies:
43894389
"@babel/runtime" "^7.12.5"
43904390
"@gorhom/bottom-sheet" "4.4.5"

package/src/components/Channel/Channel.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
2-
import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native';
2+
import { KeyboardAvoidingViewProps, Platform, StyleSheet, Text, View } from 'react-native';
33

44
import debounce from 'lodash/debounce';
55
import throttle from 'lodash/throttle';
@@ -74,7 +74,7 @@ import {
7474
ThumbsUpReaction,
7575
WutReaction,
7676
} from '../../icons';
77-
import { FlatList as FlatListDefault, pickDocument } from '../../native';
77+
import { FlatList as FlatListDefault, getLocalAssetUri, pickDocument } from '../../native';
7878
import * as dbApi from '../../store/apis';
7979
import type { DefaultStreamChatGenerics } from '../../types/types';
8080
import { addReactionToLocalState } from '../../utils/addReactionToLocalState';
@@ -1295,12 +1295,16 @@ const ChannelWithContext = <
12951295
attachment.image_url &&
12961296
isLocalUrl(attachment.image_url)
12971297
) {
1298-
const filename = file.uri.replace(/^(file:\/\/|content:\/\/|assets-library:\/\/)/, '');
1298+
// For the case of Expo CLI where you need to fetch the file uri from file id. Here it is only done for iOS since for android the file.uri is fine.
1299+
const localAssetURI =
1300+
Platform.OS === 'ios' && file.id && (await getLocalAssetUri(file.id));
1301+
const uri = localAssetURI || file.uri || '';
1302+
const filename = file.name ?? uri.replace(/^(file:\/\/|content:\/\/)/, '');
12991303
const contentType = lookup(filename) || 'multipart/form-data';
13001304

13011305
const uploadResponse = doImageUploadRequest
13021306
? await doImageUploadRequest(file, channel)
1303-
: await channel.sendImage(file?.uri, filename, contentType);
1307+
: await channel.sendImage(uri, filename, contentType);
13041308

13051309
attachment.image_url = uploadResponse.file;
13061310
delete attachment.originalFile;

0 commit comments

Comments
 (0)