Skip to content

Commit bcc2bad

Browse files
Merge pull request #1210 from GetStream/develop
Next Release
2 parents 3d0cbb5 + 23ec062 commit bcc2bad

File tree

130 files changed

+6536
-3154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+6536
-3154
lines changed

docusaurus/docs/reactnative/basics/getting_started.mdx

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,29 +99,56 @@ To be able to use the Stream Chat React Native SDK, a few dependencies must meet
9999

100100
### Additional Steps
101101

102-
- `react-native` - [additional installation steps](https://reactnative.dev/docs/image#gif-and-webp-support-on-android)
103-
- `react-native-reanimated` - [additional installation steps](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation).
104-
- `react-native-image-crop-picker` - [additional installation steps](https://github.com/ivpusic/react-native-image-crop-picker#step-3)
105-
- `react-native-cameraroll` - [additional installation steps](https://github.com/react-native-cameraroll/react-native-cameraroll#permissions)
102+
For some of the packages listed below, there are additional steps required to setup the package:
103+
104+
- `react-native-reanimated` - [additional installation steps](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation)
105+
106+
Add Reanimated's babel plugin to your babel.config.js:
107+
108+
```js
109+
module.exports = {
110+
...
111+
plugins: [
112+
...
113+
'react-native-reanimated/plugin',
114+
],
115+
};
116+
```
117+
106118
- `react-native-gesture-handler` - [additional installation steps](https://docs.swmansion.com/react-native-gesture-handler/docs/#android)
107119

108-
:::info
120+
RNGH requires the package to be imported at the **top of the entry file** before anything else, this is usually your `App.js` or `index.js` file.
109121

110-
`react-native-gesture-handler` requires the package to be imported at the **top of the entry file** before anything else, this is usually your `App.js` or `index.js` file.
122+
```tsx
123+
import 'react-native-gesture-handler';
124+
import { AppRegistry } from 'react-native';
111125

112-
<br />
126+
import App from './App';
127+
import { name as appName } from './app.json';
113128

114-
```tsx
115-
import 'react-native-gesture-handler';
116-
import { AppRegistry } from 'react-native';
129+
AppRegistry.registerComponent(appName, () => App);
130+
```
117131

118-
import App from './App';
119-
import { name as appName } from './app.json';
132+
Also wrap your entry point with `<GestureHandlerRootView>` or `gestureHandlerRootHO`
120133

121-
AppRegistry.registerComponent(appName, () => App);
122-
```
134+
```jsx
135+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
136+
import { OverlayProvider } from 'stream-chat-react-native';
123137

124-
:::
138+
export default function App() {
139+
return (
140+
<GestureHandlerRootView>
141+
<OverlayProvider>{/* Your app code goes here */}</OverlayProvider>
142+
</GestureHandlerRootView>
143+
);
144+
}
145+
```
146+
147+
Please take a look at our Example Application for reference.
148+
149+
- `react-native` - [additional installation steps](https://reactnative.dev/docs/image#gif-and-webp-support-on-android)
150+
- `react-native-image-crop-picker` - [additional installation steps](https://github.com/ivpusic/react-native-image-crop-picker#step-3)
151+
- `react-native-cameraroll` - [additional installation steps](https://github.com/react-native-cameraroll/react-native-cameraroll#permissions)
125152

126153
:::note
127154

docusaurus/docs/reactnative/basics/troubleshooting.mdx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ client.on('channel.deleted', event => {
263263
## Touchables not working
264264

265265
If you are having trouble with pressing, swiping, or otherwise interacting with components it is likely the result of [React Native Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/docs/) not being properly setup.
266+
267+
:::note
268+
269+
If your React Native version is (>=0.68) you will need a version of >=2.0.0 for `react-native-gesture-handler` for your app to build.
270+
271+
:::
272+
266273
Be sure to follow all needed [additional steps](https://docs.swmansion.com/react-native-gesture-handler/docs/) to complete the installation.
267274

268275
This includes ensuring you import `react-native-gesture-handler` at the top of your app entry file.
@@ -271,7 +278,16 @@ This includes ensuring you import `react-native-gesture-handler` at the top of y
271278
import 'react-native-gesture-handler';
272279
```
273280

274-
And for Android you additionally need to update `MainActivity.java` to override the method for creating the `ReactRootView`.
281+
Also do not forget to wrap your component tree(probably above `OverlayProvider`) with `<GestureHandlerRootView>` or `gestureHandlerRootHOC` as mentioned in [RNGH Installation docs](https://docs.swmansion.com/react-native-gesture-handler/docs/installation#js). Not doing so, can cause unusual behaviour with the `MessageOverlay` and `Imagegallery` gestures.
282+
283+
```tsx
284+
<GestureHandlerRootView style={{ flex: 1 }}>
285+
<OverlayProvider>// Other underlying components</OverlayProvider>
286+
</GestureHandlerRootView>
287+
```
288+
289+
If you are using v1 of `react-native-gesture-handler` library, then you will need extra setup steps for Android.
290+
Update `MainActivity.java` to override the method for creating the `ReactRootView` as mentioned in [RNGH Installation docs](https://docs.swmansion.com/react-native-gesture-handler/docs/installation#js).
275291

276292
```java {4-6,13-21}
277293
package com.swmansion.gesturehandler.react.example;
@@ -298,10 +314,13 @@ public class MainActivity extends ReactActivity {
298314
}
299315
```
300316
301-
## Custom touchable not working
317+
## Touchables Inside Custom Components Are Not Working
302318
303319
If you find that a customization that includes a touchable is not working, or the wrong element is receiving the touch event, this is likely related to [React Native Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/docs/).
304-
Your component may be being rendered inside of a gesture handler; nested gesture handlers and touchables need special treatment and can act differently on iOS & Android.
320+
The following could be the reasons behind the issues you might be facing:
321+
322+
- Your component may be being rendered inside of a gesture handler.
323+
- Nested gesture handlers and touchables need special treatment and can act differently on iOS & Android. If you want Nested Touchables to work on Android you should add the prop `disallowInterruption` as mentioned [here](https://github.com/software-mansion/react-native-gesture-handler/issues/784#issuecomment-786471220).
305324
306325
There are solutions available for almost all use cases so looking into your specific use case in relation to React Native Gesture Handler is suggested.
307326
The solution may require using a different touchable from React Native Gesture Handler and React Native depending on the platform.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The Giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values.
2+
3+
| Type | Default |
4+
| ------ | -------------- |
5+
| string | 'fixed_height' |

docusaurus/docs/reactnative/contexts/messages_context.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import ForceAlignMessages from '../common-content/core-components/channel/props/
2323
import FormatDate from '../common-content/core-components/channel/props/format_date.mdx';
2424
import Gallery from '../common-content/core-components/channel/props/gallery.mdx';
2525
import Giphy from '../common-content/core-components/channel/props/giphy.mdx';
26+
import GiphyVersion from '../common-content/core-components/channel/props/giphy_version.mdx';
2627
import HandleBlock from '../common-content/core-components/channel/props/handle_block.mdx';
2728
import HandleCopy from '../common-content/core-components/channel/props/handle_copy.mdx';
2829
import HandleDelete from '../common-content/core-components/channel/props/handle_delete.mdx';
@@ -291,6 +292,10 @@ Upserts a given message in local channel state. Please note that this function d
291292

292293
<Giphy />
293294

295+
### <div class="label description">_forwarded from [Channel](../core-components/channel.mdx#giphyversion)_ props</div> giphyVersion {#giphyversion}
296+
297+
<GiphyVersion />
298+
294299
### <div class="label description">_forwarded from [Channel](../core-components/channel.mdx#inlinedateseparator)_ props</div> InlineDateSeparator {#inlinedateseparator}
295300

296301
<InlineDateSeparator />

docusaurus/docs/reactnative/core-components/channel.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import FormatDate from '../common-content/core-components/channel/props/format_d
4949
import Gallery from '../common-content/core-components/channel/props/gallery.mdx';
5050
import Giphy from '../common-content/core-components/channel/props/giphy.mdx';
5151
import GiphyEnabled from '../common-content/core-components/channel/props/giphy_enabled.mdx';
52+
import GiphyVersion from '../common-content/core-components/channel/props/giphy_version.mdx';
5253
import HandleBlock from '../common-content/core-components/channel/props/handle_block.mdx';
5354
import HandleCopy from '../common-content/core-components/channel/props/handle_copy.mdx';
5455
import HandleDelete from '../common-content/core-components/channel/props/handle_delete.mdx';
@@ -436,6 +437,10 @@ The max allowable is 255, which when reached displays as `255+`.
436437
| ------ | ------- |
437438
| number | 255 |
438439

440+
### giphyVersion
441+
442+
<GiphyVersion />
443+
439444
### handleBlock
440445

441446
<HandleBlock />

examples/ExpoMessaging/.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,64 @@ web-report/
1212

1313
# macOS
1414
.DS_Store
15+
16+
# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
17+
# The following patterns were generated by expo-cli
18+
19+
# OSX
20+
#
21+
.DS_Store
22+
23+
# Xcode
24+
#
25+
build/
26+
*.pbxuser
27+
!default.pbxuser
28+
*.mode1v3
29+
!default.mode1v3
30+
*.mode2v3
31+
!default.mode2v3
32+
*.perspectivev3
33+
!default.perspectivev3
34+
xcuserdata
35+
*.xccheckout
36+
*.moved-aside
37+
DerivedData
38+
*.hmap
39+
*.ipa
40+
*.xcuserstate
41+
project.xcworkspace
42+
43+
# Android/IntelliJ
44+
#
45+
build/
46+
.idea
47+
.gradle
48+
local.properties
49+
*.iml
50+
*.hprof
51+
52+
# node.js
53+
#
54+
node_modules/
55+
npm-debug.log
56+
yarn-error.log
57+
58+
# BUCK
59+
buck-out/
60+
\.buckd/
61+
*.keystore
62+
!debug.keystore
63+
64+
# Bundle artifacts
65+
*.jsbundle
66+
67+
# CocoaPods
68+
/ios/Pods/
69+
70+
# Expo
71+
.expo/
72+
web-build/
73+
dist/
74+
75+
# @end expo-cli

examples/ExpoMessaging/App.js

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from 'stream-chat-expo';
2020

2121
import { useStreamChatTheme } from './useStreamChatTheme';
22+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
2223

2324
LogBox.ignoreAllLogs(true);
2425

@@ -154,41 +155,43 @@ const App = () => {
154155
}}
155156
>
156157
<AppContext.Provider value={{ channel, setChannel, setThread, thread }}>
157-
<OverlayProvider
158-
bottomInset={bottom}
159-
i18nInstance={streami18n}
160-
translucentStatusBar
161-
value={{ style: theme }}
162-
>
163-
{clientReady && (
164-
<Stack.Navigator
165-
initialRouteName='ChannelList'
166-
screenOptions={{
167-
headerTitleStyle: { alignSelf: 'center', fontWeight: 'bold' },
168-
}}
169-
>
170-
<Stack.Screen
171-
component={ChannelScreen}
172-
name='Channel'
173-
options={() => ({
174-
headerBackTitle: 'Back',
175-
headerRight: () => <></>,
176-
headerTitle: channel?.data?.name,
177-
})}
178-
/>
179-
<Stack.Screen
180-
component={ChannelListScreen}
181-
name='ChannelList'
182-
options={{ headerTitle: 'Channel List' }}
183-
/>
184-
<Stack.Screen
185-
component={ThreadScreen}
186-
name='Thread'
187-
options={() => ({ headerLeft: () => <></> })}
188-
/>
189-
</Stack.Navigator>
190-
)}
191-
</OverlayProvider>
158+
<GestureHandlerRootView style={{ flex: 1 }}>
159+
<OverlayProvider
160+
bottomInset={bottom}
161+
i18nInstance={streami18n}
162+
translucentStatusBar
163+
value={{ style: theme }}
164+
>
165+
{clientReady && (
166+
<Stack.Navigator
167+
initialRouteName='ChannelList'
168+
screenOptions={{
169+
headerTitleStyle: { alignSelf: 'center', fontWeight: 'bold' },
170+
}}
171+
>
172+
<Stack.Screen
173+
component={ChannelScreen}
174+
name='Channel'
175+
options={() => ({
176+
headerBackTitle: 'Back',
177+
headerRight: () => <></>,
178+
headerTitle: channel?.data?.name,
179+
})}
180+
/>
181+
<Stack.Screen
182+
component={ChannelListScreen}
183+
name='ChannelList'
184+
options={{ headerTitle: 'Channel List' }}
185+
/>
186+
<Stack.Screen
187+
component={ThreadScreen}
188+
name='Thread'
189+
options={() => ({ headerLeft: () => <></> })}
190+
/>
191+
</Stack.Navigator>
192+
)}
193+
</OverlayProvider>
194+
</GestureHandlerRootView>
192195
</AppContext.Provider>
193196
</NavigationContainer>
194197
);
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "io.stream.expomessaging",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "io.stream.expomessaging",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)