How to prevent microphone permissions errors on mo...
# support
t
Hello, I often see bug in production where a user on a mobile device starts a call using the web sdk, and if the call setup takes too long (our api calls + the vapi setup), the mobile browser gives a NotAllowedError on the getUserMedia() request. The user would have already accepted the microphone permission by this point, and may even have made a previous successfull vapi call in the same session. It seems to be down to the stricter policy the mobile browsers have with 'user gestures', only allowing a small window of time between a user click and a getUserMedia() request. One possible fix could be to get the media stream before setting up the vapi call, and pass it on in the vapi.start() method, although it looks like that's not possible with the Web SDK. Any other ideas would be greatly appreciated!
v
To reduce microphone permission errors on mobile, increase the
customerJoinTimeoutSeconds
to 30-45 seconds
to give users more time for permission prompts and network setup. For example, when creating your assistant:
Copy code
typescript
const assistant = await client.assistants.create({
  name: "Customer Support Assistant",
  // ...other config...
  customerJoinTimeoutSeconds: 45
});
This helps prevent premature timeouts due to mobile browser restrictions. See the [Vapi documentation for details](https://docs.vapi.ai/calls/customer-join-timeout). Source: - [Customer Join Timeout](https://docs.vapi.ai/calls/customer-join-timeout)
t
my customerJoinTimeoutSeconds is currently set to 60. I'm talking about permission problems within the first ~5 seconds of call setup