diff --git a/README.md b/README.md index 4ed9d79766..aae1b8561b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native) [![Build Status](https://github.com/GetStream/stream-chat-react-native/actions/workflows/release.yml/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions) [![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative) -![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-289%20KB-blue) +![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-290%20KB-blue) diff --git a/examples/ExpoMessaging/app.json b/examples/ExpoMessaging/app.json index 09ecbee0cf..5b3393b136 100644 --- a/examples/ExpoMessaging/app.json +++ b/examples/ExpoMessaging/app.json @@ -21,7 +21,10 @@ "usesIcloudStorage": true, "bundleIdentifier": "io.getstream.iOS.expomessagingapp", "appleTeamId": "EHV7XZLAHA", - "googleServicesFile": "./firebase/GoogleService-Info.plist" + "googleServicesFile": "./firebase/GoogleService-Info.plist", + "entitlements": { + "aps-environment": "development" + } }, "android": { "config": { diff --git a/examples/ExpoMessaging/package.json b/examples/ExpoMessaging/package.json index bc355f0fe7..81c89fa72e 100644 --- a/examples/ExpoMessaging/package.json +++ b/examples/ExpoMessaging/package.json @@ -19,19 +19,19 @@ "@react-navigation/elements": "^2.6.4", "@react-navigation/native": "^7.1.8", "@shopify/flash-list": "2.0.2", - "expo": "^54.0.0", + "expo": "54.0.13", "expo-audio": "~1.0.13", "expo-build-properties": "~1.0.9", "expo-clipboard": "~8.0.7", "expo-constants": "~18.0.9", "expo-document-picker": "~14.0.7", - "expo-file-system": "~19.0.16", + "expo-file-system": "~19.0.17", "expo-haptics": "~15.0.7", "expo-image-manipulator": "~14.0.7", "expo-image-picker": "~17.0.8", "expo-linking": "~8.0.8", "expo-location": "~19.0.7", - "expo-router": "~6.0.10", + "expo-router": "~6.0.12", "expo-sharing": "~14.0.7", "expo-splash-screen": "~31.0.10", "expo-status-bar": "~3.0.8", diff --git a/examples/ExpoMessaging/yarn.lock b/examples/ExpoMessaging/yarn.lock index e9c8f552bd..714a1e5430 100644 --- a/examples/ExpoMessaging/yarn.lock +++ b/examples/ExpoMessaging/yarn.lock @@ -785,10 +785,10 @@ dependencies: "@types/hammerjs" "^2.0.36" -"@expo/cli@54.0.10": - version "54.0.10" - resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-54.0.10.tgz#57507e5fd4b978f40321dba19ea75ebb421e695b" - integrity sha512-iw9gAnN6+PKWWLIyYmiskY/wzZjuFMctunqGXuC8BGATWgtr/HpzjVqWbcL3KIX/GvEBCCh74Tkckrh+Ylxh5Q== +"@expo/cli@54.0.11": + version "54.0.11" + resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-54.0.11.tgz#a86b6c01ab76620d25a0a7e0574ab43403b91253" + integrity sha512-ik9p8+JTOuVXS462+vFPV0qnWRBXIR1bPmoVKO8xQWw6Yk+K6UlU2GrM2ch7kA3JlSJE/MGsNyN8CB0zFZbVbQ== dependencies: "@0no-co/graphql.web" "^1.0.8" "@expo/code-signing-certificates" "^0.0.5" @@ -804,7 +804,7 @@ "@expo/osascript" "^2.3.7" "@expo/package-manager" "^1.9.8" "@expo/plist" "^0.4.7" - "@expo/prebuild-config" "^54.0.4" + "@expo/prebuild-config" "^54.0.5" "@expo/schema-utils" "^0.1.7" "@expo/spawn-async" "^1.7.2" "@expo/ws-tunnel" "^1.0.1" @@ -823,7 +823,7 @@ connect "^3.7.0" debug "^4.3.4" env-editor "^0.4.1" - expo-server "^1.0.0" + expo-server "^1.0.1" freeport-async "^2.0.0" getenv "^2.0.0" glob "^10.4.2" @@ -1068,7 +1068,7 @@ base64-js "^1.2.3" xmlbuilder "^15.1.1" -"@expo/prebuild-config@^54.0.3", "@expo/prebuild-config@^54.0.4": +"@expo/prebuild-config@^54.0.3": version "54.0.4" resolved "https://registry.yarnpkg.com/@expo/prebuild-config/-/prebuild-config-54.0.4.tgz#0f0fcc8b6602f9b78d5c966f0db198fa4f882dc2" integrity sha512-X+oTbmclWf2kfWIEkjagOzPZNg2SkiWW+JoRX6CWxKpDTQKfsi/bf22Ymv5Zxe1Q/aGjOuFL5useStm3iNi+PA== @@ -1084,6 +1084,22 @@ semver "^7.6.0" xml2js "0.6.0" +"@expo/prebuild-config@^54.0.5": + version "54.0.5" + resolved "https://registry.yarnpkg.com/@expo/prebuild-config/-/prebuild-config-54.0.5.tgz#81bf7e2b8641da38cade6bb7341f0d384d9bc8f4" + integrity sha512-eCvbVUf01j1nSrs4mG/rWwY+SfgE30LM6JcElLrnNgNnaDWzt09E/c8n3ZeTLNKENwJaQQ1KIn2VE461/4VnWQ== + dependencies: + "@expo/config" "~12.0.10" + "@expo/config-plugins" "~54.0.2" + "@expo/config-types" "^54.0.8" + "@expo/image-utils" "^0.8.7" + "@expo/json-file" "^10.0.7" + "@react-native/normalize-colors" "0.81.4" + debug "^4.3.1" + resolve-from "^5.0.0" + semver "^7.6.0" + xml2js "0.6.0" + "@expo/schema-utils@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@expo/schema-utils/-/schema-utils-0.1.7.tgz#38baa0effa0823cd4eca3f05e5eee3bde311da12" @@ -3433,15 +3449,15 @@ expo-document-picker@~14.0.7: resolved "https://registry.yarnpkg.com/expo-document-picker/-/expo-document-picker-14.0.7.tgz#d8c4d4874509e96f3e26fa66ad9ab2d2ae6706db" integrity sha512-81Jh8RDD0GYBUoSTmIBq30hXXjmkDV1ZY2BNIp1+3HR5PDSh2WmdhD/Ezz5YFsv46hIXHsQc+Kh1q8vn6OLT9Q== -expo-file-system@~19.0.16: - version "19.0.16" - resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-19.0.16.tgz#86010578b19d6c0b688d30c3dfee12b553c5ca3d" - integrity sha512-9Ee6HpcUEfO7dOet/on9yAg7ysegBua35Q0oGrJzoRc+xW6IlTxoSFbmK8QhjA3MZpkukP3DhaiYENYOzkw9SQ== +expo-file-system@~19.0.17: + version "19.0.17" + resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-19.0.17.tgz#2555c05c26a19038d005f281b11dbda9722d0c0d" + integrity sha512-WwaS01SUFrxBnExn87pg0sCTJjZpf2KAOzfImG0o8yhkU7fbYpihpl/oocXBEsNbj58a8hVt1Y4CVV5c1tzu/g== -expo-font@~14.0.8: - version "14.0.8" - resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-14.0.8.tgz#3971507cedaa8da7f0ac21f4c4c4d2b62ca754cc" - integrity sha512-bTUHaJWRZ7ywP8dg3f+wfOwv6RwMV3mWT2CDUIhsK70GjNGlCtiWOCoHsA5Od/esPaVxqc37cCBvQGQRFStRlA== +expo-font@~14.0.9: + version "14.0.9" + resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-14.0.9.tgz#552d66afc8c6efa8839f5f4063c2e0226b3edad1" + integrity sha512-xCoQbR/36qqB6tew/LQ6GWICpaBmHLhg/Loix5Rku/0ZtNaXMJv08M9o1AcrdiGTn/Xf/BnLu6DgS45cWQEHZg== dependencies: fontfaceobserver "^2.1.0" @@ -3487,10 +3503,10 @@ expo-location@~19.0.7: resolved "https://registry.yarnpkg.com/expo-location/-/expo-location-19.0.7.tgz#58ab5b9b59db3a26d0495c19e719d5f559948b1c" integrity sha512-YNkh4r9E6ECbPkBCAMG5A5yHDgS0pw+Rzyd0l2ZQlCtjkhlODB55nMCKr5CZnUI0mXTkaSm8CwfoCO8n2MpYfg== -expo-modules-autolinking@3.0.14: - version "3.0.14" - resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-3.0.14.tgz#c853842708c8b749f8565fb5c7e6365af71c2ec2" - integrity sha512-/qh1ru2kGPOycGvE9dXEKJZbPmYA5U5UcAlWWFbcq9+VhhWdZWZ0zs7V2JCdl+OvpBDo1y9WbqPP5VHQSYqT+Q== +expo-modules-autolinking@3.0.15: + version "3.0.15" + resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-3.0.15.tgz#15e8483a30733d18f0709a64d282a03610c418a7" + integrity sha512-B6c+x664ImrWd+PknEy5454gtY6P0cMxj4P50fvLYP4HimbYj9SzwoHqZ/Rxh9NwxnUkT2nappk/USYIcPoS/A== dependencies: "@expo/spawn-async" "^1.7.2" chalk "^4.1.0" @@ -3499,17 +3515,17 @@ expo-modules-autolinking@3.0.14: require-from-string "^2.0.2" resolve-from "^5.0.0" -expo-modules-core@3.0.20: - version "3.0.20" - resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-3.0.20.tgz#5a1afe7d3afa5968227f0e8fd3859b8580f4df98" - integrity sha512-AnC7VG8k8ZAAKoNFP5zyCiTlwppp6U3A/z63KtuSjMWlxn5w45FOf2LuyF1SNUqkiARdckuPVNvLGO/I/5vkrg== +expo-modules-core@3.0.21: + version "3.0.21" + resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-3.0.21.tgz#26438c901e26184a40fe8f0d73a64f66a39c59b2" + integrity sha512-KJRzm0FEt/lfPNG+C6UUq+ta9PO10QPwY1HGCNkzPiRCIMJmQP4xRYK4Z7AxiYEYsPqr5OdjRW55kGZ4c5pzgA== dependencies: invariant "^2.2.4" -expo-router@~6.0.10: - version "6.0.10" - resolved "https://registry.yarnpkg.com/expo-router/-/expo-router-6.0.10.tgz#414b6ecce389c35073600cde9eb7bc88c8be53b1" - integrity sha512-QdMvNgjpH5L1ndE2KcYk14CjfulQTZNJNjM24/NigF+2cwkE7Ixdkw2EdpslcXPCgwcoJmvJIJtySsGhoPTNdg== +expo-router@~6.0.12: + version "6.0.12" + resolved "https://registry.yarnpkg.com/expo-router/-/expo-router-6.0.12.tgz#ec2ea4d8d35bd5cb6d005db44805680325fa6d09" + integrity sha512-GBfMHAbHoPv7aCfHOEgFNxcadw4euPyI/SqHNNtw+Sm+JtvauHP34wi7Bg25JxatHQ8EdhxAj6w0D8D6QRnayg== dependencies: "@expo/metro-runtime" "^6.1.2" "@expo/schema-utils" "^0.1.7" @@ -3521,7 +3537,7 @@ expo-router@~6.0.10: client-only "^0.0.1" debug "^4.3.4" escape-string-regexp "^4.0.0" - expo-server "^1.0.0" + expo-server "^1.0.1" fast-deep-equal "^3.1.3" invariant "^2.2.4" nanoid "^3.3.8" @@ -3535,10 +3551,10 @@ expo-router@~6.0.10: use-latest-callback "^0.2.1" vaul "^1.1.2" -expo-server@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/expo-server/-/expo-server-1.0.0.tgz#b505dbb96b8da269a938c25790691b433ae4a3d9" - integrity sha512-fAAI0ZXxayc2Rt5KfQjULv+TFreuLRZ+hdpc5TxZJ7CDpW1ZIqaVzELHh1rYTRVEBDFDiCBXtioS9WWTEAX+fg== +expo-server@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/expo-server/-/expo-server-1.0.1.tgz#9e04605310be090896a85aadce2cb7eaf6aae9b7" + integrity sha512-J3JlpzNXOkkr4BbapTrcv6klBQcw6NzrBBVIU7qkNE2eU3U1on9rp27wi0+cihjG/QgxSIqQVkrga5z3HWnH0A== expo-sharing@~14.0.7: version "14.0.7" @@ -3564,13 +3580,13 @@ expo-video@~3.0.11: resolved "https://registry.yarnpkg.com/expo-video/-/expo-video-3.0.11.tgz#9ba2c4da694fe3d54f191f160702ddc70412e782" integrity sha512-k/xz8Ml/LekuD2U2LomML2mUISvkHzYDz3fXY8Au1fEaYVNTfTs7Gyfo1lvF6S1X7u3XutoAfew8e8e1ZUR2fg== -expo@^54.0.0: - version "54.0.12" - resolved "https://registry.yarnpkg.com/expo/-/expo-54.0.12.tgz#f64223fe8f83870cc4bd589674a95724c3161ef0" - integrity sha512-BVvG1A9BlKAOBwczMi7XThOLzI3TUShkV/yRnAMGvQP5SQFDq7UojkZLLG285gg3OvkoqjMUE0tZvVXbvuI4tA== +expo@54.0.13: + version "54.0.13" + resolved "https://registry.yarnpkg.com/expo/-/expo-54.0.13.tgz#e81897f3517487e4423d21eff7507d9d0c40e2f2" + integrity sha512-F1puKXzw8ESnsbvaKdXtcIiyYLQ2kUHqP8LuhgtJS1wm6w55VhtOPg8yl/0i8kPbTA0YfD+KYdXjSfhPXgUPxw== dependencies: "@babel/runtime" "^7.20.0" - "@expo/cli" "54.0.10" + "@expo/cli" "54.0.11" "@expo/config" "~12.0.10" "@expo/config-plugins" "~54.0.2" "@expo/devtools" "0.1.7" @@ -3582,11 +3598,11 @@ expo@^54.0.0: babel-preset-expo "~54.0.3" expo-asset "~12.0.9" expo-constants "~18.0.9" - expo-file-system "~19.0.16" - expo-font "~14.0.8" + expo-file-system "~19.0.17" + expo-font "~14.0.9" expo-keep-awake "~15.0.7" - expo-modules-autolinking "3.0.14" - expo-modules-core "3.0.20" + expo-modules-autolinking "3.0.15" + expo-modules-core "3.0.21" pretty-format "^29.7.0" react-refresh "^0.14.2" whatwg-url-without-unicode "8.0.0-3" diff --git a/package/expo-package/src/optionalDependencies/Audio.ts b/package/expo-package/src/optionalDependencies/Audio.ts index b15f4e1521..ea7c7423b8 100644 --- a/package/expo-package/src/optionalDependencies/Audio.ts +++ b/package/expo-package/src/optionalDependencies/Audio.ts @@ -235,7 +235,6 @@ class ExpoAudioRecordingAdapter { clearInterval(this.recordingStateInterval); await this.recording.stop(); this.uri = this.recording.uri; - this.recording.release(); }; getURI = () => this.uri; diff --git a/package/expo-package/src/optionalDependencies/Sound.ts b/package/expo-package/src/optionalDependencies/Sound.ts index 95494b0081..96015ac5c3 100644 --- a/package/expo-package/src/optionalDependencies/Sound.ts +++ b/package/expo-package/src/optionalDependencies/Sound.ts @@ -69,7 +69,9 @@ class ExpoAudioSoundAdapter { initialStatus, onPlaybackStatusUpdate: (playbackStatus: PlaybackStatus) => void, ) { - this.player = expoCreateSoundPlayer?.(source, initialStatus.progressUpdateIntervalMillis); + this.player = expoCreateSoundPlayer?.(source, { + updateInterval: initialStatus.progressUpdateIntervalMillis, + }); this.onPlaybackStatusUpdate = (playbackStatus: ExpoAudioPlaybackStatus) => { onPlaybackStatusUpdate(expoAudioToExpoAvStatusAdapter(playbackStatus)); if (playbackStatus.didJustFinish) { diff --git a/package/src/components/MessageInput/hooks/useAudioController.tsx b/package/src/components/MessageInput/hooks/useAudioController.tsx index a9f78bd523..43d25e5953 100644 --- a/package/src/components/MessageInput/hooks/useAudioController.tsx +++ b/package/src/components/MessageInput/hooks/useAudioController.tsx @@ -158,8 +158,9 @@ export const useAudioController = () => { } // For Expo CLI if (soundRef.current?.stopAsync && soundRef.current?.unloadAsync) { - await soundRef.current.stopAsync(); + await soundRef.current?.stopAsync(); await soundRef.current?.unloadAsync(); + soundRef.current = null; } }; @@ -247,9 +248,7 @@ export const useAudioController = () => { if (recordingStatus === 'recording') { await stopVoiceRecording(); } - if (!paused) { - await stopVoicePlayer(); - } + await stopVoicePlayer(); resetState(); NativeHandlers.triggerHaptic('impactMedium'); }; @@ -320,7 +319,9 @@ export const useAudioController = () => { recordingDuration, recordingStatus, setMicLocked, + startVoicePlayer, startVoiceRecording, + stopVoicePlayer, stopVoiceRecording, uploadVoiceRecording, waveformData,