@stream-io/video-react-native-sdk 1.20.14 → 1.20.15

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.20.15](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.20.14...@stream-io/video-react-native-sdk-1.20.15) (2025-09-17)
6
+
7
+ ### Dependency Updates
8
+
9
+ - `@stream-io/video-client` updated to version `1.31.0`
10
+ - `@stream-io/video-react-bindings` updated to version `1.8.3`
11
+
12
+ ### Bug Fixes
13
+
14
+ - screenshot for iOS was broken on old arch on interop layer ([#1923](https://github.com/GetStream/stream-video-js/issues/1923)) ([9b3134b](https://github.com/GetStream/stream-video-js/commit/9b3134bb6f6380551af4c3a0a69274eada2f8d94))
15
+
5
16
  ## [1.20.14](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.20.13...@stream-io/video-react-native-sdk-1.20.14) (2025-09-16)
6
17
 
7
18
  ### Dependency Updates
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '1.20.14';
7
+ const version = exports.version = '1.20.15';
8
8
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export const version = '1.20.14';
1
+ export const version = '1.20.15';
2
2
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const version = "1.20.14";
1
+ export declare const version = "1.20.15";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,10 +1,9 @@
1
- #import <React/RCTBridgeModule.h>
1
+ #import <React/RCTBridge.h>
2
2
  #import <React/RCTViewManager.h>
3
3
  #import <React/RCTEventEmitter.h>
4
4
  #import <React/RCTLog.h>
5
5
  #import <React/RCTUIManager.h>
6
6
  #import <React/RCTView.h>
7
- #import <React/RCTBridge.h>
8
7
  #import <React/UIView+React.h>
9
8
 
10
9
  #import <WebRTC/RTCCVPixelBuffer.h>
@@ -1,4 +1,5 @@
1
1
  #import <React/RCTEventEmitter.h>
2
+ #import <React/RCTBridge.h>
2
3
 
3
4
  @interface StreamVideoReactNative : RCTEventEmitter <RCTBridgeModule>
4
5
 
@@ -1,6 +1,7 @@
1
- #import <React/RCTBridgeModule.h>
1
+ #import <React/RCTBridge.h>
2
2
  #import <React/RCTEventEmitter.h>
3
3
  #import <React/RCTUIManager.h>
4
+ #import <React/RCTUIManagerUtils.h>
4
5
  #import <UIKit/UIKit.h>
5
6
  #import "StreamVideoReactNative.h"
6
7
  #import "WebRTCModule.h"
@@ -29,13 +30,11 @@ void broadcastNotificationCallback(CFNotificationCenterRef center,
29
30
  bool hasListeners;
30
31
  CFNotificationCenterRef _notificationCenter;
31
32
  }
32
- RCT_EXPORT_MODULE();
33
33
 
34
- // the viewRegistry approach is taken from https://github.com/facebook/react-native/issues/50800#issuecomment-2823327307
35
- #ifdef RCT_NEW_ARCH_ENABLED
34
+ // necessary for addUIBlock usage https://github.com/facebook/react-native/issues/50800#issuecomment-2823327307
36
35
  @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
37
- #endif // RCT_NEW_ARCH_ENABLED
38
- @synthesize bridge = _bridge;
36
+
37
+ RCT_EXPORT_MODULE();
39
38
 
40
39
  +(BOOL)requiresMainQueueSetup {
41
40
  return NO;
@@ -178,7 +177,7 @@ RCT_EXPORT_METHOD(currentThermalState:(RCTPromiseResolveBlock)resolve rejecter:(
178
177
  +(void)registerIncomingCall:(NSString *)cid uuid:(NSString *)uuid {
179
178
  [StreamVideoReactNative initializeSharedDictionaries];
180
179
  dispatch_sync(_dictionaryQueue, ^{
181
-
180
+
182
181
  #ifdef DEBUG
183
182
  NSLog(@"registerIncomingCall cid:%@ -> uuid:%@",cid,uuid);
184
183
  #endif
@@ -210,7 +209,7 @@ RCT_EXPORT_METHOD(getIncomingCallCid:(NSString *)uuid
210
209
  dispatch_sync(_dictionaryQueue, ^{
211
210
  NSString *lowercaseUUID = [uuid lowercaseString];
212
211
  NSString *foundCid = _incomingCallCidsByUUID[lowercaseUUID];
213
-
212
+
214
213
  if (foundCid) {
215
214
  resolve(foundCid);
216
215
  } else {
@@ -230,7 +229,7 @@ RCT_EXPORT_METHOD(removeIncomingCall:(NSString *)cid
230
229
  #ifdef DEBUG
231
230
  NSLog(@"removeIncomingCall cid:%@ -> uuid:%@",cid,uuid);
232
231
  #endif
233
-
232
+
234
233
  [_incomingCallUUIDsByCallID removeObjectForKey:cid];
235
234
  [_incomingCallCidsByUUID removeObjectForKey:uuid];
236
235
  resolve(@YES);
@@ -245,95 +244,92 @@ RCT_EXPORT_METHOD(captureRef:(nonnull NSNumber *)reactTag
245
244
  resolver:(RCTPromiseResolveBlock)resolve
246
245
  rejecter:(RCTPromiseRejectBlock)reject)
247
246
  {
248
- #ifdef RCT_NEW_ARCH_ENABLED
249
- [self.viewRegistry_DEPRECATED addUIBlock:^(RCTViewRegistry *viewRegistry) {
250
- UIView *view = [self.viewRegistry_DEPRECATED viewForReactTag:reactTag];
251
-
252
- #else
253
- [self.bridge.uiManager
254
- addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
255
- UIView *view = [uiManager viewForReactTag:reactTag];
256
- #endif
257
-
258
- if (!view) {
259
- reject(RCTErrorUnspecified, [NSString stringWithFormat:@"No view found with reactTag: %@", reactTag], nil);
260
- return;
261
- }
262
-
263
- // Get capture options
264
- NSString *format = options[@"format"] ? [options[@"format"] lowercaseString] : @"png";
265
- CGFloat quality = options[@"quality"] ? [options[@"quality"] floatValue] : 1.0;
266
- NSNumber *width = options[@"width"];
267
- NSNumber *height = options[@"height"];
268
-
269
- // Determine the size to render
270
- CGSize size;
271
- CGRect bounds = view.bounds;
272
- if (width && height) {
273
- size = CGSizeMake([width floatValue], [height floatValue]);
274
- } else {
275
- size = bounds.size;
276
- }
277
-
278
- // Abort if size is invalid
279
- if (size.width <= 0 || size.height <= 0) {
280
- reject(@"INVALID_SIZE", @"View has invalid size", nil);
281
- return;
282
- }
283
-
284
- // Begin image context with appropriate scale
285
- UIGraphicsBeginImageContextWithOptions(size, NO, 0);
286
-
287
- // Calculate scaling if needed
288
- CGRect drawRect = bounds;
289
- if (width && height) {
290
- CGFloat scaleX = size.width / bounds.size.width;
291
- CGFloat scaleY = size.height / bounds.size.height;
292
-
293
- // Apply transform to context for scaling if dimensions differ
294
- CGContextRef context = UIGraphicsGetCurrentContext();
295
- if (context) {
296
- CGContextTranslateCTM(context, 0, size.height);
297
- CGContextScaleCTM(context, scaleX, -scaleY);
298
- drawRect = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
247
+ // It seems that due to how UIBlocks work with uiManager, we need to call the methods in UIManagerQueue
248
+ // for the blocks to be dispatched before the batch is completed
249
+ dispatch_async(RCTGetUIManagerQueue(), ^{
250
+ [self.viewRegistry_DEPRECATED addUIBlock:^(RCTViewRegistry *viewRegistry) {
251
+ UIView *view = [viewRegistry viewForReactTag:reactTag];
252
+
253
+ if (!view) {
254
+ reject(RCTErrorUnspecified, [NSString stringWithFormat:@"No view found with reactTag: %@", reactTag], nil);
255
+ return;
299
256
  }
300
- }
301
-
302
- BOOL success = [view drawViewHierarchyInRect:drawRect afterScreenUpdates:YES];
303
-
304
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
305
- UIGraphicsEndImageContext();
306
-
307
- if (!success || !image) {
308
- reject(@"CAPTURE_FAILED", @"Failed to capture view as image", nil);
309
- return;
310
- }
311
-
312
- // Convert to base64 string based on format
313
- NSString *base64;
314
- if ([format isEqualToString:@"jpg"] || [format isEqualToString:@"jpeg"]) {
315
- NSData *imageData = UIImageJPEGRepresentation(image, quality);
316
- base64 = [imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];
317
- } else {
318
- // Default to PNG
319
- NSData *imageData = UIImagePNGRepresentation(image);
320
- base64 = [imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];
321
- }
322
-
323
- if (base64) {
324
- resolve(base64);
325
- } else {
326
- reject(@"ENCODING_FAILED", @"Failed to encode image to base64", nil);
327
- }
328
- }];
257
+
258
+ // Get capture options
259
+ NSString *format = options[@"format"] ? [options[@"format"] lowercaseString] : @"png";
260
+ CGFloat quality = options[@"quality"] ? [options[@"quality"] floatValue] : 1.0;
261
+ NSNumber *width = options[@"width"];
262
+ NSNumber *height = options[@"height"];
263
+
264
+ // Determine the size to render
265
+ CGSize size;
266
+ CGRect bounds = view.bounds;
267
+ if (width && height) {
268
+ size = CGSizeMake([width floatValue], [height floatValue]);
269
+ } else {
270
+ size = bounds.size;
271
+ }
272
+
273
+ // Abort if size is invalid
274
+ if (size.width <= 0 || size.height <= 0) {
275
+ reject(@"INVALID_SIZE", @"View has invalid size", nil);
276
+ return;
277
+ }
278
+
279
+ // Begin image context with appropriate scale
280
+ UIGraphicsBeginImageContextWithOptions(size, NO, 0);
281
+
282
+ // Calculate scaling if needed
283
+ CGRect drawRect = bounds;
284
+ if (width && height) {
285
+ CGFloat scaleX = size.width / bounds.size.width;
286
+ CGFloat scaleY = size.height / bounds.size.height;
287
+
288
+ // Apply transform to context for scaling if dimensions differ
289
+ CGContextRef context = UIGraphicsGetCurrentContext();
290
+ if (context) {
291
+ CGContextTranslateCTM(context, 0, size.height);
292
+ CGContextScaleCTM(context, scaleX, -scaleY);
293
+ drawRect = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
294
+ }
295
+ }
296
+
297
+ BOOL success = [view drawViewHierarchyInRect:drawRect afterScreenUpdates:YES];
298
+
299
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
300
+ UIGraphicsEndImageContext();
301
+
302
+ if (!success || !image) {
303
+ reject(@"CAPTURE_FAILED", @"Failed to capture view as image", nil);
304
+ return;
305
+ }
306
+
307
+ // Convert to base64 string based on format
308
+ NSString *base64;
309
+ if ([format isEqualToString:@"jpg"] || [format isEqualToString:@"jpeg"]) {
310
+ NSData *imageData = UIImageJPEGRepresentation(image, quality);
311
+ base64 = [imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];
312
+ } else {
313
+ // Default to PNG
314
+ NSData *imageData = UIImagePNGRepresentation(image);
315
+ base64 = [imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];
316
+ }
317
+
318
+ if (base64) {
319
+ resolve(base64);
320
+ } else {
321
+ reject(@"ENCODING_FAILED", @"Failed to encode image to base64", nil);
322
+ }
323
+ }];
324
+ });
329
325
  }
330
326
 
331
327
  RCT_EXPORT_METHOD(getBatteryState:(RCTPromiseResolveBlock)resolve
332
- rejecter:(RCTPromiseRejectBlock)reject) {
328
+ rejecter:(RCTPromiseRejectBlock)reject) {
333
329
  UIDeviceBatteryState batteryState = [UIDevice currentDevice].batteryState;
334
330
  BOOL isCharging = (batteryState == UIDeviceBatteryStateCharging ||
335
- batteryState == UIDeviceBatteryStateFull);
336
-
331
+ batteryState == UIDeviceBatteryStateFull);
332
+
337
333
  resolve(@{
338
334
  @"charging": @(isCharging),
339
335
  @"level": @(round([UIDevice currentDevice].batteryLevel * 100))
@@ -343,8 +339,8 @@ RCT_EXPORT_METHOD(getBatteryState:(RCTPromiseResolveBlock)resolve
343
339
  -(void)batteryStateDidChange:(NSNotification *)notification {
344
340
  UIDeviceBatteryState batteryState = [UIDevice currentDevice].batteryState;
345
341
  BOOL isCharging = (batteryState == UIDeviceBatteryStateCharging ||
346
- batteryState == UIDeviceBatteryStateFull);
347
-
342
+ batteryState == UIDeviceBatteryStateFull);
343
+
348
344
  [self sendEventWithName:@"chargingStateChanged" body:@{
349
345
  @"charging": @(isCharging),
350
346
  @"level": @(round([UIDevice currentDevice].batteryLevel * 100))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.20.14",
3
+ "version": "1.20.15",
4
4
  "description": "Stream Video SDK for React Native",
5
5
  "author": "https://getstream.io",
6
6
  "homepage": "https://getstream.io/video/docs/react-native/",
@@ -45,8 +45,8 @@
45
45
  "!**/.*"
46
46
  ],
47
47
  "dependencies": {
48
- "@stream-io/video-client": "1.30.1",
49
- "@stream-io/video-react-bindings": "1.8.2",
48
+ "@stream-io/video-client": "1.31.0",
49
+ "@stream-io/video-react-bindings": "1.8.3",
50
50
  "intl-pluralrules": "2.0.1",
51
51
  "lodash.merge": "^4.6.2",
52
52
  "react-native-url-polyfill": "1.3.0",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.20.14';
1
+ export const version = '1.20.15';