stream-chat-react-native 9.7.2 → 9.7.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,7 @@
19
19
  - [Stream Chat API](https://getstream.io/chat/) product overview
20
20
  - [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat
21
21
  - [React Native Chat Tutorial](https://getstream.io/chat/react-native-chat/tutorial/)
22
+ - [AI Agent Skills](#-build-with-ai-agents) for Claude Code, Cursor, and Codex
22
23
  - [Chat UI Kit](https://getstream.io/chat/ui-kit/)
23
24
  - [Documentation](https://getstream.io/chat/docs/sdk/reactnative)
24
25
  - [Release Notes](https://github.com/GetStream/stream-chat-react-native/releases)
@@ -28,6 +29,7 @@
28
29
  - [Official React Native SDK for Stream Chat](#official-react-native-sdk-for-stream-chat)
29
30
  - [Contents](#contents)
30
31
  - [📖 React Native Chat Tutorial](#-react-native-chat-tutorial)
32
+ - [🤖 Build with AI Agents](#-build-with-ai-agents)
31
33
  - [Free for Makers](#free-for-makers)
32
34
  - [🔮 Example Apps](#-example-apps)
33
35
  - [💬 Keep in mind](#-keep-in-mind)
@@ -39,6 +41,26 @@
39
41
 
40
42
  The best place to start is the [React Native Chat Tutorial](https://getstream.io/chat/react-native-chat/tutorial/). It teaches you how to use this SDK and also shows how to make frequently required changes.
41
43
 
44
+ ## 🤖 Build with AI Agents
45
+
46
+ If you build with an AI coding agent, our [agent skills](https://getstream.io/agent-skills/docs/installation/) teach it how to use this SDK correctly. Install them once:
47
+
48
+ ```bash
49
+ curl -fsSL https://getstream.io/cli.sh | bash
50
+ getstream init
51
+ ```
52
+
53
+ Then reach for the [`/stream-react-native`](https://getstream.io/agent-skills/docs/skills/stream-react-native/) skill:
54
+
55
+ ```
56
+ /stream-react-native create a new Expo chat app
57
+ /stream-react-native upgrade stream-chat-react-native to v9
58
+ ```
59
+
60
+ It can scaffold a new Expo or React Native CLI app with the SDK wired up, add Stream to an app you already have, audit an existing integration, or migrate between SDK major versions (including from Sendbird). Works with Claude Code, Cursor, Codex, and any other agent that reads the universal `.agents` location.
61
+
62
+ Contributing to this repository with an agent instead? See [AGENTS.md](./AGENTS.md) for repository structure, commands, and conventions.
63
+
42
64
  ## Free for Makers
43
65
 
44
66
  Stream is free for most side and hobby projects. To qualify your project/company needs to have < 5 team members and < $10k in monthly revenue.
@@ -22,7 +22,11 @@ public final class StreamVideoThumbnailResult: NSObject {
22
22
  @objcMembers
23
23
  public final class StreamVideoThumbnailGenerator: NSObject {
24
24
  private static let compressionQuality: CGFloat = 0.8
25
- private static let maxDimension: CGFloat = 512
25
+ // We intentionally use a lower maxDimension for iOS, as we are trying to mimic
26
+ // what a .fastFormat delivery type of the image would do. Although theoretically
27
+ // smaller (around 120px) after some benchmarking we figured that 256 was perfectly
28
+ // fine and adds just a tiny bit of overhead for a visible quality increase.
29
+ private static let maxDimension: CGFloat = 256
26
30
  private static let cacheVersion = "v1"
27
31
  private static let cacheDirectoryName = "@stream-io-stream-video-thumbnails"
28
32
  private static let maxConcurrentGenerations = 5
@@ -209,7 +213,16 @@ public final class StreamVideoThumbnailGenerator: NSObject {
209
213
  // serves a locally cached thumbnail even for iCloud only assets, so this
210
214
  // avoids downloading the entire video the way requestAVAsset(forVideo:) would.
211
215
  let options = PHImageRequestOptions()
212
- options.deliveryMode = .fastFormat
216
+ // `.highQualityFormat` instead of `.fastFormat` here, as the latter only serves
217
+ // an already cached poster derivative and will NOT generate one on demand, so
218
+ // it fails (PHPhotosError 3303) for assets that have no cached thumbnail yet,
219
+ // i.e videos added to a Simulator via `simctl addmedia`, which never get
220
+ // their derivatives generated. `.highQualityFormat` still delivers a single
221
+ // final image (matching the "accept the first delivered image" logic below)
222
+ // and only fetches the poster frame, not the whole video. If a poster frame does
223
+ // not exist, it will generate one on the fly (only the first time, all subsequent
224
+ // request will return the cached one).
225
+ options.deliveryMode = .highQualityFormat
213
226
  options.resizeMode = .fast
214
227
  options.isNetworkAccessAllowed = true
215
228
  options.isSynchronous = false
@@ -262,8 +275,8 @@ public final class StreamVideoThumbnailGenerator: NSObject {
262
275
  contentMode: .aspectFit,
263
276
  options: options
264
277
  ) { image, info in
265
- // Accept the first delivered image (.fastFormat sends exactly one,
266
- // thumbnail quality, possibly flagged degraded and that's what we want).
278
+ // Accept the first delivered image (.highQualityFormat sends exactly
279
+ // one and we still guard against any extra deliveries).
267
280
  state.lock.lock()
268
281
  if state.didResume {
269
282
  state.lock.unlock()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native",
3
3
  "description": "The official React Native SDK for Stream Chat, a service for building chat applications",
4
- "version": "9.7.2",
4
+ "version": "9.7.3-beta.2",
5
5
  "homepage": "https://www.npmjs.com/package/stream-chat-react-native",
6
6
  "author": {
7
7
  "company": "Stream.io Inc",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "es6-symbol": "^3.1.3",
32
32
  "mime": "^4.0.7",
33
- "stream-chat-react-native-core": "9.7.2"
33
+ "stream-chat-react-native-core": "9.7.3-beta.2"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@react-native-camera-roll/camera-roll": ">=7.9.0",
@@ -78,11 +78,14 @@
78
78
  }
79
79
  },
80
80
  "scripts": {
81
+ "typecheck": "tsc --noEmit -p tsconfig.json",
81
82
  "prepack": "bash ../scripts/sync-shared-native.sh native-package && cp ../../README.md .",
82
83
  "postpack": "rm README.md && bash ../scripts/clean-shared-native-copies.sh native-package"
83
84
  },
84
85
  "devDependencies": {
85
- "react-native": "0.86.0"
86
+ "@stream-io/typescript-config": "workspace:^",
87
+ "react-native": "0.86.0",
88
+ "typescript": "6.0.3"
86
89
  },
87
90
  "codegenConfig": {
88
91
  "name": "StreamChatReactNativeSpec",
@@ -150,7 +150,7 @@ class _Audio {
150
150
  await verifyAndroidPermissions();
151
151
  } catch (err) {
152
152
  console.warn('Audio Recording Permissions error', err);
153
- return;
153
+ return { accessGranted: false, recording: null };
154
154
  }
155
155
  }
156
156
  try {
@@ -22,6 +22,8 @@ let AudioVideoComponent:
22
22
  };
23
23
  ignoreSilentSwitch?: 'ignore' | 'obey';
24
24
  repeat?: boolean;
25
+ resizeMode?: string;
26
+ rate?: number;
25
27
  }>
26
28
  | undefined;
27
29
 
@@ -40,6 +40,7 @@ export const shareImage = RNShare
40
40
  return true;
41
41
  } catch (error) {
42
42
  console.warn('Sharing failed...', error);
43
+ return false;
43
44
  }
44
45
  }
45
46
  : null;