From 9fc10e2bf61ba8543aa459b565bc4fdbd6d6d97e Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 4 Dec 2024 14:10:48 +0100 Subject: [PATCH 01/15] fix: permission prompt should not be called in RN --- packages/client/src/devices/BrowserPermission.ts | 6 +++++- packages/client/src/devices/devices.ts | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/client/src/devices/BrowserPermission.ts b/packages/client/src/devices/BrowserPermission.ts index ce4a299970..26ae891ca4 100644 --- a/packages/client/src/devices/BrowserPermission.ts +++ b/packages/client/src/devices/BrowserPermission.ts @@ -91,7 +91,11 @@ export class BrowserPermission { this.setState('granted'); return true; } catch (e) { - if (e instanceof DOMException && e.name === 'NotAllowedError') { + if ( + global.DOMException && + e instanceof DOMException && + e.name === 'NotAllowedError' + ) { this.logger('info', 'Browser permission was not granted', { permission: this.permission, }); diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 25184c2c6c..576b4ae0fa 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -9,7 +9,7 @@ import { startWith, } from 'rxjs'; import { getLogger } from '../logger'; -import { BrowserPermission } from './BrowserPermission'; +import { BrowserPermission, canQueryPermissions } from './BrowserPermission'; import { lazy } from '../helpers/lazy'; import { isFirefox } from '../helpers/browsers'; @@ -191,11 +191,12 @@ export const getAudioStream = async ( try { await getAudioBrowserPermission().prompt({ throwOnNotAllowed: true, - forcePrompt: true, + forcePrompt: canQueryPermissions(), }); return await getStream(constraints); } catch (error) { if ( + global.DOMException && error instanceof DOMException && error.name === 'OverconstrainedError' && trackConstraints?.deviceId @@ -237,7 +238,7 @@ export const getVideoStream = async ( try { await getVideoBrowserPermission().prompt({ throwOnNotAllowed: true, - forcePrompt: true, + forcePrompt: canQueryPermissions(), }); return await getStream(constraints); } catch (error) { From 1fe1081ed627e9d3895afeb1222c6a8b64c9b9be Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 4 Dec 2024 14:14:51 +0100 Subject: [PATCH 02/15] export function --- packages/client/src/devices/BrowserPermission.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/devices/BrowserPermission.ts b/packages/client/src/devices/BrowserPermission.ts index 26ae891ca4..4d49170eba 100644 --- a/packages/client/src/devices/BrowserPermission.ts +++ b/packages/client/src/devices/BrowserPermission.ts @@ -145,7 +145,7 @@ export class BrowserPermission { } } -function canQueryPermissions() { +export function canQueryPermissions() { return ( !isReactNative() && typeof navigator !== 'undefined' && From 72331e3c21c177430868765f1b12bef7749b5be6 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 4 Dec 2024 15:06:29 +0100 Subject: [PATCH 03/15] remove DOMException --- .../client/src/devices/BrowserPermission.ts | 21 ++++++++++------ packages/client/src/devices/devices.ts | 24 +++++++++++-------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/client/src/devices/BrowserPermission.ts b/packages/client/src/devices/BrowserPermission.ts index 4d49170eba..0b0f550a9a 100644 --- a/packages/client/src/devices/BrowserPermission.ts +++ b/packages/client/src/devices/BrowserPermission.ts @@ -73,10 +73,16 @@ export class BrowserPermission { const isGranted = this.state === 'granted'; if (!isGranted && throwOnNotAllowed) { - throw new DOMException( - 'Permission was not granted previously, and prompting again is not allowed', - 'NotAllowedError', - ); + if (typeof DOMException !== 'undefined') { + throw new DOMException( + 'Permission was not granted previously, and prompting again is not allowed', + 'NotAllowedError', + ); + } else { + throw new Error( + 'Permission was not granted previously, and prompting again is not allowed', + ); + } } return isGranted; @@ -92,9 +98,10 @@ export class BrowserPermission { return true; } catch (e) { if ( - global.DOMException && - e instanceof DOMException && - e.name === 'NotAllowedError' + e && + typeof e === 'object' && + 'name' in e && + (e.name === 'NotAllowedError' || e.name === 'SecurityError') ) { this.logger('info', 'Browser permission was not granted', { permission: this.permission, diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 576b4ae0fa..c2195675c2 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -12,6 +12,7 @@ import { getLogger } from '../logger'; import { BrowserPermission, canQueryPermissions } from './BrowserPermission'; import { lazy } from '../helpers/lazy'; import { isFirefox } from '../helpers/browsers'; +import { isReactNative } from '../helpers/platforms'; /** * Returns an Observable that emits the list of available devices @@ -196,18 +197,19 @@ export const getAudioStream = async ( return await getStream(constraints); } catch (error) { if ( - global.DOMException && - error instanceof DOMException && + error && + typeof error === 'object' && + 'name' in error && error.name === 'OverconstrainedError' && trackConstraints?.deviceId ) { - const { deviceId, ...relaxedContraints } = trackConstraints; + const { deviceId, ...relaxedConstraints } = trackConstraints; getLogger(['devices'])( 'warn', 'Failed to get audio stream, will try again with relaxed contraints', - { error, constraints, relaxedContraints }, + { error, constraints, relaxedConstraints }, ); - return getAudioStream(relaxedContraints); + return getAudioStream(relaxedConstraints); } getLogger(['devices'])('error', 'Failed to get audio stream', { @@ -243,17 +245,19 @@ export const getVideoStream = async ( return await getStream(constraints); } catch (error) { if ( - error instanceof DOMException && + error && + typeof error === 'object' && + 'name' in error && error.name === 'OverconstrainedError' && trackConstraints?.deviceId ) { - const { deviceId, ...relaxedContraints } = trackConstraints; + const { deviceId, ...relaxedConstraints } = trackConstraints; getLogger(['devices'])( 'warn', - 'Failed to get video stream, will try again with relaxed contraints', - { error, constraints, relaxedContraints }, + 'Failed to get video stream, will try again with relaxed constraints', + { error, constraints, relaxedConstraints }, ); - return getVideoStream(relaxedContraints); + return getVideoStream(relaxedConstraints); } getLogger(['devices'])('error', 'Failed to get video stream', { From b5efb3e2860e2e27b73d8cf17c8fa020f95f7817 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 4 Dec 2024 15:09:06 +0100 Subject: [PATCH 04/15] fix lint --- packages/client/src/devices/devices.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index c2195675c2..297261000d 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -12,7 +12,6 @@ import { getLogger } from '../logger'; import { BrowserPermission, canQueryPermissions } from './BrowserPermission'; import { lazy } from '../helpers/lazy'; import { isFirefox } from '../helpers/browsers'; -import { isReactNative } from '../helpers/platforms'; /** * Returns an Observable that emits the list of available devices From a0d1552d8958cf66aec1456a9a7ed1c8166bf03c Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 4 Dec 2024 15:35:10 +0100 Subject: [PATCH 05/15] add isOverconstrainedError function --- packages/client/src/devices/devices.ts | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 297261000d..2ab9c8f3a1 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -195,17 +195,11 @@ export const getAudioStream = async ( }); return await getStream(constraints); } catch (error) { - if ( - error && - typeof error === 'object' && - 'name' in error && - error.name === 'OverconstrainedError' && - trackConstraints?.deviceId - ) { + if (isOverconstrainedError(error) && trackConstraints?.deviceId) { const { deviceId, ...relaxedConstraints } = trackConstraints; getLogger(['devices'])( 'warn', - 'Failed to get audio stream, will try again with relaxed contraints', + 'Failed to get audio stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints }, ); return getAudioStream(relaxedConstraints); @@ -243,13 +237,7 @@ export const getVideoStream = async ( }); return await getStream(constraints); } catch (error) { - if ( - error && - typeof error === 'object' && - 'name' in error && - error.name === 'OverconstrainedError' && - trackConstraints?.deviceId - ) { + if (isOverconstrainedError(error) && trackConstraints?.deviceId) { const { deviceId, ...relaxedConstraints } = trackConstraints; getLogger(['devices'])( 'warn', @@ -301,6 +289,17 @@ export const getScreenShareStream = async ( } }; +function isOverconstrainedError(error: unknown) { + return ( + error && + typeof error === 'object' && + (('name' in error && error.name === 'OverconstrainedError') || + ('message' in error && + typeof error.message === 'string' && + error.message.startsWith('OverconstrainedError'))) + ); +} + export const deviceIds$ = typeof navigator !== 'undefined' && typeof navigator.mediaDevices !== 'undefined' From a3dc7704edce918b082cc0cd1752b1c9fa68be00 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 5 Dec 2024 10:22:00 +0100 Subject: [PATCH 06/15] fix bugs in overconstrained error --- .../src/devices/InputMediaDeviceManager.ts | 13 +++++---- packages/client/src/devices/devices.ts | 28 +++++++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/client/src/devices/InputMediaDeviceManager.ts b/packages/client/src/devices/InputMediaDeviceManager.ts index ad31d160e9..881e52383b 100644 --- a/packages/client/src/devices/InputMediaDeviceManager.ts +++ b/packages/client/src/devices/InputMediaDeviceManager.ts @@ -9,6 +9,7 @@ import { getLogger } from '../logger'; import { TrackType } from '../gen/video/sfu/models/models'; import { deviceIds$ } from './devices'; import { + hasPending, settled, withCancellation, withoutConcurrency, @@ -129,11 +130,13 @@ export abstract class InputMediaDeviceManager< * If status was previously enabled, it will re-enable the device. */ async resume() { - if ( - this.state.prevStatus === 'enabled' && - this.state.status !== 'enabled' - ) { - await this.enable(); + if (!hasPending(this.statusChangeConcurrencyTag)) { + if ( + this.state.prevStatus === 'enabled' && + this.state.status !== 'enabled' + ) { + await this.enable(); + } } } diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 2ab9c8f3a1..d239e4936a 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -9,7 +9,7 @@ import { startWith, } from 'rxjs'; import { getLogger } from '../logger'; -import { BrowserPermission, canQueryPermissions } from './BrowserPermission'; +import { BrowserPermission } from './BrowserPermission'; import { lazy } from '../helpers/lazy'; import { isFirefox } from '../helpers/browsers'; @@ -170,6 +170,17 @@ const getStream = async (constraints: MediaStreamConstraints) => { return stream; }; +function isOverconstrainedError(error: unknown) { + return ( + error && + typeof error === 'object' && + (('name' in error && error.name === 'OverconstrainedError') || + ('message' in error && + typeof error.message === 'string' && + error.message.startsWith('OverconstrainedError'))) + ); +} + /** * Returns an audio media stream that fulfills the given constraints. * If no constraints are provided, it uses the browser's default ones. @@ -191,7 +202,7 @@ export const getAudioStream = async ( try { await getAudioBrowserPermission().prompt({ throwOnNotAllowed: true, - forcePrompt: canQueryPermissions(), + forcePrompt: true, }); return await getStream(constraints); } catch (error) { @@ -233,7 +244,7 @@ export const getVideoStream = async ( try { await getVideoBrowserPermission().prompt({ throwOnNotAllowed: true, - forcePrompt: canQueryPermissions(), + forcePrompt: true, }); return await getStream(constraints); } catch (error) { @@ -289,17 +300,6 @@ export const getScreenShareStream = async ( } }; -function isOverconstrainedError(error: unknown) { - return ( - error && - typeof error === 'object' && - (('name' in error && error.name === 'OverconstrainedError') || - ('message' in error && - typeof error.message === 'string' && - error.message.startsWith('OverconstrainedError'))) - ); -} - export const deviceIds$ = typeof navigator !== 'undefined' && typeof navigator.mediaDevices !== 'undefined' From 760d5c65cea33a624a1b91c16595d92cd34bc17a Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Fri, 6 Dec 2024 22:07:06 +0100 Subject: [PATCH 07/15] avoid call.get in call.ring event --- packages/client/src/Call.ts | 25 ++++++++++++++++ packages/client/src/StreamVideoClient.ts | 36 +++++++++++------------- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/packages/client/src/Call.ts b/packages/client/src/Call.ts index 8d22dcdb9c..18595a5aca 100644 --- a/packages/client/src/Call.ts +++ b/packages/client/src/Call.ts @@ -26,6 +26,7 @@ import type { AcceptCallResponse, BlockUserRequest, BlockUserResponse, + CallRingEvent, CollectUserFeedbackRequest, CollectUserFeedbackResponse, Credentials, @@ -595,6 +596,30 @@ export class Call { return this.state.createdBy?.id === this.currentUserId; } + /** + * Update from the call response from the "call.ring" event + * @internal + */ + updateFromRingingEvent = async (event: CallRingEvent) => { + await this.setup(); + // call.ring event excludes the call creator in the members list + // as the creator does not get the ring event + // so update the member list accordingly + const creator = this.state.members.find( + (m) => m.user.id === event.call.created_by.id, + ); + if (!creator) { + this.state.setMembers(event.members); + } else { + this.state.setMembers([creator, ...event.members]); + } + // update the call state with the latest event data + this.state.updateFromCallResponse(event.call); + this.ringingSubject.next(true); + this.watching = true; + await this.applyDeviceConfig(false); + }; + /** * Loads the information about the call. * diff --git a/packages/client/src/StreamVideoClient.ts b/packages/client/src/StreamVideoClient.ts index 354fc1e85d..6eb29840f5 100644 --- a/packages/client/src/StreamVideoClient.ts +++ b/packages/client/src/StreamVideoClient.ts @@ -263,7 +263,6 @@ export class StreamVideoClient { ); return; } - this.logger('info', `New call created and registered: ${call.cid}`); const newCall = new Call({ streamClient: this.streamClient, @@ -287,25 +286,24 @@ export class StreamVideoClient { ); return; } - - // The call might already be tracked by the client, // if `call.created` was received before `call.ring`. - // In that case, we cleanup the already tracked call. - const prevCall = this.writeableStateStore.findCall(call.type, call.id); - await prevCall?.leave({ reason: 'cleaning-up in call.ring' }); - // we create a new call - const theCall = new Call({ - streamClient: this.streamClient, - type: call.type, - id: call.id, - members, - clientStore: this.writeableStateStore, - ringing: true, - }); - theCall.state.updateFromCallResponse(call); - // we fetch the latest metadata for the call from the server - await theCall.get(); - this.writeableStateStore.registerCall(theCall); + // the client already has the call instance and we just need to update the state + const theCall = this.writeableStateStore.findCall(call.type, call.id); + if (theCall) { + await theCall.updateFromRingingEvent(event); + } else { + // if client doesn't have the call instance, create the instance and fetch the latest state + // Note: related - we also have onRingingCall method to handle this case from push notifications + const newCallInstance = new Call({ + streamClient: this.streamClient, + type: call.type, + id: call.id, + members, + clientStore: this.writeableStateStore, + ringing: true, + }); + await newCallInstance.get(); + } }), ); From 2a05342cb96c058c4b22d677ad07f237e6fd8cf7 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 12 Dec 2024 15:36:26 +0100 Subject: [PATCH 08/15] fix: multiple ringing issues --- .../CallControls/IncomingCallControls.tsx | 2 - .../Call/RingingCallContent/IncomingCall.tsx | 3 - .../src/utils/push/android.ts | 3 + .../dogfood/android/app/google-services.json | 274 ++++++++++++--- .../dogfood/ios/GoogleService-Info.plist | 2 +- .../project.pbxproj | 2 +- .../Info.plist | 2 +- .../GoogleService-Info.plist | 16 +- .../expo-video-sample/google-services.json | 314 +++++++++++++++--- 9 files changed, 529 insertions(+), 89 deletions(-) diff --git a/packages/react-native-sdk/src/components/Call/CallControls/IncomingCallControls.tsx b/packages/react-native-sdk/src/components/Call/CallControls/IncomingCallControls.tsx index 485a3371b2..cd1a34b9d0 100644 --- a/packages/react-native-sdk/src/components/Call/CallControls/IncomingCallControls.tsx +++ b/packages/react-native-sdk/src/components/Call/CallControls/IncomingCallControls.tsx @@ -3,7 +3,6 @@ import { StyleSheet, View } from 'react-native'; import { useTheme } from '../../../contexts'; import { AcceptCallButton } from './AcceptCallButton'; import { RejectCallButton } from './RejectCallButton'; -import { ToggleVideoPreviewButton } from './ToggleVideoPreviewButton'; /** * Props for the IncomingCallControls Component. @@ -36,7 +35,6 @@ export const IncomingCallControls = ({ size={buttonSizes.md} rejectReason="decline" /> - ); diff --git a/packages/react-native-sdk/src/components/Call/RingingCallContent/IncomingCall.tsx b/packages/react-native-sdk/src/components/Call/RingingCallContent/IncomingCall.tsx index b97fbc61e6..bb00c01c82 100644 --- a/packages/react-native-sdk/src/components/Call/RingingCallContent/IncomingCall.tsx +++ b/packages/react-native-sdk/src/components/Call/RingingCallContent/IncomingCall.tsx @@ -17,7 +17,6 @@ import { IncomingCallControlsProps, } from '../CallControls'; import { useTheme } from '../../../contexts'; -import { useApplyDefaultMediaStreamSettings } from '../../../hooks/useApplyDefaultMediaStreamSettings'; /** * Props for the IncomingCall Component. @@ -49,8 +48,6 @@ export const IncomingCall = ({ theme: { colors, incomingCall, typefaces }, } = useTheme(); - useApplyDefaultMediaStreamSettings(); - const landscapeContentStyles: ViewStyle = { flexDirection: landscape ? 'row' : 'column', }; diff --git a/packages/react-native-sdk/src/utils/push/android.ts b/packages/react-native-sdk/src/utils/push/android.ts index db5ec27277..14976a6de8 100644 --- a/packages/react-native-sdk/src/utils/push/android.ts +++ b/packages/react-native-sdk/src/utils/push/android.ts @@ -229,8 +229,10 @@ export const firebaseDataHandler = async ( data, android: { channelId, + importance: 4, // high importance foregroundServiceTypes: getIncomingCallForegroundServiceTypes(), asForegroundService, + ongoing: true, sound: incomingCallChannel.sound, vibrationPattern: incomingCallChannel.vibrationPattern, pressAction: { @@ -305,6 +307,7 @@ export const firebaseDataHandler = async ( sound: callChannel.sound, vibrationPattern: callChannel.vibrationPattern, channelId, + importance: 4, // high importance pressAction: { id: 'default', launchActivity: 'default', // open the app when the notification is pressed diff --git a/sample-apps/react-native/dogfood/android/app/google-services.json b/sample-apps/react-native/dogfood/android/app/google-services.json index 18a59dab82..4e814d9742 100644 --- a/sample-apps/react-native/dogfood/android/app/google-services.json +++ b/sample-apps/react-native/dogfood/android/app/google-services.json @@ -1,40 +1,40 @@ { "project_info": { - "project_number": "296557120037", - "project_id": "react-native-samples-8f4f4", - "storage_bucket": "react-native-samples-8f4f4.appspot.com" + "project_number": "347024607410", + "project_id": "stream-video-9b586", + "storage_bucket": "stream-video-9b586.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:7e1a3d37d1ea4575f60dcc", + "mobilesdk_app_id": "1:347024607410:android:cb73830768e81a818c21ab", "android_client_info": { - "package_name": "io.getstream.expovideosample" + "package_name": "com.example.chattutorial" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -43,34 +43,34 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:a96d3423171fce2af60dcc", + "mobilesdk_app_id": "1:347024607410:android:fc2f5712a8e803828c21ab", "android_client_info": { - "package_name": "io.getstream.reactnative.imessageclone" + "package_name": "io.getstream.android.samples.ringingcall" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -79,34 +79,50 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:13ccb281a7750765f60dcc", + "mobilesdk_app_id": "1:347024607410:android:df319f46f747d6e28c21ab", "android_client_info": { - "package_name": "io.getstream.reactnative.slackclone" + "package_name": "io.getstream.rnvideosample" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-7dn7m72al5hb9e61lhi72fdqst6246hl.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.rnvideosample", + "certificate_hash": "f6d823e43cb46c2543b37f5dd65144365d94de68" + } + }, + { + "client_id": "347024607410-edfh4po3fuu37d1ft7vbakkkkd7er62i.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.rnvideosample", + "certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -115,34 +131,42 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:c200ee23e884e68ef60dcc", + "mobilesdk_app_id": "1:347024607410:android:48f2a146c871fa308c21ab", "android_client_info": { - "package_name": "io.getstream.reactnative.whatsappclone" + "package_name": "io.getstream.video.android" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-93sogn1k3o4c5h4e2kjnmue3rh6kn012.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android", + "certificate_hash": "0df0d0349c0eb717eea90c0b41fc00ab1ab04e16" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -151,34 +175,206 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:b5d44592a3a4b44af60dcc", + "mobilesdk_app_id": "1:347024607410:android:9708d415a58f054c8c21ab", "android_client_info": { - "package_name": "io.getstream.rnvideosample" + "package_name": "io.getstream.video.android.debug" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-s9g6iv2kabron4pc8vpgmr0tupj7icv9.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.debug", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:af4ba3e6161705318c21ab", + "android_client_info": { + "package_name": "io.getstream.video.android.dogfooding" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-1mvrtdruipge7vf7tvm3tt2ef23d75a6.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding", + "certificate_hash": "fe9176d4a93cd07404632ffb44fc18488bce879c" + } + }, + { + "client_id": "347024607410-50k1bcpk5chud1g1ooek43kpq85buvtc.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding", + "certificate_hash": "21b0959c583df5e95fb65a8cd50a672dfe66812b" + } + }, + { + "client_id": "347024607410-elv7783tde1kf323h7cdu6ks4ec6gcbm.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:7a79e79c9902e02c8c21ab", + "android_client_info": { + "package_name": "io.getstream.video.android.dogfooding.debug" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-3j7502bmnqo753sgkcjiuo88m1gj0s6j.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding.debug", + "certificate_hash": "21b0959c583df5e95fb65a8cd50a672dfe66812b" + } + }, + { + "client_id": "347024607410-c4f79jvma8jgo82b3na1kdv7c3a7n0qu.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding.debug", + "certificate_hash": "fe9176d4a93cd07404632ffb44fc18488bce879c" + } + }, + { + "client_id": "347024607410-jvtqudi4h0lravau0r15g8eocoe843f6.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding.debug", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:d51590d07b9f9f3c8c21ab", + "android_client_info": { + "package_name": "io.getstream.video.flutter.dogfooding" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-hhlm0gl8o72rg7g7uo26plbd6442risg.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.flutter.dogfooding", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -187,4 +383,4 @@ } ], "configuration_version": "1" -} +} \ No newline at end of file diff --git a/sample-apps/react-native/dogfood/ios/GoogleService-Info.plist b/sample-apps/react-native/dogfood/ios/GoogleService-Info.plist index d95ba2d6ca..abf165f156 100644 --- a/sample-apps/react-native/dogfood/ios/GoogleService-Info.plist +++ b/sample-apps/react-native/dogfood/ios/GoogleService-Info.plist @@ -19,7 +19,7 @@ PROJECT_ID stream-video-9b586 STORAGE_BUCKET - stream-video-9b586.appspot.com + stream-video-9b586.firebasestorage.app IS_ADS_ENABLED IS_ANALYTICS_ENABLED diff --git a/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample.xcodeproj/project.pbxproj b/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample.xcodeproj/project.pbxproj index 4520c772bd..2c4cc149a1 100644 --- a/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample.xcodeproj/project.pbxproj +++ b/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample.xcodeproj/project.pbxproj @@ -76,7 +76,7 @@ 708A154FC8B4F4BC106A6A17 /* Pods-StreamReactNativeVideoSDKSample-StreamReactNativeVideoSDKSampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StreamReactNativeVideoSDKSample-StreamReactNativeVideoSDKSampleTests.debug.xcconfig"; path = "Target Support Files/Pods-StreamReactNativeVideoSDKSample-StreamReactNativeVideoSDKSampleTests/Pods-StreamReactNativeVideoSDKSample-StreamReactNativeVideoSDKSampleTests.debug.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = StreamReactNativeVideoSDKSample/LaunchScreen.storyboard; sourceTree = ""; }; 82EFD02D0801AB3A8C4FA795 /* Pods_StreamReactNativeVideoSDKSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_StreamReactNativeVideoSDKSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 88BB23A1BB898D9683DCB129 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = StreamReactNativeVideoSDKSample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 88BB23A1BB898D9683DCB129 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = StreamReactNativeVideoSDKSample/PrivacyInfo.xcprivacy; sourceTree = ""; }; 9FF5873D7CFBD5B6ADF5E88E /* Pods-StreamReactNativeVideoSDKSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StreamReactNativeVideoSDKSample.debug.xcconfig"; path = "Target Support Files/Pods-StreamReactNativeVideoSDKSample/Pods-StreamReactNativeVideoSDKSample.debug.xcconfig"; sourceTree = ""; }; BFF02C9ED8B0E334A6042435 /* Pods-StreamReactNativeVideoSDKSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StreamReactNativeVideoSDKSample.release.xcconfig"; path = "Target Support Files/Pods-StreamReactNativeVideoSDKSample/Pods-StreamReactNativeVideoSDKSample.release.xcconfig"; sourceTree = ""; }; C73B75C69992770C64D361AA /* Pods_StreamReactNativeVideoSDKSample_StreamReactNativeVideoSDKSampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_StreamReactNativeVideoSDKSample_StreamReactNativeVideoSDKSampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; diff --git a/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample/Info.plist b/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample/Info.plist index da0d256b42..e35e0bfa89 100644 --- a/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample/Info.plist +++ b/sample-apps/react-native/dogfood/ios/StreamReactNativeVideoSDKSample/Info.plist @@ -37,7 +37,7 @@ Editor CFBundleURLSchemes - com.googleusercontent.apps.347024607410-a466jkdqm1mma55s90on17aovv5gp4ss + com.googleusercontent.apps.347024607410-rouq076vsrsm1f410o4c59idevc1b6gf diff --git a/sample-apps/react-native/expo-video-sample/GoogleService-Info.plist b/sample-apps/react-native/expo-video-sample/GoogleService-Info.plist index bfbdf49fdc..d7c19f70ed 100644 --- a/sample-apps/react-native/expo-video-sample/GoogleService-Info.plist +++ b/sample-apps/react-native/expo-video-sample/GoogleService-Info.plist @@ -2,18 +2,24 @@ + CLIENT_ID + 347024607410-4jqjakcd24c5i2c5m1rrcpo5oq6t5gqe.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.347024607410-4jqjakcd24c5i2c5m1rrcpo5oq6t5gqe + ANDROID_CLIENT_ID + 347024607410-05007a8vo1lm47lojrido3dcl5mdgqgq.apps.googleusercontent.com API_KEY - AIzaSyDapUnYA-lAMzn65cmFnYO0tKUi9wpBsLI + AIzaSyCvN-HAjjnGuJS1sV5-XkhZ0BYnkxXZdPs GCM_SENDER_ID - 296557120037 + 347024607410 PLIST_VERSION 1 BUNDLE_ID io.getstream.expovideosample PROJECT_ID - react-native-samples-8f4f4 + stream-video-9b586 STORAGE_BUCKET - react-native-samples-8f4f4.appspot.com + stream-video-9b586.firebasestorage.app IS_ADS_ENABLED IS_ANALYTICS_ENABLED @@ -25,6 +31,6 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:296557120037:ios:b43bb980d717194df60dcc + 1:347024607410:ios:bdf5cf89446dfa8f8c21ab \ No newline at end of file diff --git a/sample-apps/react-native/expo-video-sample/google-services.json b/sample-apps/react-native/expo-video-sample/google-services.json index b76c2bed53..7a4585af06 100644 --- a/sample-apps/react-native/expo-video-sample/google-services.json +++ b/sample-apps/react-native/expo-video-sample/google-services.json @@ -1,40 +1,120 @@ { "project_info": { - "project_number": "296557120037", - "project_id": "react-native-samples-8f4f4", - "storage_bucket": "react-native-samples-8f4f4.appspot.com" + "project_number": "347024607410", + "project_id": "stream-video-9b586", + "storage_bucket": "stream-video-9b586.firebasestorage.app" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:7e1a3d37d1ea4575f60dcc", + "mobilesdk_app_id": "1:347024607410:android:cb73830768e81a818c21ab", + "android_client_info": { + "package_name": "com.example.chattutorial" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:fc2f5712a8e803828c21ab", + "android_client_info": { + "package_name": "io.getstream.android.samples.ringingcall" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:f0fa09fba7fe2ef68c21ab", "android_client_info": { "package_name": "io.getstream.expovideosample" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-isou7erf2phbgevkbftibt4a9elqtnb9.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.expovideosample", + "certificate_hash": "24143f17953b7de3cf68cf783eff58603b3194ba" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -43,34 +123,50 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:a96d3423171fce2af60dcc", + "mobilesdk_app_id": "1:347024607410:android:df319f46f747d6e28c21ab", "android_client_info": { - "package_name": "io.getstream.reactnative.imessageclone" + "package_name": "io.getstream.rnvideosample" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-7dn7m72al5hb9e61lhi72fdqst6246hl.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.rnvideosample", + "certificate_hash": "f6d823e43cb46c2543b37f5dd65144365d94de68" + } + }, + { + "client_id": "347024607410-edfh4po3fuu37d1ft7vbakkkkd7er62i.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.rnvideosample", + "certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -79,34 +175,42 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:13ccb281a7750765f60dcc", + "mobilesdk_app_id": "1:347024607410:android:48f2a146c871fa308c21ab", "android_client_info": { - "package_name": "io.getstream.reactnative.slackclone" + "package_name": "io.getstream.video.android" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-93sogn1k3o4c5h4e2kjnmue3rh6kn012.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android", + "certificate_hash": "0df0d0349c0eb717eea90c0b41fc00ab1ab04e16" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -115,34 +219,42 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:c200ee23e884e68ef60dcc", + "mobilesdk_app_id": "1:347024607410:android:9708d415a58f054c8c21ab", "android_client_info": { - "package_name": "io.getstream.reactnative.whatsappclone" + "package_name": "io.getstream.video.android.debug" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-s9g6iv2kabron4pc8vpgmr0tupj7icv9.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.debug", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] @@ -151,34 +263,162 @@ }, { "client_info": { - "mobilesdk_app_id": "1:296557120037:android:b5d44592a3a4b44af60dcc", + "mobilesdk_app_id": "1:347024607410:android:af4ba3e6161705318c21ab", "android_client_info": { - "package_name": "io.getstream.rnvideosample" + "package_name": "io.getstream.video.android.dogfooding" } }, "oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-1mvrtdruipge7vf7tvm3tt2ef23d75a6.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding", + "certificate_hash": "fe9176d4a93cd07404632ffb44fc18488bce879c" + } + }, + { + "client_id": "347024607410-50k1bcpk5chud1g1ooek43kpq85buvtc.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding", + "certificate_hash": "21b0959c583df5e95fb65a8cd50a672dfe66812b" + } + }, + { + "client_id": "347024607410-elv7783tde1kf323h7cdu6ks4ec6gcbm.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:7a79e79c9902e02c8c21ab", + "android_client_info": { + "package_name": "io.getstream.video.android.dogfooding.debug" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-3j7502bmnqo753sgkcjiuo88m1gj0s6j.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding.debug", + "certificate_hash": "21b0959c583df5e95fb65a8cd50a672dfe66812b" + } + }, + { + "client_id": "347024607410-c4f79jvma8jgo82b3na1kdv7c3a7n0qu.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding.debug", + "certificate_hash": "fe9176d4a93cd07404632ffb44fc18488bce879c" + } + }, + { + "client_id": "347024607410-jvtqudi4h0lravau0r15g8eocoe843f6.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.android.dogfooding.debug", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.iOS.VideoDemoApp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:347024607410:android:d51590d07b9f9f3c8c21ab", + "android_client_info": { + "package_name": "io.getstream.video.flutter.dogfooding" + } + }, + "oauth_client": [ + { + "client_id": "347024607410-hhlm0gl8o72rg7g7uo26plbd6442risg.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.getstream.video.flutter.dogfooding", + "certificate_hash": "0cebe7750cde7c0cb6817a31aee92e35e13d59c4" + } + }, + { + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBFQzxzFCS9YUBzewXOFz4mwmdOflOwruI" + "current_key": "AIzaSyD4FMyTdDv97hJia6YiV1NMgTdJhbnEwQE" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "296557120037-v76voo1nla88tm9b7ic63279h6ppjk95.apps.googleusercontent.com", + "client_id": "347024607410-ett7cjt6ah9aj6s6k20p5fissj80d9la.apps.googleusercontent.com", "client_type": 3 }, { - "client_id": "296557120037-581oq3r0tcrcb7volhcuo7n41ldra8qe.apps.googleusercontent.com", + "client_id": "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.whatsappclone" + "bundle_id": "io.getstream.iOS.VideoDemoApp" } } ] From 1507ac1aff95c5bcdaf2142b7dd3bf9d460f4c0f Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 12 Dec 2024 16:32:20 +0100 Subject: [PATCH 09/15] fix more issues --- .../client/src/devices/BrowserPermission.ts | 2 +- packages/client/src/devices/devices.ts | 21 +++++++----- .../hooks/push/useProcessPushCallEffect.ts | 4 +-- .../src/hooks/useAutoEnterPiPEffect.tsx | 33 +++++++++++++++++-- .../src/providers/StreamCall.tsx | 14 +++++--- .../src/screens/Call/JoinCallScreen.tsx | 2 +- .../components/CreateRingingCall.tsx | 2 +- 7 files changed, 58 insertions(+), 20 deletions(-) diff --git a/packages/client/src/devices/BrowserPermission.ts b/packages/client/src/devices/BrowserPermission.ts index 0b0f550a9a..111f475ed2 100644 --- a/packages/client/src/devices/BrowserPermission.ts +++ b/packages/client/src/devices/BrowserPermission.ts @@ -152,7 +152,7 @@ export class BrowserPermission { } } -export function canQueryPermissions() { +function canQueryPermissions() { return ( !isReactNative() && typeof navigator !== 'undefined' && diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index d239e4936a..cfdc0830dd 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -12,6 +12,7 @@ import { getLogger } from '../logger'; import { BrowserPermission } from './BrowserPermission'; import { lazy } from '../helpers/lazy'; import { isFirefox } from '../helpers/browsers'; +import { isReactNative } from '../helpers/platforms'; /** * Returns an Observable that emits the list of available devices @@ -200,10 +201,12 @@ export const getAudioStream = async ( }; try { - await getAudioBrowserPermission().prompt({ - throwOnNotAllowed: true, - forcePrompt: true, - }); + if (!isReactNative()) { + await getAudioBrowserPermission().prompt({ + throwOnNotAllowed: true, + forcePrompt: true, + }); + } return await getStream(constraints); } catch (error) { if (isOverconstrainedError(error) && trackConstraints?.deviceId) { @@ -242,10 +245,12 @@ export const getVideoStream = async ( }, }; try { - await getVideoBrowserPermission().prompt({ - throwOnNotAllowed: true, - forcePrompt: true, - }); + if (!isReactNative()) { + await getVideoBrowserPermission().prompt({ + throwOnNotAllowed: true, + forcePrompt: true, + }); + } return await getStream(constraints); } catch (error) { if (isOverconstrainedError(error) && trackConstraints?.deviceId) { diff --git a/packages/react-native-sdk/src/hooks/push/useProcessPushCallEffect.ts b/packages/react-native-sdk/src/hooks/push/useProcessPushCallEffect.ts index a26e0c1fc8..7e7a669771 100644 --- a/packages/react-native-sdk/src/hooks/push/useProcessPushCallEffect.ts +++ b/packages/react-native-sdk/src/hooks/push/useProcessPushCallEffect.ts @@ -11,7 +11,7 @@ import { useStreamVideoClient, } from '@stream-io/video-react-bindings'; import { BehaviorSubject } from 'rxjs'; -import { filter } from 'rxjs/operators'; +import { filter, distinctUntilChanged } from 'rxjs/operators'; import { processCallFromPush } from '../../utils/push/internal/utils'; import { StreamVideoClient } from '@stream-io/video-client'; import type { StreamVideoConfig } from '../../utils/StreamVideoRN/types'; @@ -89,7 +89,7 @@ const createCallSubscription = ( action: 'accept' | 'decline' | 'pressed' | 'backgroundDelivered' ) => { return behaviourSubjectWithCallCid - .pipe(filter(cidIsNotUndefined)) + .pipe(filter(cidIsNotUndefined), distinctUntilChanged()) .subscribe(async (callCId) => { await processCallFromPush(client, callCId, action, pushConfig); behaviourSubjectWithCallCid.next(undefined); // remove the current call id to avoid processing again diff --git a/packages/react-native-sdk/src/hooks/useAutoEnterPiPEffect.tsx b/packages/react-native-sdk/src/hooks/useAutoEnterPiPEffect.tsx index 626ee01493..75c9d3525b 100644 --- a/packages/react-native-sdk/src/hooks/useAutoEnterPiPEffect.tsx +++ b/packages/react-native-sdk/src/hooks/useAutoEnterPiPEffect.tsx @@ -1,20 +1,47 @@ +import { CallingState } from '@stream-io/video-client'; +import { useCallStateHooks } from '@stream-io/video-react-bindings'; import { useEffect } from 'react'; import { NativeModules, Platform } from 'react-native'; export function useAutoEnterPiPEffect( disablePictureInPicture: boolean | undefined ) { + const { useCallCallingState } = useCallStateHooks(); + + const callingState = useCallCallingState(); + + // if we need to enable, only enable in joined state useEffect(() => { if (Platform.OS !== 'android') { return; } - NativeModules.StreamVideoReactNative.canAutoEnterPipMode( - !disablePictureInPicture - ); + if (!disablePictureInPicture && callingState === CallingState.JOINED) { + NativeModules.StreamVideoReactNative.canAutoEnterPipMode( + !disablePictureInPicture + ); + } + }, [callingState, disablePictureInPicture]); + + // on unmount always disable PiP mode + useEffect(() => { + if (Platform.OS !== 'android') { + return; + } return () => { NativeModules.StreamVideoReactNative.canAutoEnterPipMode(false); }; }, [disablePictureInPicture]); + + // if disable prop was sent, immediately disable PiP mode + useEffect(() => { + if (Platform.OS !== 'android') { + return; + } + + if (disablePictureInPicture) { + NativeModules.StreamVideoReactNative.canAutoEnterPipMode(false); + } + }, [disablePictureInPicture]); } diff --git a/packages/react-native-sdk/src/providers/StreamCall.tsx b/packages/react-native-sdk/src/providers/StreamCall.tsx index ddb684b9ea..4783bf9bda 100644 --- a/packages/react-native-sdk/src/providers/StreamCall.tsx +++ b/packages/react-native-sdk/src/providers/StreamCall.tsx @@ -50,6 +50,7 @@ const AppStateListener = () => { // ref: https://www.reddit.com/r/reactnative/comments/15kib42/appstate_behavior_in_ios_when_swiping_down_to/ const subscription = AppState.addEventListener('change', (nextAppState) => { if (appState.current.match(/background/) && nextAppState === 'active') { + console.log('background to active'); if ( call?.camera?.state.status === 'enabled' && Platform.OS === 'android' @@ -67,27 +68,32 @@ const AppStateListener = () => { appState.current === 'active' && nextAppState.match(/background/) ) { + console.log('active to background'); if (Platform.OS === 'android') { // in Android, we need to check if we are in PiP mode // in PiP mode, we don't want to disable the camera NativeModules?.StreamVideoReactNative?.isInPiPMode().then( (isInPiP: boolean | null | undefined) => { if (!isInPiP) { - const currentState = appState.current; - if (currentState === 'active') { + // const currentState = appState.current; + if (AppState.currentState === 'active') { // this is to handle the case that the app became active as soon as it went to background // in this case, we dont want to disable the camera // this happens on foreground push notifications return; } - call?.camera?.disable(); + if (call?.camera?.state.status === 'enabled') { + call?.camera?.disable(); + } } } ); } else { // shouldDisableIOSLocalVideoOnBackgroundRef is false, if local video is enabled on PiP if (shouldDisableIOSLocalVideoOnBackgroundRef.current) { - call?.camera?.disable(); + if (call?.camera?.state.status === 'enabled') { + call?.camera?.disable(); + } } } appState.current = nextAppState; diff --git a/sample-apps/react-native/dogfood/src/screens/Call/JoinCallScreen.tsx b/sample-apps/react-native/dogfood/src/screens/Call/JoinCallScreen.tsx index ffbb17bea3..7fce89ca4c 100644 --- a/sample-apps/react-native/dogfood/src/screens/Call/JoinCallScreen.tsx +++ b/sample-apps/react-native/dogfood/src/screens/Call/JoinCallScreen.tsx @@ -52,7 +52,7 @@ const JoinCallScreen = () => { settings_override: { ring: { auto_cancel_timeout_ms: 30000, - incoming_call_timeout_ms: 5000, + incoming_call_timeout_ms: 30000, }, }, members: ringingUserIds.map((ringingUserId) => { diff --git a/sample-apps/react-native/expo-video-sample/components/CreateRingingCall.tsx b/sample-apps/react-native/expo-video-sample/components/CreateRingingCall.tsx index 0e2793dfbe..8a3cfd79ed 100644 --- a/sample-apps/react-native/expo-video-sample/components/CreateRingingCall.tsx +++ b/sample-apps/react-native/expo-video-sample/components/CreateRingingCall.tsx @@ -35,7 +35,7 @@ export default function CreateRingingCall() { settings_override: { ring: { auto_cancel_timeout_ms: 30000, - incoming_call_timeout_ms: 5000, + incoming_call_timeout_ms: 30000, }, }, members: ringingUserIds.map((ringingUserId) => { From 013b495c5f7ecd0cc80c430dd9242f7aa5270199 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 12 Dec 2024 16:37:50 +0100 Subject: [PATCH 10/15] remove logs --- packages/react-native-sdk/src/providers/StreamCall.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/react-native-sdk/src/providers/StreamCall.tsx b/packages/react-native-sdk/src/providers/StreamCall.tsx index 4783bf9bda..c87bb3cba1 100644 --- a/packages/react-native-sdk/src/providers/StreamCall.tsx +++ b/packages/react-native-sdk/src/providers/StreamCall.tsx @@ -50,7 +50,6 @@ const AppStateListener = () => { // ref: https://www.reddit.com/r/reactnative/comments/15kib42/appstate_behavior_in_ios_when_swiping_down_to/ const subscription = AppState.addEventListener('change', (nextAppState) => { if (appState.current.match(/background/) && nextAppState === 'active') { - console.log('background to active'); if ( call?.camera?.state.status === 'enabled' && Platform.OS === 'android' @@ -68,7 +67,6 @@ const AppStateListener = () => { appState.current === 'active' && nextAppState.match(/background/) ) { - console.log('active to background'); if (Platform.OS === 'android') { // in Android, we need to check if we are in PiP mode // in PiP mode, we don't want to disable the camera From 282968d83073e9b72ac8a216e1350f0b2b1d54f8 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 12 Dec 2024 16:41:19 +0100 Subject: [PATCH 11/15] remove the resume change --- .../client/src/devices/InputMediaDeviceManager.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/client/src/devices/InputMediaDeviceManager.ts b/packages/client/src/devices/InputMediaDeviceManager.ts index 881e52383b..ad31d160e9 100644 --- a/packages/client/src/devices/InputMediaDeviceManager.ts +++ b/packages/client/src/devices/InputMediaDeviceManager.ts @@ -9,7 +9,6 @@ import { getLogger } from '../logger'; import { TrackType } from '../gen/video/sfu/models/models'; import { deviceIds$ } from './devices'; import { - hasPending, settled, withCancellation, withoutConcurrency, @@ -130,13 +129,11 @@ export abstract class InputMediaDeviceManager< * If status was previously enabled, it will re-enable the device. */ async resume() { - if (!hasPending(this.statusChangeConcurrencyTag)) { - if ( - this.state.prevStatus === 'enabled' && - this.state.status !== 'enabled' - ) { - await this.enable(); - } + if ( + this.state.prevStatus === 'enabled' && + this.state.status !== 'enabled' + ) { + await this.enable(); } } From efdf8f4c5c5f6cf09e0ee65eebdd8be0daab273d Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 12 Dec 2024 16:50:44 +0100 Subject: [PATCH 12/15] simplify not allowed error --- packages/client/src/devices/BrowserPermission.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/client/src/devices/BrowserPermission.ts b/packages/client/src/devices/BrowserPermission.ts index 153d005d76..2c85cd17e7 100644 --- a/packages/client/src/devices/BrowserPermission.ts +++ b/packages/client/src/devices/BrowserPermission.ts @@ -73,16 +73,9 @@ export class BrowserPermission { const isGranted = this.state === 'granted'; if (!isGranted && throwOnNotAllowed) { - if (typeof DOMException !== 'undefined') { - throw new DOMException( - 'Permission was not granted previously, and prompting again is not allowed', - 'NotAllowedError', - ); - } else { - throw new Error( - 'Permission was not granted previously, and prompting again is not allowed', - ); - } + throw new Error( + 'Permission was not granted previously, and prompting again is not allowed', + ); } return isGranted; From 8f23a001d9cdc7227e9f3f29f2b4602adfb200bb Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 12 Dec 2024 17:10:45 +0100 Subject: [PATCH 13/15] remove comment --- packages/react-native-sdk/src/providers/StreamCall.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native-sdk/src/providers/StreamCall.tsx b/packages/react-native-sdk/src/providers/StreamCall.tsx index c87bb3cba1..fc268ec7f4 100644 --- a/packages/react-native-sdk/src/providers/StreamCall.tsx +++ b/packages/react-native-sdk/src/providers/StreamCall.tsx @@ -73,7 +73,6 @@ const AppStateListener = () => { NativeModules?.StreamVideoReactNative?.isInPiPMode().then( (isInPiP: boolean | null | undefined) => { if (!isInPiP) { - // const currentState = appState.current; if (AppState.currentState === 'active') { // this is to handle the case that the app became active as soon as it went to background // in this case, we dont want to disable the camera From 3b25799005394bb0b202249bc4a9d4513cb07414 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Fri, 13 Dec 2024 10:11:47 +0100 Subject: [PATCH 14/15] prompt on RN also --- packages/client/src/devices/devices.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 8eee15c27d..16b083f117 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -200,12 +200,10 @@ export const getAudioStream = async ( }; try { - if (!isReactNative()) { - await getAudioBrowserPermission().prompt({ - throwOnNotAllowed: true, - forcePrompt: true, - }); - } + await getAudioBrowserPermission().prompt({ + throwOnNotAllowed: true, + forcePrompt: true, + }); return await getStream(constraints); } catch (error) { if (isOverconstrainedError(error) && trackConstraints?.deviceId) { @@ -244,12 +242,10 @@ export const getVideoStream = async ( }, }; try { - if (!isReactNative()) { - await getVideoBrowserPermission().prompt({ - throwOnNotAllowed: true, - forcePrompt: true, - }); - } + await getVideoBrowserPermission().prompt({ + throwOnNotAllowed: true, + forcePrompt: true, + }); return await getStream(constraints); } catch (error) { if (isOverconstrainedError(error) && trackConstraints?.deviceId) { From 618665bae5ace64f5f190ebcc309ca69abf1c72f Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Fri, 13 Dec 2024 10:25:25 +0100 Subject: [PATCH 15/15] Update packages/client/src/devices/devices.ts --- packages/client/src/devices/devices.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 16b083f117..6dec651a91 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -12,7 +12,6 @@ import { getLogger } from '../logger'; import { BrowserPermission } from './BrowserPermission'; import { lazy } from '../helpers/lazy'; import { isFirefox } from '../helpers/browsers'; -import { isReactNative } from '../helpers/platforms'; /** * Returns an Observable that emits the list of available devices