facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.37k stars 24.25k forks source link

Music from other apps stop when react native app is opening #41891

Closed cisplRejjak closed 9 months ago

cisplRejjak commented 9 months ago

Description

I have created a new project. After running 'pod install' and launching the app, it opens successfully. However, when my other app (Spotify), playing music in the background, is interrupted.

If I open the React Native app and then attempt to play Spotify music while keeping the React Native app in the background, it works fine. The issue only occurs the first time the React Native app is opened.

Note: This is only happening in iOS, in Android its working fine.

Other information: Xcode : Version 14.2 (14C18) Physical Device : iPhone 14 Pro Max(iOS version 16.3.1) React Native : 0.68.2 React: 17.0.2 node: v16.14.2

Package.json { "name": "testReactNativeApp", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "17.0.2", "react-native": "0.68.2" }, "devDependencies": { "@babel/core": "7.23.5", "@babel/runtime": "7.23.5", "@react-native-community/eslint-config": "2.0.0", "babel-jest": "26.6.3", "eslint": "7.32.0", "jest": "26.6.3", "metro-react-native-babel-preset": "0.67.0", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

Steps to reproduce

  1. Create a React Native app (I have used npx react-native init testReactNativeApp --version 0.68.2).
  2. Play music from any music app (e.g., Spotify).
  3. Launch the React Native app.
  4. Wait for 1 minute or less; it will stop your music.

React Native Version

0.68.2

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1
    Memory: 76.34 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: Not Found
    npm: 8.5.0 - /usr/local/bin/npm
    Watchman: 2023.02.20.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.1 AI-221.6008.13.2211.9514443
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.18 - /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Stacktrace or Logs

Not found any failure or crash!!

Reproducer

https://github.com/cisplRejjak/testReactNativeApp

Screenshots and Videos

https://github.com/facebook/react-native/assets/55873481/bf35ce58-efa8-4c1f-bc2a-d68a5abb3b5b

github-actions[bot] commented 9 months ago
:warning: Too Old Version of React Native
:information_source: It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.