-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microphone Not Working in Background on Android Device #254
Comments
I have similar issue |
@KartikLakhani009, if you find a solution, please share it. I’ve been searching for a solution for the past week. @Rapsssito, could you please help with the solution? |
@KartikLakhani009 @vishalyad16 Did you find any fix for this? |
@IIvexII I’m still figuring out the solution. |
@vishalyad16 After days of struggle, I have resolved this issue by only running a background service.
After the installation, I converted my expo to bare react native project:
In android>app>src>main>AndroidManifest.xml I added the following permissions and services:
and between application tag I added this
Here is the basic code to start and stop the background service, feel free to change the parameters
Here is the actual function that will run in the background:
|
@IIvexII Please send me the code snippet from node_modules/react-native-background-actions/android/src/main/AndroidManifest.xml. |
do you have android folder in your project? |
Yes I am using CLI |
I didn't edited the node_modules/react-native-background-actions/android/src/main/AndroidManifest.xml, so it will be same as yours. Please change the android>app>src>main>AndroidManifest.xml :
|
@IIvexII I'm facing a build issue while adding it.
android\app\src\debug\AndroidManifest.xml:33:85-156 Error: FAILURE: Build failed with an exception.
|
It seems like there 2 services defined with the same name but different value. Remove the one that have value of value=(dataSync) and make sure that you have not edited the AndroidManifest of the package. You should only modify the one present in your project's android folder. If the problem persist then re-install the package react-native-background-actions. |
@IIvexII I tried the solution above, but the app now crashes when it goes into the background.
|
@vishalyad16 I am facing the same issue in android 14 and above version. This is working fine in 13 and less. The problem is with shortService. I will try to fix mine then I'll share the solution if successful. |
Okay @IIvexII |
@vishalyad16 Sorry for the late reply, I was busy in some other things. By the way, I have found and fixed the root causes that was making the app crash.
|
@IIvexII , thanks for the reply. Can you please send me the code for android/app/src/main/AndroidManifest.xml? |
Sure!! Here is the code:
|
@IIvexII it is still crashing on samsung device |
FOREGROUND_SERVICE_MICROPHONE and other permissions are introduced in ANDROID > 13 , which might be not included in react native permissions, that's why the app is being crashed in android 14 or above while we are defining these permissions in AndroidManifest.xml. In my case, i did all the above stuff and I added manually this permission (FOREGROUND_SERVICE_MICROPHONE) in my code , which works for me. Here's my code : const PERMISSIONS = {
|
Hi
While the app is in the background, the microphone isn't working. However, it functions properly when the app is in the foreground, where both camera and microphone permissions are granted.
how can i solve this ?
I’m facing an issue where the microphone stops working when the app is in the background, even though the camera and microphone permissions are correctly granted when the app is in the background and it functions properly when the app is in foreground.
Can you please assist in resolving this? It would be greatly appreciated if someone could help or provide any guidance on how to fix this behavior.
Thanks in advance!
The text was updated successfully, but these errors were encountered: