@stream-io/video-react-native-sdk 1.33.0 → 1.35.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +1 -1
  3. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
  4. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +1 -1
  5. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  6. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +2 -3
  7. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  8. package/dist/commonjs/utils/push/android.js +15 -5
  9. package/dist/commonjs/utils/push/android.js.map +1 -1
  10. package/dist/commonjs/utils/push/internal/ios.js +3 -3
  11. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  12. package/dist/commonjs/utils/push/ios.js +2 -2
  13. package/dist/commonjs/utils/push/ios.js.map +1 -1
  14. package/dist/commonjs/utils/push/libs/callingx.js +6 -3
  15. package/dist/commonjs/utils/push/libs/callingx.js.map +1 -1
  16. package/dist/commonjs/utils/push/setupCallingExpEvents.js +2 -1
  17. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -1
  18. package/dist/commonjs/version.js +1 -1
  19. package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +1 -1
  20. package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
  21. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +1 -1
  22. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  23. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +2 -3
  24. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  25. package/dist/module/utils/push/android.js +15 -5
  26. package/dist/module/utils/push/android.js.map +1 -1
  27. package/dist/module/utils/push/internal/ios.js +3 -3
  28. package/dist/module/utils/push/internal/ios.js.map +1 -1
  29. package/dist/module/utils/push/ios.js +2 -2
  30. package/dist/module/utils/push/ios.js.map +1 -1
  31. package/dist/module/utils/push/libs/callingx.js +6 -3
  32. package/dist/module/utils/push/libs/callingx.js.map +1 -1
  33. package/dist/module/utils/push/setupCallingExpEvents.js +2 -1
  34. package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -1
  35. package/dist/module/version.js +1 -1
  36. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  37. package/dist/typescript/utils/StreamVideoRN/types.d.ts +12 -7
  38. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  39. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  40. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  41. package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -1
  42. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +1 -1
  43. package/dist/typescript/version.d.ts +1 -1
  44. package/expo-config-plugin/dist/index.js +2 -0
  45. package/expo-config-plugin/dist/withCallResources/index.js +31 -0
  46. package/expo-config-plugin/dist/withCallResources/withAndroidRingtone.js +92 -0
  47. package/expo-config-plugin/dist/withCallResources/withIosCallkitIcon.js +97 -0
  48. package/expo-config-plugin/dist/withCallResources/withIosRingtone.js +81 -0
  49. package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -1
  50. package/package.json +5 -5
  51. package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +1 -1
  52. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +1 -1
  53. package/src/hooks/useAndroidKeepCallAliveEffect.ts +2 -4
  54. package/src/utils/StreamVideoRN/types.ts +12 -7
  55. package/src/utils/push/android.ts +15 -5
  56. package/src/utils/push/internal/ios.ts +4 -4
  57. package/src/utils/push/ios.ts +2 -2
  58. package/src/utils/push/libs/callingx.ts +6 -4
  59. package/src/utils/push/setupCallingExpEvents.ts +4 -1
  60. package/src/version.ts +1 -1
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.deriveImageSetName = deriveImageSetName;
37
+ const config_plugins_1 = require("@expo/config-plugins");
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ /**
41
+ * Derive an xcassets image set name from a filename.
42
+ * e.g. "callkit_icon.png" -> "CallkitIcon"
43
+ * e.g. "my-app-icon.png" -> "MyAppIcon"
44
+ */
45
+ function deriveImageSetName(fileName) {
46
+ const baseName = path.basename(fileName, path.extname(fileName));
47
+ return baseName
48
+ .split(/[^a-zA-Z0-9]+/)
49
+ .filter(Boolean)
50
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
51
+ .join('');
52
+ }
53
+ const withIosCallkitIcon = (config, props) => {
54
+ if (!props?.iosCallKitIcon) {
55
+ return config;
56
+ }
57
+ return (0, config_plugins_1.withDangerousMod)(config, [
58
+ 'ios',
59
+ (dangerousConfig) => {
60
+ const projectRoot = dangerousConfig.modRequest.projectRoot;
61
+ const sourcePath = path.resolve(projectRoot, props.iosCallKitIcon);
62
+ if (!fs.existsSync(sourcePath)) {
63
+ throw new Error(`[StreamVideo] iOS CallKit icon file not found: ${sourcePath}. ` +
64
+ `Check that the "iosCallKitIcon" path in your plugin config is correct.`);
65
+ }
66
+ const ext = path.extname(sourcePath).toLowerCase();
67
+ if (ext !== '.png') {
68
+ throw new Error(`[StreamVideo] iOS CallKit icon must be a PNG file, got "${ext}".`);
69
+ }
70
+ const imageSetName = deriveImageSetName(path.basename(sourcePath));
71
+ const appName = dangerousConfig.modRequest.projectName;
72
+ const imageSetDir = path.join(dangerousConfig.modRequest.platformProjectRoot, appName, 'Images.xcassets', `${imageSetName}.imageset`);
73
+ fs.mkdirSync(imageSetDir, { recursive: true });
74
+ const destFileName = path.basename(sourcePath);
75
+ fs.copyFileSync(sourcePath, path.join(imageSetDir, destFileName));
76
+ const contentsJson = {
77
+ images: [
78
+ {
79
+ filename: destFileName,
80
+ idiom: 'universal',
81
+ scale: '2x',
82
+ },
83
+ ],
84
+ info: {
85
+ author: 'expo',
86
+ version: 1,
87
+ },
88
+ properties: {
89
+ 'template-rendering-intent': 'template',
90
+ },
91
+ };
92
+ fs.writeFileSync(path.join(imageSetDir, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
93
+ return dangerousConfig;
94
+ },
95
+ ]);
96
+ };
97
+ exports.default = withIosCallkitIcon;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const config_plugins_1 = require("@expo/config-plugins");
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const SUPPORTED_EXTENSIONS = ['.caf', '.aiff', '.m4a', '.wav'];
40
+ const withIosRingtone = (config, props) => {
41
+ if (!props?.iosRingtone) {
42
+ return config;
43
+ }
44
+ return (0, config_plugins_1.withXcodeProject)(config, (xCodeConfig) => {
45
+ const projectRoot = xCodeConfig.modRequest.projectRoot;
46
+ const sourcePath = path.resolve(projectRoot, props.iosRingtone);
47
+ if (!fs.existsSync(sourcePath)) {
48
+ throw new Error(`[StreamVideo] iOS ringtone file not found: ${sourcePath}. ` +
49
+ `Check that the "iosRingtone" path in your plugin config is correct.`);
50
+ }
51
+ const ext = path.extname(sourcePath).toLowerCase();
52
+ if (!SUPPORTED_EXTENSIONS.includes(ext)) {
53
+ throw new Error(`[StreamVideo] Invalid iOS ringtone format "${ext}". ` +
54
+ `Supported formats: ${SUPPORTED_EXTENSIONS.join(', ')}`);
55
+ }
56
+ const fileName = path.basename(sourcePath);
57
+ const appName = xCodeConfig.modRequest.projectName;
58
+ const destDir = path.join(xCodeConfig.modRequest.platformProjectRoot, appName);
59
+ const destPath = path.join(destDir, fileName);
60
+ // Path relative to the ios/ directory — Xcode needs this to locate the file
61
+ const projectFilePath = path.join(appName, fileName);
62
+ fs.mkdirSync(destDir, { recursive: true });
63
+ fs.copyFileSync(sourcePath, destPath);
64
+ const proj = xCodeConfig.modResults;
65
+ if (!proj.hasFile(fileName)) {
66
+ // Find the main app group by name (Expo projects don't have a "Resources" group,
67
+ // so we can't use addResourceFile which crashes on correctForResourcesPath)
68
+ const appGroupKey = proj.findPBXGroupKey({ name: appName });
69
+ const file = proj.addFile(projectFilePath, appGroupKey, {
70
+ target: proj.getFirstTarget().uuid,
71
+ });
72
+ if (file) {
73
+ file.uuid = proj.generateUuid();
74
+ proj.addToPbxBuildFileSection(file);
75
+ proj.addToPbxResourcesBuildPhase(file);
76
+ }
77
+ }
78
+ return xCodeConfig;
79
+ });
80
+ };
81
+ exports.default = withIosRingtone;
@@ -12,8 +12,10 @@ const withStreamVideoReactNativeSDKiOSInfoPList = (configuration, props) => {
12
12
  }
13
13
  }
14
14
  addBackgroundMode('audio');
15
- if (props?.ringing) {
15
+ if (props?.ringing || props?.iosKeepCallAlive) {
16
16
  addBackgroundMode('voip');
17
+ }
18
+ if (props?.ringing) {
17
19
  addBackgroundMode('fetch');
18
20
  addBackgroundMode('processing');
19
21
  config.modResults['BGTaskSchedulerPermittedIdentifiers'] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.33.0",
3
+ "version": "1.35.0",
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/",
@@ -50,8 +50,8 @@
50
50
  "!**/.*"
51
51
  ],
52
52
  "dependencies": {
53
- "@stream-io/video-client": "1.48.0",
54
- "@stream-io/video-react-bindings": "1.15.0",
53
+ "@stream-io/video-client": "1.50.0",
54
+ "@stream-io/video-react-bindings": "1.16.0",
55
55
  "intl-pluralrules": "2.0.1",
56
56
  "react-native-url-polyfill": "^3.0.0",
57
57
  "rxjs": "~7.8.2",
@@ -126,9 +126,9 @@
126
126
  "@react-native-firebase/messaging": "^23.4.0",
127
127
  "@react-native/babel-preset": "^0.81.5",
128
128
  "@stream-io/noise-cancellation-react-native": "^0.7.0",
129
- "@stream-io/react-native-callingx": "^0.1.1",
129
+ "@stream-io/react-native-callingx": "^0.2.0",
130
130
  "@stream-io/react-native-webrtc": "137.2.0",
131
- "@stream-io/video-filters-react-native": "^0.12.1",
131
+ "@stream-io/video-filters-react-native": "^0.12.2",
132
132
  "@testing-library/jest-native": "^5.4.3",
133
133
  "@testing-library/react-native": "13.3.3",
134
134
  "@tsconfig/node18": "^18.2.4",
@@ -63,7 +63,7 @@ const TrackSubscriber = forwardRef<TrackSubscriberHandle, TrackSubscriberProps>(
63
63
  call.state.updateParticipantTracks(trackType, {
64
64
  [participantSessionId]: { dimension },
65
65
  });
66
- call.dynascaleManager.applyTrackSubscriptions(debounceType);
66
+ call.trackSubscriptionManager.apply(debounceType);
67
67
  };
68
68
  const isPublishingTrack$ = call.state.participants$.pipe(
69
69
  map((ps) => ps.find((p) => p.sessionId === participantSessionId)),
@@ -88,7 +88,7 @@ export const useIosVoipPushEventsSetupEffect = () => {
88
88
 
89
89
  useEffect(() => {
90
90
  const pushConfig = StreamVideoRN.getConfig().push;
91
- const pushProviderName = pushConfig?.ios.pushProviderName;
91
+ const pushProviderName = pushConfig?.ios?.pushProviderName;
92
92
  const callingx = getCallingxLibIfAvailable();
93
93
 
94
94
  if (Platform.OS !== 'ios' || !client || !pushProviderName || !callingx) {
@@ -53,7 +53,7 @@ async function startForegroundService(call_cid: string) {
53
53
  const foregroundServiceConfig = videoConfig.foregroundService;
54
54
  const notificationTexts = foregroundServiceConfig.android.notificationTexts;
55
55
  const channel = foregroundServiceConfig.android.channel;
56
- const smallIconName = videoConfig.push?.android.smallIcon;
56
+ const smallIconName = videoConfig.push?.android?.smallIcon;
57
57
 
58
58
  // NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
59
59
  // this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
@@ -89,13 +89,11 @@ export const useAndroidKeepCallAliveEffect = () => {
89
89
  const { useCallCallingState } = useCallStateHooks();
90
90
  const callingState = useCallCallingState();
91
91
 
92
- const isOutgoingCall =
93
- callingState === CallingState.RINGING && call?.isCreatedByMe;
94
92
  const isCallJoined = callingState === CallingState.JOINED;
95
93
  const isRingingCall = call?.ringing;
96
94
 
97
95
  const shouldStartForegroundService =
98
- !foregroundServiceStartedRef.current && (isOutgoingCall || isCallJoined);
96
+ !foregroundServiceStartedRef.current && isCallJoined;
99
97
 
100
98
  useEffect((): (() => void) | undefined => {
101
99
  if (Platform.OS === 'ios' || !activeCallCid) {
@@ -37,7 +37,7 @@ export type StreamVideoConfig = {
37
37
  */
38
38
  publishOptions?: ClientPublishOptions;
39
39
 
40
- ios: {
40
+ ios?: {
41
41
  /**
42
42
  * The name for the alias of push provider used for iOS
43
43
  * Pass undefined if you will not be using stream's push notifications but still want to use the functionality of the SDK
@@ -65,8 +65,13 @@ export type StreamVideoConfig = {
65
65
  * @default 60000 (1 minute)
66
66
  */
67
67
  displayCallTimeout?: number;
68
+ /**
69
+ * Whether to enable ongoing calls.
70
+ * @default false
71
+ */
72
+ enableOngoingCalls?: boolean;
68
73
  };
69
- android: {
74
+ android?: {
70
75
  /**
71
76
  * The small icon to be used for push notifications for Android
72
77
  * Reference the name created (Optional, defaults to 'ic_launcher')
@@ -145,12 +150,12 @@ export type StreamVideoConfig = {
145
150
  ) => string;
146
151
  getBody: (type: NonRingingPushEvent, createdUserName: string) => string;
147
152
  };
153
+ /**
154
+ * Whether to enable ongoing calls.
155
+ * @default false
156
+ */
157
+ enableOngoingCalls?: boolean;
148
158
  };
149
- /**
150
- * Whether to enable ongoing calls.
151
- * @default false
152
- */
153
- enableOngoingCalls?: boolean;
154
159
  /**
155
160
  * Whether to reject calls when the user is busy.
156
161
  * @default false
@@ -40,7 +40,7 @@ export async function initAndroidPushToken(
40
40
  pushConfig: PushConfig,
41
41
  setUnsubscribeListener: (unsubscribe: () => void) => void,
42
42
  ) {
43
- if (Platform.OS !== 'android' || !pushConfig.android.pushProviderName) {
43
+ if (Platform.OS !== 'android' || !pushConfig.android?.pushProviderName) {
44
44
  return;
45
45
  }
46
46
  const logger = videoLoggerSystem.getLogger('initAndroidPushToken');
@@ -69,7 +69,7 @@ export async function initAndroidPushToken(
69
69
  logger.warn('Failed to remove firebase token from stream', err);
70
70
  }
71
71
  });
72
- const push_provider_name = pushConfig.android.pushProviderName;
72
+ const push_provider_name = pushConfig.android?.pushProviderName;
73
73
  logger.debug(`sending firebase token: ${token} for userId: ${userId}`);
74
74
  await client.addDevice(token, 'firebase', push_provider_name);
75
75
  };
@@ -193,6 +193,11 @@ export const firebaseDataHandler = async (
193
193
  'debug',
194
194
  );
195
195
  callingx.endCallWithReason(call_cid, endCallReason);
196
+ callFromPush.leave({ reject: false }).catch((error) => {
197
+ logger.error(
198
+ `Failed to leave already-ended ringing call ${call_cid}: ${error}`,
199
+ );
200
+ });
196
201
  resolve(undefined);
197
202
  return;
198
203
  }
@@ -323,6 +328,11 @@ export const firebaseDataHandler = async (
323
328
  `Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`,
324
329
  );
325
330
  callingx.endCallWithReason(call_cid, endCallReason);
331
+ callFromPush.leave({ reject: false }).catch((error) => {
332
+ logger.error(
333
+ `Failed to leave already-ended ringing call ${call_cid}: ${error}`,
334
+ );
335
+ });
326
336
  }
327
337
  } else {
328
338
  const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
@@ -336,9 +346,9 @@ export const firebaseDataHandler = async (
336
346
  }
337
347
 
338
348
  // the other types are call.live_started and call.notification
339
- const callChannel = pushConfig.android.callChannel;
349
+ const callChannel = pushConfig.android?.callChannel;
340
350
  const callNotificationTextGetters =
341
- pushConfig.android.callNotificationTextGetters;
351
+ pushConfig.android?.callNotificationTextGetters;
342
352
  if (!callChannel || !callNotificationTextGetters) {
343
353
  logger.debug(
344
354
  "Can't show call notification as either or both callChannel and callNotificationTextGetters is not provided",
@@ -364,7 +374,7 @@ export const firebaseDataHandler = async (
364
374
  data,
365
375
  android: {
366
376
  sound: callChannel.sound,
367
- smallIcon: pushConfig.android.smallIcon,
377
+ smallIcon: pushConfig.android?.smallIcon,
368
378
  vibrationPattern: callChannel.vibrationPattern,
369
379
  channelId,
370
380
  importance: 4, // high importance
@@ -1,9 +1,9 @@
1
+ import { videoLoggerSystem } from '@stream-io/video-client';
1
2
  import { Platform } from 'react-native';
2
- import { pushUnsubscriptionCallbacks } from './constants';
3
- import { canListenToWS, shouldCallBeClosed } from './utils';
4
3
  import { StreamVideoConfig } from '../../StreamVideoRN/types';
5
- import { videoLoggerSystem } from '@stream-io/video-client';
6
4
  import { getCallingxLib } from '../libs/callingx';
5
+ import { pushUnsubscriptionCallbacks } from './constants';
6
+ import { canListenToWS, shouldCallBeClosed } from './utils';
7
7
 
8
8
  export const onVoipNotificationReceived = async (
9
9
  notification: any,
@@ -43,7 +43,7 @@ export const onVoipNotificationReceived = async (
43
43
  }
44
44
 
45
45
  const call_cid = notification?.stream?.call_cid;
46
- if (!call_cid || Platform.OS !== 'ios' || !pushConfig.ios.pushProviderName) {
46
+ if (!call_cid || Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
47
47
  return;
48
48
  }
49
49
 
@@ -127,7 +127,7 @@ export async function initIosNonVoipToken(
127
127
  ) {
128
128
  if (
129
129
  Platform.OS !== 'ios' ||
130
- !pushConfig.ios.pushProviderName ||
130
+ !pushConfig.ios?.pushProviderName ||
131
131
  !pushConfig.onTapNonRingingCallNotification
132
132
  ) {
133
133
  return;
@@ -155,7 +155,7 @@ export async function initIosNonVoipToken(
155
155
  );
156
156
  }
157
157
  });
158
- const push_provider_name = pushConfig.ios.pushProviderName;
158
+ const push_provider_name = pushConfig.ios?.pushProviderName;
159
159
  logger.debug('Add device token to stream', token);
160
160
  await client
161
161
  .addDevice(token, 'apn', push_provider_name)
@@ -49,6 +49,9 @@ export function extractCallingExpOptions(
49
49
  if (pushConfig.ios.displayCallTimeout !== undefined) {
50
50
  iosOptions.displayCallTimeout = pushConfig.ios.displayCallTimeout;
51
51
  }
52
+ if (pushConfig.ios.enableOngoingCalls !== undefined) {
53
+ iosOptions.enableOngoingCalls = pushConfig.ios.enableOngoingCalls;
54
+ }
52
55
 
53
56
  if (Object.keys(iosOptions).length > 0) {
54
57
  callingExpOptions.ios = iosOptions;
@@ -66,6 +69,9 @@ export function extractCallingExpOptions(
66
69
  if (pushConfig.android.notificationTexts) {
67
70
  androidOptions.notificationTexts = pushConfig.android.notificationTexts;
68
71
  }
72
+ if (pushConfig.android.enableOngoingCalls !== undefined) {
73
+ androidOptions.enableOngoingCalls = pushConfig.android.enableOngoingCalls;
74
+ }
69
75
  }
70
76
 
71
77
  if (foregroundServiceConfig.android.channel) {
@@ -81,9 +87,5 @@ export function extractCallingExpOptions(
81
87
  pushConfig.shouldRejectCallWhenBusy;
82
88
  }
83
89
 
84
- if (pushConfig?.enableOngoingCalls !== undefined) {
85
- callingExpOptions.enableOngoingCalls = pushConfig?.enableOngoingCalls;
86
- }
87
-
88
90
  return callingExpOptions;
89
91
  }
@@ -23,8 +23,11 @@ export function setupCallingExpEvents(pushConfig: NonNullable<PushConfig>) {
23
23
  const hasPushProvider =
24
24
  (Platform.OS === 'android' && pushConfig.android?.pushProviderName) ||
25
25
  (Platform.OS === 'ios' && pushConfig.ios?.pushProviderName);
26
+ const hasOngoingCalls =
27
+ (Platform.OS === 'android' && pushConfig.android?.enableOngoingCalls) ||
28
+ (Platform.OS === 'ios' && pushConfig.ios?.enableOngoingCalls);
26
29
 
27
- if (!hasPushProvider) {
30
+ if (!hasPushProvider && !hasOngoingCalls) {
28
31
  return;
29
32
  }
30
33
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.33.0';
1
+ export const version = '1.35.0';