Skip to content

Commit ee6ffc6

Browse files
authored
Merge pull request #1747 from GetStream/develop
Next Release
2 parents f41e9fd + 206c898 commit ee6ffc6

File tree

83 files changed

+2658
-2260
lines changed

Some content is hidden

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

83 files changed

+2658
-2260
lines changed

docusaurus/docs/reactnative/basics/getting_started.mdx

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ Most if not all of the required packages now support auto-linking so setup shoul
7070
<TabItem value='yarn'>
7171

7272
```bash
73-
yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-share react-native-svg
73+
yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-svg
7474
```
7575

7676
</TabItem>
7777
<TabItem value='npm'>
7878

7979
```bash
80-
npm install @react-native-camera-roll/camera-roll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-share react-native-svg
80+
npm install @react-native-camera-roll/camera-roll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-svg
8181
```
8282

8383
</TabItem>
@@ -91,6 +91,7 @@ To be able to use the Stream Chat React Native SDK, a few dependencies must meet
9191

9292
| react-native | stream-chat-react-native (min required) | react-native-reanimated (min required) |
9393
| ------------ | --------------------------------------- | -------------------------------------- |
94+
| 0.70 | 5.3.1 | 2.10.0 |
9495
| 0.69 | 4.13.0 | 2.9.1 |
9596
| 0.68 | 4.11.0 | 2.7.0 |
9697
| 0.67 | 4.2.0 | 2.4.0 |
@@ -198,6 +199,64 @@ include ':react-native-video'
198199
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
199200
```
200201

202+
#### Sharing attachments
203+
204+
Install `react-native-share` in your React Native project.
205+
206+
Installing this package will allow your users to share attachments from the gallery using the native sharing interface on their devices.
207+
208+
<Tabs
209+
defaultValue='yarn'
210+
values={[
211+
{ label: 'Yarn', value: 'yarn' },
212+
{ label: 'npm', value: 'npm' },
213+
]}
214+
>
215+
<TabItem value='yarn'>
216+
217+
```bash
218+
yarn add react-native-share
219+
```
220+
221+
</TabItem>
222+
<TabItem value='npm'>
223+
224+
```bash
225+
npm install react-native-share
226+
```
227+
228+
</TabItem>
229+
</Tabs>
230+
231+
#### Haptic feedback
232+
233+
Install `react-native-haptic-feedback` in your React Native project.
234+
235+
Installing this package will enable haptic feedback when scaling images in the image gallery if the scaling hits the higher or lower limits for its value.
236+
237+
<Tabs
238+
defaultValue='yarn'
239+
values={[
240+
{ label: 'Yarn', value: 'yarn' },
241+
{ label: 'npm', value: 'npm' },
242+
]}
243+
>
244+
<TabItem value='yarn'>
245+
246+
```bash
247+
yarn add react-native-haptic-feedback
248+
```
249+
250+
</TabItem>
251+
<TabItem value='npm'>
252+
253+
```bash
254+
npm install react-native-haptic-feedback
255+
```
256+
257+
</TabItem>
258+
</Tabs>
259+
201260
### AndroidX Support
202261

203262
> AndroidX is a major step forward in the Android ecosystem, and the old support library artifacts are being deprecated.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Messages with message list are grouped with some smart logic e.g., avatar of sender only appears for last message of the group.
2+
Messages are grouped together on UI if they are sent back to back by a user within certain timeframe (this timeframe can be controlled by
3+
a prop `MaxTimeBetweenGroupedMessages` on Channel component). `getMessagesGroupStyles` prop can be used to override the logic
4+
which determines the position of particular message within a group of messages e.g., top, bottom, middle, single etc. And depending
5+
on value, certain UI elements are hidden or shown on UI e.g, message timestamp, user avatar etc.
6+
You can find the default logic in [`getGroupStyles`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/components/MessageList/utils/getGroupStyles.ts) function.
7+
8+
Group styles returned by this function can be accessed by `groupStyles` value from [`MessageContext`](../../../../contexts/message_context.mdx)
9+
within custom components.
10+
11+
| Type |
12+
| -------- |
13+
| function |

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import FlatList from '../common-content/core-components/channel/props/flat_list.
4848
import ForceAlignMessages from '../common-content/core-components/channel/props/force_align_messages.mdx';
4949
import FormatDate from '../common-content/core-components/channel/props/format_date.mdx';
5050
import Gallery from '../common-content/core-components/channel/props/gallery.mdx';
51+
import GetMessagesGroupStyles from '../common-content/core-components/channel/props/get_messages_group_styles.mdx';
5152
import Giphy from '../common-content/core-components/channel/props/giphy.mdx';
5253
import GiphyEnabled from '../common-content/core-components/channel/props/giphy_enabled.mdx';
5354
import GiphyVersion from '../common-content/core-components/channel/props/giphy_version.mdx';
@@ -431,6 +432,10 @@ const doUpdateMessageRequest = (channelId, messageObject) => {
431432

432433
<FormatDate />
433434

435+
### getMessagesGroupStyles
436+
437+
<GetMessagesGroupStyles />
438+
434439
### giphyEnabled
435440

436441
<GiphyEnabled />

examples/SampleApp/.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
ios/.xcode.env.local
2324

2425
# Android/IntelliJ
2526
#
@@ -29,6 +30,7 @@ build/
2930
local.properties
3031
*.iml
3132
*.hprof
33+
.cxx/
3234

3335
# node.js
3436
#
@@ -49,9 +51,11 @@ buck-out/
4951
# For more information about the recommended setup visit:
5052
# https://docs.fastlane.tools/best-practices/source-control/
5153

52-
*/fastlane/report.xml
53-
*/fastlane/Preview.html
54-
*/fastlane/screenshots
54+
55+
**/fastlane/report.xml
56+
**/fastlane/Preview.html
57+
**/fastlane/screenshots
58+
**/fastlane/test_output
5559

5660
# Bundle artifact
5761
*.jsbundle

examples/SampleApp/android/app/build.gradle

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apply plugin: 'com.google.gms.google-services'
33
apply plugin: 'com.google.firebase.crashlytics'
44

55
import com.android.build.OutputFile
6+
import org.apache.tools.ant.taskdefs.condition.Os
67

78
/**
89
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -81,9 +82,6 @@ import com.android.build.OutputFile
8182

8283
project.ext.react = [
8384
enableHermes: true, // clean and rebuild if changing
84-
entryFile: "index.js",
85-
bundleAssetName: "index.android.bundle",
86-
bundleInRelease: true
8785
]
8886

8987
apply from: "../../node_modules/react-native/react.gradle"
@@ -128,7 +126,10 @@ def enableHermes = project.ext.react.get("enableHermes", true);
128126
/**
129127
* Architectures to build native code for in debug.
130128
*/
131-
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
129+
def reactNativeArchitectures() {
130+
def value = project.getProperties().get("reactNativeArchitectures")
131+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
132+
}
132133

133134
android {
134135
ndkVersion rootProject.ext.ndkVersion
@@ -138,32 +139,22 @@ android {
138139
defaultConfig {
139140
applicationId "com.sampleapp"
140141
minSdkVersion rootProject.ext.minSdkVersion
141-
targetSdkVersion rootProject.ext.targetSdkVersion
142142
multiDexEnabled true
143+
targetSdkVersion rootProject.ext.targetSdkVersion
143144
vectorDrawables.useSupportLibrary = true
144145
versionCode 22
145146
versionName "0.0.22"
146-
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
147-
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
148147
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
149148

150149
if (isNewArchitectureEnabled()) {
151-
// We configure the NDK build only if you decide to opt-in for the New Architecture.
150+
// We configure the CMake build only if you decide to opt-in for the New Architecture.
152151
externalNativeBuild {
153-
ndkBuild {
154-
arguments "APP_PLATFORM=android-21",
155-
"APP_STL=c++_shared",
156-
"NDK_TOOLCHAIN_VERSION=clang",
157-
"GENERATED_SRC_DIR=$buildDir/generated/source",
158-
"PROJECT_BUILD_DIR=$buildDir",
159-
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
160-
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
161-
"NODE_MODULES_DIR=$rootDir/../node_modules"
162-
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
163-
cppFlags "-std=c++17"
164-
// Make sure this target name is the same you specify inside the
165-
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
166-
targets "rndiffapp_appmodules"
152+
cmake {
153+
arguments "-DPROJECT_BUILD_DIR=$buildDir",
154+
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
155+
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
156+
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
157+
"-DANDROID_STL=c++_shared"
167158
}
168159
}
169160
if (!enableSeparateBuildPerCPUArchitecture) {
@@ -177,8 +168,8 @@ android {
177168
if (isNewArchitectureEnabled()) {
178169
// We configure the NDK build only if you decide to opt-in for the New Architecture.
179170
externalNativeBuild {
180-
ndkBuild {
181-
path "$projectDir/src/main/jni/Android.mk"
171+
cmake {
172+
path "$projectDir/src/main/jni/CMakeLists.txt"
182173
}
183174
}
184175
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
@@ -200,15 +191,15 @@ android {
200191
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
201192

202193
// Due to a bug inside AGP, we have to explicitly set a dependency
203-
// between configureNdkBuild* tasks and the preBuild tasks.
194+
// between configureCMakeDebug* tasks and the preBuild tasks.
204195
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
205-
configureNdkBuildRelease.dependsOn(preReleaseBuild)
206-
configureNdkBuildDebug.dependsOn(preDebugBuild)
196+
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
197+
configureCMakeDebug.dependsOn(preDebugBuild)
207198
reactNativeArchitectures().each { architecture ->
208-
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
199+
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
209200
dependsOn("preDebugBuild")
210201
}
211-
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
202+
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
212203
dependsOn("preReleaseBuild")
213204
}
214205
}
@@ -220,7 +211,7 @@ android {
220211
reset()
221212
enable enableSeparateBuildPerCPUArchitecture
222213
universalApk false // If true, also generate a universal APK
223-
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
214+
include (*reactNativeArchitectures())
224215
}
225216
}
226217
signingConfigs {
@@ -235,17 +226,12 @@ android {
235226
debug {
236227
signingConfig signingConfigs.debug
237228
}
238-
if (nativeArchitectures) {
239-
ndk {
240-
abiFilters nativeArchitectures.split(',')
241-
}
242-
}
229+
243230
release {
244231
// Caution! In production, you need to generate your own keystore file.
245232
// see https://reactnative.dev/docs/signed-apk-android.
246233
signingConfig signingConfigs.debug
247234
minifyEnabled enableProguardInReleaseBuilds
248-
shrinkResources enableProguardInReleaseBuilds
249235
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
250236
}
251237
}
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
43

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
4+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
65

7-
<application
8-
android:usesCleartextTraffic="true"
9-
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
6+
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning">
117
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
128
</application>
13-
</manifest>
9+
</manifest>

examples/SampleApp/android/app/src/debug/java/com/sampleapp/ReactNativeFlipper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
2+
* Copyright (c) Meta Platforms, Inc. and its affiliates.
33
*
44
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
55
* directory of this source tree.
Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,27 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.sampleapp">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sampleapp">
32

4-
<uses-permission android:name="android.permission.INTERNET" />
5-
<uses-permission android:name="android.permission.CAMERA" />
6-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
7-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
3+
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.CAMERA" />
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
87

9-
<queries>
10-
<intent>
11-
<action android:name="android.intent.action.VIEW" />
12-
<data android:scheme="http" android:host="*" />
13-
</intent>
14-
<intent>
15-
<action android:name="android.intent.action.VIEW" />
16-
<data android:scheme="https" android:host="*" />
17-
</intent>
18-
</queries>
8+
<queries>
9+
<intent>
10+
<action android:name="android.intent.action.VIEW" />
11+
<data android:scheme="http" android:host="*" />
12+
</intent>
13+
<intent>
14+
<action android:name="android.intent.action.VIEW" />
15+
<data android:scheme="https" android:host="*" />
16+
</intent>
17+
</queries>
1918

20-
<application
21-
android:usesCleartextTraffic="true"
22-
android:name=".MainApplication"
23-
android:label="@string/app_name"
24-
android:icon="@mipmap/ic_launcher"
25-
android:roundIcon="@mipmap/ic_launcher_round"
26-
android:allowBackup="false"
27-
android:requestLegacyExternalStorage="true"
28-
android:networkSecurityConfig="@xml/network_security_config"
29-
android:theme="@style/AppTheme">
30-
<activity
31-
android:name=".MainActivity"
32-
android:label="@string/app_name"
33-
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
34-
android:screenOrientation="portrait"
35-
android:launchMode="singleTask"
36-
android:windowSoftInputMode="adjustResize"
37-
android:exported="true">
38-
<intent-filter>
39-
<action android:name="android.intent.action.MAIN" />
40-
<category android:name="android.intent.category.LAUNCHER" />
41-
</intent-filter>
42-
</activity>
43-
</application>
44-
</manifest>
19+
<application android:usesCleartextTraffic="true" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:requestLegacyExternalStorage="true" android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/AppTheme">
20+
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:screenOrientation="portrait" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true">
21+
<intent-filter>
22+
<action android:name="android.intent.action.MAIN" />
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
</manifest>

0 commit comments

Comments
 (0)