@stream-io/video-react-native-sdk 1.10.17 → 1.10.19
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 +728 -687
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +1 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +5 -5
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +5 -3
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/commonjs/contexts/BackgroundFilters.js +1 -1
- package/dist/commonjs/contexts/BackgroundFilters.js.map +1 -1
- package/dist/commonjs/contexts/ThemeContext.js +12 -3
- package/dist/commonjs/contexts/ThemeContext.js.map +1 -1
- package/dist/commonjs/hooks/internal/useCallMediaStreamCleanup.js +0 -1
- package/dist/commonjs/hooks/internal/useCallMediaStreamCleanup.js.map +1 -1
- package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +4 -4
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +11 -5
- package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/commonjs/hooks/useScreenShareButton.js +1 -3
- package/dist/commonjs/hooks/useScreenShareButton.js.map +1 -1
- package/dist/commonjs/hooks/useTrackDimensions.js +1 -1
- package/dist/commonjs/hooks/useTrackDimensions.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/DeviceStats.js +2 -2
- package/dist/commonjs/providers/StreamCall/DeviceStats.js.map +1 -1
- package/dist/commonjs/providers/StreamVideo.js +1 -1
- package/dist/commonjs/providers/StreamVideo.js.map +1 -1
- package/dist/commonjs/utils/internal/optionallibs/gestureHandler.js +1 -1
- package/dist/commonjs/utils/internal/optionallibs/gestureHandler.js.map +1 -1
- package/dist/commonjs/utils/internal/optionallibs/reanimated.js +1 -1
- package/dist/commonjs/utils/internal/optionallibs/reanimated.js.map +1 -1
- package/dist/commonjs/utils/internal/pushLogoutCallback.js +1 -1
- package/dist/commonjs/utils/internal/pushLogoutCallback.js.map +1 -1
- package/dist/commonjs/utils/push/internal/ios.js +104 -0
- package/dist/commonjs/utils/push/internal/ios.js.map +1 -0
- package/dist/commonjs/utils/push/ios.js +15 -107
- package/dist/commonjs/utils/push/ios.js.map +1 -1
- package/dist/commonjs/utils/push/libs/callkeep.js +1 -1
- package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -1
- package/dist/commonjs/utils/push/libs/expoNotifications.js +1 -1
- package/dist/commonjs/utils/push/libs/expoNotifications.js.map +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
- package/dist/commonjs/utils/push/libs/iosPushNotification.js +1 -1
- package/dist/commonjs/utils/push/libs/iosPushNotification.js.map +1 -1
- package/dist/commonjs/utils/push/libs/notifee/lib.js +1 -1
- package/dist/commonjs/utils/push/libs/notifee/lib.js.map +1 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js +1 -1
- package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +2 -2
- package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +2 -2
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +2 -2
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +2 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +6 -6
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js +1 -1
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/Lobby/LobbyFooter.js +1 -1
- package/dist/module/components/Call/Lobby/LobbyFooter.js.map +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +4 -4
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +7 -5
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/SpeechIndicator.js +1 -1
- package/dist/module/components/Participant/ParticipantView/SpeechIndicator.js.map +1 -1
- package/dist/module/contexts/BackgroundFilters.js +1 -1
- package/dist/module/contexts/BackgroundFilters.js.map +1 -1
- package/dist/module/contexts/ThemeContext.js +11 -1
- package/dist/module/contexts/ThemeContext.js.map +1 -1
- package/dist/module/hooks/internal/useCallMediaStreamCleanup.js +0 -1
- package/dist/module/hooks/internal/useCallMediaStreamCleanup.js.map +1 -1
- package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +4 -4
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +12 -6
- package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js +1 -1
- package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +2 -2
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/hooks/usePermissionRequest.js +1 -1
- package/dist/module/hooks/usePermissionRequest.js.map +1 -1
- package/dist/module/hooks/useScreenShareButton.js +3 -5
- package/dist/module/hooks/useScreenShareButton.js.map +1 -1
- package/dist/module/hooks/useTrackDimensions.js +2 -2
- package/dist/module/hooks/useTrackDimensions.js.map +1 -1
- package/dist/module/providers/StreamCall/DeviceStats.js +4 -4
- package/dist/module/providers/StreamCall/DeviceStats.js.map +1 -1
- package/dist/module/providers/StreamVideo.js +2 -2
- package/dist/module/providers/StreamVideo.js.map +1 -1
- package/dist/module/utils/internal/optionallibs/gestureHandler.js +1 -1
- package/dist/module/utils/internal/optionallibs/gestureHandler.js.map +1 -1
- package/dist/module/utils/internal/optionallibs/reanimated.js +1 -1
- package/dist/module/utils/internal/optionallibs/reanimated.js.map +1 -1
- package/dist/module/utils/internal/pushLogoutCallback.js +1 -1
- package/dist/module/utils/internal/pushLogoutCallback.js.map +1 -1
- package/dist/module/utils/push/android.js +3 -3
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/ios.js +97 -0
- package/dist/module/utils/push/internal/ios.js.map +1 -0
- package/dist/module/utils/push/internal/utils.js +1 -1
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/utils/push/ios.js +18 -109
- package/dist/module/utils/push/ios.js.map +1 -1
- package/dist/module/utils/push/libs/callkeep.js +1 -1
- package/dist/module/utils/push/libs/callkeep.js.map +1 -1
- package/dist/module/utils/push/libs/expoNotifications.js +1 -1
- package/dist/module/utils/push/libs/expoNotifications.js.map +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/lib.js +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
- package/dist/module/utils/push/libs/iosPushNotification.js +1 -1
- package/dist/module/utils/push/libs/iosPushNotification.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
- package/dist/module/utils/push/libs/notifee/lib.js +1 -1
- package/dist/module/utils/push/libs/notifee/lib.js.map +1 -1
- package/dist/module/utils/push/libs/voipPushNotification.js +1 -1
- package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -1
- package/dist/module/utils/push/setupIosCallKeepEvents.js +3 -4
- package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -1
- package/dist/module/utils/push/setupIosVoipPushEvents.js +2 -2
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/AcceptCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/CallControls.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/CallControlsButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/HangupCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/IncomingCallControls.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/OutgoingCallControls.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ReactionsButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/RejectCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ScreenShareToggleButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ToggleAudioPreviewButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ToggleAudioPublishingButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ToggleCameraFaceButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ToggleVideoPreviewButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/ToggleVideoPublishingButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallControls/internal/ReactionsPicker.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/JoinCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/LobbyFooter.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/CallLeftIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/CallPreparingIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/IncomingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/TextBasedIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/UserInfo.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamPlayer/LivestreamPlayer.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/index.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantNetworkQualityIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantReaction.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantVideoFallback.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantView.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/SpeechIndicator.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer.d.ts.map +1 -1
- package/dist/typescript/components/utility/Avatar.d.ts.map +1 -1
- package/dist/typescript/components/utility/ScreenShareOverlay.d.ts.map +1 -1
- package/dist/typescript/contexts/BackgroundFilters.d.ts.map +1 -1
- package/dist/typescript/contexts/ThemeContext.d.ts +10 -2
- package/dist/typescript/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/typescript/hooks/internal/useCallMediaStreamCleanup.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts.map +1 -1
- package/dist/typescript/hooks/usePermissionNotification.d.ts.map +1 -1
- package/dist/typescript/hooks/useScreenShareButton.d.ts +21 -1
- package/dist/typescript/hooks/useScreenShareButton.d.ts.map +1 -1
- package/dist/typescript/icons/Back.d.ts.map +1 -1
- package/dist/typescript/icons/CameraSwitch.d.ts.map +1 -1
- package/dist/typescript/icons/IconWrapper.d.ts.map +1 -1
- package/dist/typescript/icons/Lock.d.ts.map +1 -1
- package/dist/typescript/icons/Mic.d.ts.map +1 -1
- package/dist/typescript/icons/MicOff.d.ts.map +1 -1
- package/dist/typescript/icons/Phone.d.ts.map +1 -1
- package/dist/typescript/icons/PhoneDown.d.ts.map +1 -1
- package/dist/typescript/icons/PinVertical.d.ts.map +1 -1
- package/dist/typescript/icons/Reaction.d.ts.map +1 -1
- package/dist/typescript/icons/ScreenShare.d.ts.map +1 -1
- package/dist/typescript/icons/ScreenShareIndicator.d.ts.map +1 -1
- package/dist/typescript/icons/Settings.d.ts.map +1 -1
- package/dist/typescript/icons/Spotlight.d.ts.map +1 -1
- package/dist/typescript/icons/StopScreenShare.d.ts.map +1 -1
- package/dist/typescript/icons/ThreeDots.d.ts.map +1 -1
- package/dist/typescript/icons/TopViewBackground.d.ts.map +1 -1
- package/dist/typescript/icons/Video.d.ts.map +1 -1
- package/dist/typescript/icons/VideoSlash.d.ts.map +1 -1
- package/dist/typescript/providers/StreamCall/index.d.ts.map +1 -1
- package/dist/typescript/providers/StreamVideo.d.ts.map +1 -1
- package/dist/typescript/utils/hooks/usePrevious.d.ts.map +1 -1
- package/dist/typescript/utils/index.d.ts.map +1 -1
- package/dist/typescript/utils/internal/optionallibs/gestureHandler.d.ts.map +1 -1
- package/dist/typescript/utils/internal/optionallibs/reanimated.d.ts.map +1 -1
- package/dist/typescript/utils/internal/pushLogoutCallback.d.ts +1 -1
- package/dist/typescript/utils/internal/pushLogoutCallback.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +1 -1
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/ios.d.ts +3 -0
- package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -0
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/utils/push/ios.d.ts +0 -1
- package/dist/typescript/utils/push/ios.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts +1 -1
- package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/iosPushNotification.d.ts +1 -1
- package/dist/typescript/utils/push/libs/iosPushNotification.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/withAndroidManifest.js +0 -1
- package/expo-config-plugin/dist/withAppDelegate.js +1 -1
- package/expo-config-plugin/dist/withIosScreenCapture/withPlistUpdates.js +1 -1
- package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -1
- package/package.json +20 -23
- package/src/components/Call/CallContent/CallContent.tsx +3 -3
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +6 -4
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +5 -5
- package/src/components/Call/CallControls/CallControlsButton.tsx +1 -1
- package/src/components/Call/CallControls/LobbyControls.tsx +1 -1
- package/src/components/Call/CallControls/ScreenShareToggleButton.tsx +1 -1
- package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +4 -4
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +1 -1
- package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +5 -5
- package/src/components/Call/Lobby/JoinCallButton.tsx +1 -1
- package/src/components/Call/Lobby/Lobby.tsx +2 -2
- package/src/components/Call/Lobby/LobbyFooter.tsx +2 -2
- package/src/components/Call/RingingCallContent/UserInfo.tsx +1 -1
- package/src/components/Livestream/HostLivestream/HostLivestream.tsx +1 -1
- package/src/components/Livestream/LivestreamControls/LivestreamScreenShareToggleButton.tsx +1 -1
- package/src/components/Livestream/LivestreamLayout/LivestreamLayout.tsx +1 -1
- package/src/components/Livestream/LivestreamTopView/DurationBadge.tsx +1 -1
- package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +1 -1
- package/src/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.tsx +10 -10
- package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx +15 -13
- package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +1 -1
- package/src/components/Participant/ParticipantView/ParticipantNetworkQualityIndicator.tsx +1 -1
- package/src/components/Participant/ParticipantView/ParticipantReaction.tsx +3 -3
- package/src/components/Participant/ParticipantView/ParticipantView.tsx +1 -1
- package/src/components/Participant/ParticipantView/SpeechIndicator.tsx +3 -3
- package/src/components/Participant/ParticipantView/VideoRenderer.tsx +1 -1
- package/src/contexts/BackgroundFilters.tsx +7 -7
- package/src/contexts/StreamVideoContext.tsx +3 -3
- package/src/contexts/ThemeContext.tsx +15 -5
- package/src/hooks/internal/useCallMediaStreamCleanup.ts +2 -6
- package/src/hooks/push/useInitAndroidTokenAndRest.ts +1 -1
- package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +25 -25
- package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +28 -19
- package/src/hooks/push/useProcessPushCallEffect.ts +8 -8
- package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +1 -1
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +10 -10
- package/src/hooks/useAutoEnterPiPEffect.tsx +2 -2
- package/src/hooks/useIsIosScreenshareBroadcastStarted.ts +2 -2
- package/src/hooks/usePaginatedLayoutSortPreset.ts +1 -1
- package/src/hooks/usePermissionNotification.tsx +1 -1
- package/src/hooks/usePermissionRequest.tsx +4 -4
- package/src/hooks/useScreenShareButton.ts +9 -10
- package/src/hooks/useTrackDimensions.ts +3 -3
- package/src/providers/StreamCall/AppStateListener.tsx +6 -6
- package/src/providers/StreamCall/DeviceStats.tsx +8 -8
- package/src/providers/StreamVideo.tsx +4 -4
- package/src/utils/StreamVideoRN/index.ts +4 -4
- package/src/utils/StreamVideoRN/types.ts +2 -2
- package/src/utils/enterPiPAndroid.ts +1 -1
- package/src/utils/index.ts +2 -2
- package/src/utils/internal/newNotificationCallbacks.ts +3 -3
- package/src/utils/internal/optionallibs/gestureHandler.ts +1 -1
- package/src/utils/internal/optionallibs/reanimated.ts +1 -1
- package/src/utils/internal/pushLogoutCallback.ts +1 -1
- package/src/utils/push/android.ts +33 -33
- package/src/utils/push/internal/ios.ts +133 -0
- package/src/utils/push/internal/utils.ts +10 -10
- package/src/utils/push/ios.ts +38 -164
- package/src/utils/push/libs/callkeep.ts +2 -2
- package/src/utils/push/libs/expoNotifications.ts +5 -5
- package/src/utils/push/libs/firebaseMessaging/index.ts +3 -3
- package/src/utils/push/libs/firebaseMessaging/lib.ts +1 -1
- package/src/utils/push/libs/iosPushNotification.ts +4 -4
- package/src/utils/push/libs/notifee/index.ts +7 -7
- package/src/utils/push/libs/notifee/lib.ts +1 -1
- package/src/utils/push/libs/voipPushNotification.ts +2 -2
- package/src/utils/push/setupIosCallKeepEvents.ts +17 -18
- package/src/utils/push/setupIosVoipPushEvents.ts +5 -5
- package/src/utils/push/utils.ts +2 -2
- package/src/version.ts +1 -1
package/src/utils/push/ios.ts
CHANGED
|
@@ -1,35 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
2
|
import type { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
3
|
-
import {
|
|
4
|
-
pushNonRingingCallData$,
|
|
5
|
-
pushUnsubscriptionCallbacks$,
|
|
6
|
-
voipPushNotificationCallCId$,
|
|
7
|
-
} from './internal/rxSubjects';
|
|
3
|
+
import { pushNonRingingCallData$ } from './internal/rxSubjects';
|
|
8
4
|
import {
|
|
9
5
|
type ExpoNotification,
|
|
10
|
-
getCallKeepLib,
|
|
11
6
|
getExpoNotificationsLib,
|
|
12
7
|
getNotifeeLibThrowIfNotInstalledForPush,
|
|
13
8
|
getPushNotificationIosLib,
|
|
14
|
-
getVoipPushNotificationLib,
|
|
15
9
|
type PushNotificationiOSType,
|
|
16
10
|
} from './libs';
|
|
17
|
-
import {
|
|
11
|
+
import { getLogger, StreamVideoClient } from '@stream-io/video-client';
|
|
18
12
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
19
13
|
import type { Event } from '@notifee/react-native';
|
|
20
14
|
import { StreamVideoRN } from '../StreamVideoRN';
|
|
21
15
|
import type { StreamPushPayload } from './utils';
|
|
22
|
-
import {
|
|
23
|
-
shouldCallBeEnded,
|
|
24
|
-
canAddPushWSSubscriptionsRef,
|
|
25
|
-
} from './internal/utils';
|
|
26
16
|
|
|
27
17
|
type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
28
18
|
|
|
29
19
|
let lastApnToken = { token: '', userId: '' };
|
|
30
20
|
|
|
31
21
|
function processNonRingingNotificationStreamPayload(
|
|
32
|
-
streamPayload: StreamPushPayload
|
|
22
|
+
streamPayload: StreamPushPayload,
|
|
33
23
|
) {
|
|
34
24
|
if (
|
|
35
25
|
streamPayload?.sender === 'stream.video' &&
|
|
@@ -60,7 +50,9 @@ export const oniOSExpoNotificationEvent = (event: ExpoNotification) => {
|
|
|
60
50
|
const logger = getLogger(['processNonRingingNotificationStreamPayload']);
|
|
61
51
|
logger(
|
|
62
52
|
'trace',
|
|
63
|
-
`processNonRingingNotificationStreamPayload - ${JSON.stringify(
|
|
53
|
+
`processNonRingingNotificationStreamPayload - ${JSON.stringify(
|
|
54
|
+
streamPayload,
|
|
55
|
+
)}`,
|
|
64
56
|
);
|
|
65
57
|
processNonRingingNotificationStreamPayload(streamPayload);
|
|
66
58
|
}
|
|
@@ -86,7 +78,7 @@ export const oniOSNotifeeEvent = ({
|
|
|
86
78
|
const logger = getLogger(['oniOSNotifeeEvent']);
|
|
87
79
|
logger(
|
|
88
80
|
'debug',
|
|
89
|
-
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})
|
|
81
|
+
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`,
|
|
90
82
|
);
|
|
91
83
|
pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
|
|
92
84
|
}
|
|
@@ -94,7 +86,7 @@ export const oniOSNotifeeEvent = ({
|
|
|
94
86
|
};
|
|
95
87
|
|
|
96
88
|
export function onPushNotificationiOSStreamVideoEvent(
|
|
97
|
-
notification: PushNotificationiOSType
|
|
89
|
+
notification: PushNotificationiOSType,
|
|
98
90
|
) {
|
|
99
91
|
const pushNotificationIosLib = getPushNotificationIosLib();
|
|
100
92
|
const data = notification.getData();
|
|
@@ -103,7 +95,9 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
103
95
|
if (!streamPayload) {
|
|
104
96
|
logger(
|
|
105
97
|
'trace',
|
|
106
|
-
`skipping process: no stream payload found in notification data - ${JSON.stringify(
|
|
98
|
+
`skipping process: no stream payload found in notification data - ${JSON.stringify(
|
|
99
|
+
data,
|
|
100
|
+
)}`,
|
|
107
101
|
);
|
|
108
102
|
return;
|
|
109
103
|
}
|
|
@@ -112,7 +106,7 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
112
106
|
if (!isClicked || !pushConfig) {
|
|
113
107
|
logger(
|
|
114
108
|
'debug',
|
|
115
|
-
`notification.finish called and returning - isClicked: ${isClicked}, pushConfig: ${!!pushConfig}
|
|
109
|
+
`notification.finish called and returning - isClicked: ${isClicked}, pushConfig: ${!!pushConfig}`,
|
|
116
110
|
);
|
|
117
111
|
notification.finish(pushNotificationIosLib.FetchResult.NoData);
|
|
118
112
|
return;
|
|
@@ -122,7 +116,7 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
122
116
|
if (result) {
|
|
123
117
|
logger(
|
|
124
118
|
'debug',
|
|
125
|
-
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})
|
|
119
|
+
`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`,
|
|
126
120
|
);
|
|
127
121
|
pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
|
|
128
122
|
}
|
|
@@ -133,7 +127,7 @@ export function onPushNotificationiOSStreamVideoEvent(
|
|
|
133
127
|
export async function initIosNonVoipToken(
|
|
134
128
|
client: StreamVideoClient,
|
|
135
129
|
pushConfig: PushConfig,
|
|
136
|
-
setUnsubscribeListener: (unsubscribe: () => void) => void
|
|
130
|
+
setUnsubscribeListener: (unsubscribe: () => void) => void,
|
|
137
131
|
) {
|
|
138
132
|
if (
|
|
139
133
|
Platform.OS !== 'ios' ||
|
|
@@ -150,7 +144,7 @@ export async function initIosNonVoipToken(
|
|
|
150
144
|
logger(
|
|
151
145
|
'debug',
|
|
152
146
|
'Skipped sending device token to stream as it was already sent',
|
|
153
|
-
token
|
|
147
|
+
token,
|
|
154
148
|
);
|
|
155
149
|
return;
|
|
156
150
|
}
|
|
@@ -163,7 +157,7 @@ export async function initIosNonVoipToken(
|
|
|
163
157
|
logger(
|
|
164
158
|
'warn',
|
|
165
159
|
'setPushLogoutCallback - Failed to remove apn token from stream',
|
|
166
|
-
err
|
|
160
|
+
err,
|
|
167
161
|
);
|
|
168
162
|
}
|
|
169
163
|
});
|
|
@@ -180,35 +174,37 @@ export async function initIosNonVoipToken(
|
|
|
180
174
|
};
|
|
181
175
|
if (pushConfig.isExpo) {
|
|
182
176
|
const expoNotificationsLib = getExpoNotificationsLib();
|
|
183
|
-
expoNotificationsLib
|
|
184
|
-
|
|
185
|
-
'debug',
|
|
186
|
-
'Got device token - expoNotificationsLib.getDevicePushTokenAsync',
|
|
187
|
-
devicePushToken.data
|
|
188
|
-
);
|
|
189
|
-
setDeviceToken(devicePushToken.data);
|
|
190
|
-
});
|
|
191
|
-
const subscription = expoNotificationsLib.addPushTokenListener(
|
|
192
|
-
(devicePushToken) => {
|
|
177
|
+
if (expoNotificationsLib) {
|
|
178
|
+
expoNotificationsLib.getDevicePushTokenAsync().then((devicePushToken) => {
|
|
193
179
|
logger(
|
|
194
180
|
'debug',
|
|
195
|
-
'Got device token - expoNotificationsLib.
|
|
196
|
-
devicePushToken.data
|
|
181
|
+
'Got device token - expoNotificationsLib.getDevicePushTokenAsync',
|
|
182
|
+
devicePushToken.data,
|
|
197
183
|
);
|
|
198
184
|
setDeviceToken(devicePushToken.data);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
185
|
+
});
|
|
186
|
+
const subscription = expoNotificationsLib.addPushTokenListener(
|
|
187
|
+
(devicePushToken) => {
|
|
188
|
+
logger(
|
|
189
|
+
'debug',
|
|
190
|
+
'Got device token - expoNotificationsLib.addPushTokenListener',
|
|
191
|
+
devicePushToken.data,
|
|
192
|
+
);
|
|
193
|
+
setDeviceToken(devicePushToken.data);
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
setUnsubscribeListener(() => {
|
|
197
|
+
logger('debug', `removed expo addPushTokenListener`);
|
|
198
|
+
subscription.remove();
|
|
199
|
+
});
|
|
200
|
+
}
|
|
205
201
|
} else {
|
|
206
202
|
const pushNotificationIosLib = getPushNotificationIosLib();
|
|
207
203
|
pushNotificationIosLib.addEventListener('register', (token) => {
|
|
208
204
|
logger(
|
|
209
205
|
'debug',
|
|
210
206
|
`Got device token - pushNotificationIosLib.addEventListener('register')`,
|
|
211
|
-
token
|
|
207
|
+
token,
|
|
212
208
|
);
|
|
213
209
|
setDeviceToken(token);
|
|
214
210
|
});
|
|
@@ -218,125 +214,3 @@ export async function initIosNonVoipToken(
|
|
|
218
214
|
});
|
|
219
215
|
}
|
|
220
216
|
}
|
|
221
|
-
|
|
222
|
-
export const onVoipNotificationReceived = async (notification: any) => {
|
|
223
|
-
/* --- Example payload ---
|
|
224
|
-
{
|
|
225
|
-
"aps": {
|
|
226
|
-
"alert": {
|
|
227
|
-
"body": "",
|
|
228
|
-
"title": "Vishal Narkhede is calling you"
|
|
229
|
-
},
|
|
230
|
-
"badge": 0,
|
|
231
|
-
"category": "stream.video",
|
|
232
|
-
"mutable-content": 1
|
|
233
|
-
},
|
|
234
|
-
"stream": {
|
|
235
|
-
"call_cid": "default:ixbm7y0k74pbjnq",
|
|
236
|
-
"call_display_name": "",
|
|
237
|
-
"created_by_display_name": "Vishal Narkhede",
|
|
238
|
-
"created_by_id": "vishalexpo",
|
|
239
|
-
"receiver_id": "santhoshexpo",
|
|
240
|
-
"sender": "stream.video",
|
|
241
|
-
"type": "call.ring",
|
|
242
|
-
"version": "v2"
|
|
243
|
-
}
|
|
244
|
-
} */
|
|
245
|
-
const sender = notification?.stream?.sender;
|
|
246
|
-
const type = notification?.stream?.type;
|
|
247
|
-
// do not process any other notifications other than stream.video or ringing
|
|
248
|
-
if (sender !== 'stream.video' && type !== 'call.ring') {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const call_cid = notification?.stream?.call_cid;
|
|
252
|
-
const pushConfig = StreamVideoRN.getConfig().push;
|
|
253
|
-
if (!call_cid || Platform.OS !== 'ios' || !pushConfig) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
const logger = getLogger(['setupIosVoipPushEvents']);
|
|
257
|
-
const client = await pushConfig.createStreamVideoClient();
|
|
258
|
-
if (!client) {
|
|
259
|
-
logger(
|
|
260
|
-
'debug',
|
|
261
|
-
'client not found, not processing call.ring voip push notification'
|
|
262
|
-
);
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
const callFromPush = await client.onRingingCall(call_cid);
|
|
266
|
-
let uuid = '';
|
|
267
|
-
try {
|
|
268
|
-
uuid =
|
|
269
|
-
await NativeModules?.StreamVideoReactNative?.getIncomingCallUUid(
|
|
270
|
-
call_cid
|
|
271
|
-
);
|
|
272
|
-
} catch (error) {
|
|
273
|
-
logger('error', 'Error in getting call uuid from native module', error);
|
|
274
|
-
}
|
|
275
|
-
if (!uuid) {
|
|
276
|
-
logger(
|
|
277
|
-
'error',
|
|
278
|
-
`Not processing call.ring push notification, as no uuid found for call_cid: ${call_cid}`
|
|
279
|
-
);
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
const created_by_id = notification?.stream?.created_by_id;
|
|
283
|
-
const receiver_id = notification?.stream?.receiver_id;
|
|
284
|
-
function closeCallIfNecessary() {
|
|
285
|
-
const { mustEndCall, callkeepReason } = shouldCallBeEnded(
|
|
286
|
-
callFromPush,
|
|
287
|
-
created_by_id,
|
|
288
|
-
receiver_id
|
|
289
|
-
);
|
|
290
|
-
if (mustEndCall) {
|
|
291
|
-
const callkeep = getCallKeepLib();
|
|
292
|
-
logger(
|
|
293
|
-
'debug',
|
|
294
|
-
`callkeep.reportEndCallWithUUID for uuid: ${uuid}, call_cid: ${call_cid}, reason: ${callkeepReason}`
|
|
295
|
-
);
|
|
296
|
-
callkeep.reportEndCallWithUUID(uuid, callkeepReason);
|
|
297
|
-
const voipPushNotification = getVoipPushNotificationLib();
|
|
298
|
-
voipPushNotification.onVoipNotificationCompleted(uuid);
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
301
|
-
return false;
|
|
302
|
-
}
|
|
303
|
-
const closed = closeCallIfNecessary();
|
|
304
|
-
const canListenToWS = () =>
|
|
305
|
-
canAddPushWSSubscriptionsRef.current && AppState.currentState !== 'active';
|
|
306
|
-
if (!closed && canListenToWS()) {
|
|
307
|
-
const unsubscribe = callFromPush.on('all', (event) => {
|
|
308
|
-
const _canListenToWS = canListenToWS();
|
|
309
|
-
if (!_canListenToWS) {
|
|
310
|
-
logger(
|
|
311
|
-
'debug',
|
|
312
|
-
`unsubscribe due to event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`,
|
|
313
|
-
event
|
|
314
|
-
);
|
|
315
|
-
unsubscribe();
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
const _closed = closeCallIfNecessary();
|
|
319
|
-
if (_closed) {
|
|
320
|
-
logger(
|
|
321
|
-
'debug',
|
|
322
|
-
`unsubscribe due to event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed: ${_closed}`,
|
|
323
|
-
event
|
|
324
|
-
);
|
|
325
|
-
unsubscribe();
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
const unsubscriptionCallbacks =
|
|
329
|
-
RxUtils.getCurrentValue(pushUnsubscriptionCallbacks$) ?? [];
|
|
330
|
-
pushUnsubscriptionCallbacks$.next([
|
|
331
|
-
...unsubscriptionCallbacks,
|
|
332
|
-
unsubscribe,
|
|
333
|
-
]);
|
|
334
|
-
}
|
|
335
|
-
// send the info to this subject, it is listened by callkeep events
|
|
336
|
-
// callkeep events will then accept/reject the call
|
|
337
|
-
logger(
|
|
338
|
-
'debug',
|
|
339
|
-
`call_cid:${call_cid} uuid:${uuid} received and processed from call.ring push notification`
|
|
340
|
-
);
|
|
341
|
-
voipPushNotificationCallCId$.next(call_cid);
|
|
342
|
-
};
|
|
@@ -4,12 +4,12 @@ let callkeep: RNCallKeepType | undefined;
|
|
|
4
4
|
|
|
5
5
|
try {
|
|
6
6
|
callkeep = require('react-native-callkeep').default;
|
|
7
|
-
} catch
|
|
7
|
+
} catch {}
|
|
8
8
|
|
|
9
9
|
export function getCallKeepLib() {
|
|
10
10
|
if (!callkeep) {
|
|
11
11
|
throw Error(
|
|
12
|
-
'react-native-callkeep library is not installed. Please see https://github.com/react-native-webrtc/react-native-callkeep#Installation for installation instructions'
|
|
12
|
+
'react-native-callkeep library is not installed. Please see https://github.com/react-native-webrtc/react-native-callkeep#Installation for installation instructions',
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
return callkeep;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export type ExpoNotificationsLib = typeof import('expo-notifications');
|
|
2
|
-
|
|
3
1
|
import { getLogger } from '@stream-io/video-client';
|
|
4
2
|
import type { Notification } from 'expo-notifications';
|
|
5
3
|
|
|
4
|
+
export type ExpoNotificationsLib = typeof import('expo-notifications');
|
|
5
|
+
|
|
6
6
|
export type ExpoNotification = Notification;
|
|
7
7
|
|
|
8
8
|
let expoNotificationsLib: ExpoNotificationsLib | undefined;
|
|
9
9
|
|
|
10
10
|
try {
|
|
11
11
|
expoNotificationsLib = require('expo-notifications');
|
|
12
|
-
} catch
|
|
12
|
+
} catch {}
|
|
13
13
|
|
|
14
14
|
export function getExpoNotificationsLib() {
|
|
15
15
|
if (!expoNotificationsLib) {
|
|
16
16
|
throw Error(
|
|
17
|
-
'expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions. It is required for non ringing push notifications.'
|
|
17
|
+
'expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions. It is required for non ringing push notifications.',
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
return expoNotificationsLib;
|
|
@@ -24,7 +24,7 @@ export function getExpoNotificationsLibNoThrow() {
|
|
|
24
24
|
if (!expoNotificationsLib) {
|
|
25
25
|
getLogger(['getExpoNotificationsLibNoThrow'])(
|
|
26
26
|
'debug',
|
|
27
|
-
'expo-notifications library is not installed. It is required for non ringing push notifications and not for ringing'
|
|
27
|
+
'expo-notifications library is not installed. It is required for non ringing push notifications and not for ringing',
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
return expoNotificationsLib;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLogger } from '@stream-io/video-client';
|
|
2
|
-
import { type Type
|
|
2
|
+
import { lib, type Type } from './lib';
|
|
3
3
|
|
|
4
4
|
export type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
|
|
5
5
|
export type FirebaseMessagingType = Type;
|
|
@@ -11,7 +11,7 @@ export function getFirebaseMessagingLib() {
|
|
|
11
11
|
if (!lib) {
|
|
12
12
|
throw Error(
|
|
13
13
|
'@react-native-firebase/messaging is not installed. ' +
|
|
14
|
-
INSTALLATION_INSTRUCTION
|
|
14
|
+
INSTALLATION_INSTRUCTION,
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
return lib;
|
|
@@ -26,7 +26,7 @@ export function getFirebaseMessagingLibNoThrow(isExpo: boolean) {
|
|
|
26
26
|
isExpo
|
|
27
27
|
? 'In Expo, @react-native-firebase/messaging library is required to receive ringing notifications in app killed state for Android.'
|
|
28
28
|
: ''
|
|
29
|
-
}${INSTALLATION_INSTRUCTION}
|
|
29
|
+
}${INSTALLATION_INSTRUCTION}`,
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
return lib;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import type { PushNotification } from '@react-native-community/push-notification-ios';
|
|
2
|
+
|
|
1
3
|
export type PushNotificationIosLib =
|
|
2
4
|
typeof import('@react-native-community/push-notification-ios').default;
|
|
3
5
|
|
|
4
6
|
let pushNotificationIosLib: PushNotificationIosLib | undefined;
|
|
5
7
|
|
|
6
|
-
import type { PushNotification } from '@react-native-community/push-notification-ios';
|
|
7
|
-
|
|
8
8
|
export type PushNotificationiOSType = PushNotification;
|
|
9
9
|
|
|
10
10
|
try {
|
|
11
11
|
pushNotificationIosLib =
|
|
12
12
|
require('@react-native-community/push-notification-ios').default;
|
|
13
|
-
} catch
|
|
13
|
+
} catch {}
|
|
14
14
|
|
|
15
15
|
export function getPushNotificationIosLib() {
|
|
16
16
|
if (!pushNotificationIosLib) {
|
|
17
17
|
throw Error(
|
|
18
|
-
'@react-native-community/push-notification-ios library is not installed. Please install it using "yarn add @react-native-community/push-notification-ios" or "npm i @react-native-community/push-notification-ios --save"'
|
|
18
|
+
'@react-native-community/push-notification-ios library is not installed. Please install it using "yarn add @react-native-community/push-notification-ios" or "npm i @react-native-community/push-notification-ios --save"',
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
return pushNotificationIosLib;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLogger } from '@stream-io/video-client';
|
|
2
2
|
import { PermissionsAndroid } from 'react-native';
|
|
3
|
-
import { type Type
|
|
3
|
+
import { lib, type Type } from './lib';
|
|
4
4
|
|
|
5
5
|
export type NotifeeLib = Type;
|
|
6
6
|
|
|
@@ -29,7 +29,7 @@ export function getNotifeeLibThrowIfNotInstalledForPush() {
|
|
|
29
29
|
if (!lib) {
|
|
30
30
|
throw Error(
|
|
31
31
|
'@notifee/react-native is not installed. It is required for implementing push notifications. ' +
|
|
32
|
-
INSTALLATION_INSTRUCTION
|
|
32
|
+
INSTALLATION_INSTRUCTION,
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
return lib;
|
|
@@ -40,7 +40,7 @@ export function getNotifeeLibNoThrowForKeepCallAlive() {
|
|
|
40
40
|
const logger = getLogger(['getNotifeeLibNoThrow']);
|
|
41
41
|
logger(
|
|
42
42
|
'info',
|
|
43
|
-
`${'@notifee/react-native library not installed. It is required to keep call alive in the background for Android. '}${INSTALLATION_INSTRUCTION}
|
|
43
|
+
`${'@notifee/react-native library not installed. It is required to keep call alive in the background for Android. '}${INSTALLATION_INSTRUCTION}`,
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
return lib;
|
|
@@ -49,23 +49,23 @@ export function getNotifeeLibNoThrowForKeepCallAlive() {
|
|
|
49
49
|
export async function getKeepCallAliveForegroundServiceTypes() {
|
|
50
50
|
const types: AndroidForegroundServiceType[] = [];
|
|
51
51
|
const hasCameraPermission = await PermissionsAndroid.check(
|
|
52
|
-
PermissionsAndroid.PERMISSIONS.CAMERA
|
|
52
|
+
PermissionsAndroid.PERMISSIONS.CAMERA!,
|
|
53
53
|
);
|
|
54
54
|
if (hasCameraPermission) {
|
|
55
55
|
types.push(AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_CAMERA);
|
|
56
56
|
}
|
|
57
57
|
const hasMicrophonePermission = await PermissionsAndroid.check(
|
|
58
|
-
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO
|
|
58
|
+
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO!,
|
|
59
59
|
);
|
|
60
60
|
if (hasMicrophonePermission) {
|
|
61
61
|
types.push(AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_MICROPHONE);
|
|
62
62
|
}
|
|
63
63
|
const hasConnectionPermission = await PermissionsAndroid.check(
|
|
64
|
-
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT
|
|
64
|
+
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT!,
|
|
65
65
|
);
|
|
66
66
|
if (hasConnectionPermission) {
|
|
67
67
|
types.push(
|
|
68
|
-
AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE
|
|
68
|
+
AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE,
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
if (types.length === 0) {
|
|
@@ -5,12 +5,12 @@ let voipPushNotification: VoipPushNotificationType | undefined;
|
|
|
5
5
|
|
|
6
6
|
try {
|
|
7
7
|
voipPushNotification = require('react-native-voip-push-notification').default;
|
|
8
|
-
} catch
|
|
8
|
+
} catch {}
|
|
9
9
|
|
|
10
10
|
export function getVoipPushNotificationLib() {
|
|
11
11
|
if (!voipPushNotification) {
|
|
12
12
|
throw Error(
|
|
13
|
-
"react-native-voip-push-notification library is not installed. Please install it using 'yarn add react-native-voip-push-notification' or 'npm i react-native-voip-push-notification --save'"
|
|
13
|
+
"react-native-voip-push-notification library is not installed. Please install it using 'yarn add react-native-voip-push-notification' or 'npm i react-native-voip-push-notification --save'",
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
return voipPushNotification;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
pushAcceptedIncomingCallCId$,
|
|
3
|
+
voipCallkeepAcceptedCallOnNativeDialerMap$,
|
|
2
4
|
voipCallkeepCallOnForegroundMap$,
|
|
3
5
|
voipPushNotificationCallCId$,
|
|
4
6
|
} from './internal/rxSubjects';
|
|
@@ -9,10 +11,6 @@ import {
|
|
|
9
11
|
clearPushWSEventSubscriptions,
|
|
10
12
|
processCallFromPushInBackground,
|
|
11
13
|
} from './internal/utils';
|
|
12
|
-
import {
|
|
13
|
-
pushAcceptedIncomingCallCId$,
|
|
14
|
-
voipCallkeepAcceptedCallOnNativeDialerMap$,
|
|
15
|
-
} from './internal/rxSubjects';
|
|
16
14
|
import { AppState, NativeModules, Platform } from 'react-native';
|
|
17
15
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
18
16
|
|
|
@@ -22,7 +20,7 @@ type PushConfig = NonNullable<StreamVideoConfig['push']>;
|
|
|
22
20
|
* This hook is used to listen to callkeep events and do the necessary actions
|
|
23
21
|
*/
|
|
24
22
|
export function setupIosCallKeepEvents(
|
|
25
|
-
pushConfig: NonNullable<StreamVideoConfig['push']
|
|
23
|
+
pushConfig: NonNullable<StreamVideoConfig['push']>,
|
|
26
24
|
) {
|
|
27
25
|
if (Platform.OS !== 'ios' || !pushConfig.ios.pushProviderName) {
|
|
28
26
|
return;
|
|
@@ -31,7 +29,7 @@ export function setupIosCallKeepEvents(
|
|
|
31
29
|
// TODO: remove this check and find a better way once we have telecom integration for android
|
|
32
30
|
getLogger(['setupIosCallKeepEvents'])(
|
|
33
31
|
'debug',
|
|
34
|
-
'android incomingCallChannel is not defined, so skipping the setupIosCallKeepEvents'
|
|
32
|
+
'android incomingCallChannel is not defined, so skipping the setupIosCallKeepEvents',
|
|
35
33
|
);
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
@@ -45,13 +43,14 @@ export function setupIosCallKeepEvents(
|
|
|
45
43
|
try {
|
|
46
44
|
call_cid =
|
|
47
45
|
await NativeModules?.StreamVideoReactNative?.getIncomingCallCid(
|
|
48
|
-
callUUID
|
|
46
|
+
callUUID,
|
|
49
47
|
);
|
|
50
48
|
voipPushNotificationCallCId$.next(call_cid);
|
|
51
49
|
} catch (error) {
|
|
52
50
|
logger(
|
|
53
51
|
'debug',
|
|
54
|
-
'Error in getting call cid from native module - probably the call was already processed, so ignoring this callkeep event'
|
|
52
|
+
'Error in getting call cid from native module - probably the call was already processed, so ignoring this callkeep event',
|
|
53
|
+
error,
|
|
55
54
|
);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
@@ -74,18 +73,18 @@ export function setupIosCallKeepEvents(
|
|
|
74
73
|
|
|
75
74
|
function didDisplayIncomingCall(callUUID: string, payload: object) {
|
|
76
75
|
const voipPushNotification = getVoipPushNotificationLib();
|
|
77
|
-
// @ts-expect-error
|
|
76
|
+
// @ts-expect-error - call_cid is not part of RNCallKeepEventPayload
|
|
78
77
|
const call_cid = payload?.call_cid as string | undefined;
|
|
79
78
|
logger(
|
|
80
79
|
'debug',
|
|
81
|
-
`didDisplayIncomingCall event with callUUID: ${callUUID} call_cid: ${call_cid}
|
|
80
|
+
`didDisplayIncomingCall event with callUUID: ${callUUID} call_cid: ${call_cid}`,
|
|
82
81
|
);
|
|
83
82
|
if (call_cid) {
|
|
84
83
|
if (AppState.currentState === 'background') {
|
|
85
84
|
processCallFromPushInBackground(
|
|
86
85
|
pushConfig!,
|
|
87
86
|
call_cid,
|
|
88
|
-
'backgroundDelivered'
|
|
87
|
+
'backgroundDelivered',
|
|
89
88
|
);
|
|
90
89
|
}
|
|
91
90
|
voipCallkeepCallOnForegroundMap$.next({
|
|
@@ -100,20 +99,20 @@ export function setupIosCallKeepEvents(
|
|
|
100
99
|
'answerCall',
|
|
101
100
|
({ callUUID }) => {
|
|
102
101
|
answerCall(callUUID);
|
|
103
|
-
}
|
|
102
|
+
},
|
|
104
103
|
);
|
|
105
104
|
const { remove: removeEndCall } = callkeep.addEventListener(
|
|
106
105
|
'endCall',
|
|
107
106
|
({ callUUID }) => {
|
|
108
107
|
endCall(callUUID);
|
|
109
|
-
}
|
|
108
|
+
},
|
|
110
109
|
);
|
|
111
110
|
|
|
112
111
|
const { remove: removeDisplayIncomingCall } = callkeep.addEventListener(
|
|
113
112
|
'didDisplayIncomingCall',
|
|
114
113
|
({ callUUID, payload }) => {
|
|
115
114
|
didDisplayIncomingCall(callUUID, payload);
|
|
116
|
-
}
|
|
115
|
+
},
|
|
117
116
|
);
|
|
118
117
|
|
|
119
118
|
const { remove: removeDidLoadWithEvents } = callkeep.addEventListener(
|
|
@@ -133,7 +132,7 @@ export function setupIosCallKeepEvents(
|
|
|
133
132
|
endCall(data.callUUID);
|
|
134
133
|
}
|
|
135
134
|
});
|
|
136
|
-
}
|
|
135
|
+
},
|
|
137
136
|
);
|
|
138
137
|
|
|
139
138
|
setPushLogoutCallback(async () => {
|
|
@@ -146,7 +145,7 @@ export function setupIosCallKeepEvents(
|
|
|
146
145
|
|
|
147
146
|
const iosCallkeepAcceptCall = (
|
|
148
147
|
call_cid: string | undefined,
|
|
149
|
-
callUUIDFromCallkeep: string
|
|
148
|
+
callUUIDFromCallkeep: string,
|
|
150
149
|
) => {
|
|
151
150
|
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
152
151
|
return;
|
|
@@ -166,7 +165,7 @@ const iosCallkeepAcceptCall = (
|
|
|
166
165
|
const iosCallkeepRejectCall = async (
|
|
167
166
|
call_cid: string | undefined,
|
|
168
167
|
callUUIDFromCallkeep: string,
|
|
169
|
-
pushConfig: PushConfig
|
|
168
|
+
pushConfig: PushConfig,
|
|
170
169
|
) => {
|
|
171
170
|
if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
|
|
172
171
|
return;
|
|
@@ -186,7 +185,7 @@ const iosCallkeepRejectCall = async (
|
|
|
186
185
|
*/
|
|
187
186
|
const shouldProcessCallFromCallkeep = (
|
|
188
187
|
call_cid: string | undefined,
|
|
189
|
-
callUUIDFromCallkeep: string
|
|
188
|
+
callUUIDFromCallkeep: string,
|
|
190
189
|
): call_cid is string => {
|
|
191
190
|
if (!call_cid || !callUUIDFromCallkeep) {
|
|
192
191
|
return false;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getVoipPushNotificationLib } from './libs';
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
|
-
import { onVoipNotificationReceived } from '
|
|
4
|
+
import { onVoipNotificationReceived } from './internal/ios';
|
|
5
5
|
import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
|
|
6
6
|
import { getLogger } from '@stream-io/video-client';
|
|
7
7
|
import { StreamVideoConfig } from '../StreamVideoRN/types';
|
|
8
8
|
|
|
9
9
|
export function setupIosVoipPushEvents(
|
|
10
|
-
pushConfig: NonNullable<StreamVideoConfig['push']
|
|
10
|
+
pushConfig: NonNullable<StreamVideoConfig['push']>,
|
|
11
11
|
) {
|
|
12
12
|
if (Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
|
|
13
13
|
return;
|
|
@@ -17,7 +17,7 @@ export function setupIosVoipPushEvents(
|
|
|
17
17
|
// TODO: remove this check and find a better way once we have telecom integration for android
|
|
18
18
|
logger(
|
|
19
19
|
'debug',
|
|
20
|
-
'android incomingCallChannel is not defined, so skipping the setupIosVoipPushEvents'
|
|
20
|
+
'android incomingCallChannel is not defined, so skipping the setupIosVoipPushEvents',
|
|
21
21
|
);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
@@ -25,12 +25,12 @@ export function setupIosVoipPushEvents(
|
|
|
25
25
|
|
|
26
26
|
logger('debug', 'notification event listener added');
|
|
27
27
|
voipPushNotification.addEventListener('notification', (notification) => {
|
|
28
|
-
onVoipNotificationReceived(notification);
|
|
28
|
+
onVoipNotificationReceived(notification, pushConfig);
|
|
29
29
|
});
|
|
30
30
|
setPushLogoutCallback(async () => {
|
|
31
31
|
getLogger(['setPushLogoutCallback'])(
|
|
32
32
|
'debug',
|
|
33
|
-
'notification event listener removed'
|
|
33
|
+
'notification event listener removed',
|
|
34
34
|
);
|
|
35
35
|
voipPushNotification.removeEventListener('notification');
|
|
36
36
|
});
|