StreamVideo(
...,
options: const StreamVideoOptions(
logPriority: Priority.verbose,
),
);
Troubleshooting
There are several possible integration issues that can lead to calls not being established. This section will cover the most frequent ones.
Connection issues
Connection issues usually happen when you provide an invalid token during the SDK setup. When this happens, a web socket connection can’t be established with our backend, resulting in errors when trying to connect to a call.
- Ensure the token is valid and generated for the correct user.
- Verify that the token matches the user ID specified during the initialization of the
StreamVideo
instance.
During development, hardcoded tokens often lead to mismatches. Always ensure the token corresponds to the user currently being initialized.
Expired tokens
When you initialize the StreamVideo
object, you provide a token, as described here. The tokens generated in the docs have an expiry date, therefore please make sure to always use a token with a valid expiry date. You can check the contents of a JWT token on websites like this one.
Additionally, when expiring tokens are used, you need to provide a tokenLoader
when creating StreamVideo
, that will be invoked when the existing token expires. This is your chance to update the token by calling your backend.
Wrong secret for token generation
When you start integrating the SDK into your app, you might copy-paste the token from the docs into your project. However, that will not work. Tokens are generated with the help of the app secret (available in your dashboard), and are unique per app id. Your app id is different than the demo apps we have as examples in our docs.
On website like this one, you can verify if the token is signed with the correct signature.
While developing, you can manually generate tokens by providing your secret and the user’s ID here. However, note that for production usage, your backend would need to generate these tokens.
Third-party network debuggers
There are network debuggers like Wormholy, that allow you to see all the network requests done with your app. However, some of them can interfere and block our web socket connection, like in this case. In order to prevent this, you need to exclude our hosts from debugger tools, as described on the linked issue.
Members in a call
One common issue is that you only specify one user and try to call the same user on another device. This will not work, if you are the caller, you will not receive a notification that you’re being called - you can’t call yourself.
As you would do it in the real world, you would need to specify another member (or members) that you want to call. Another important note - that member should also exist in Stream’s platform (it must have connected at least once). This is needed because we need to know the user’s device and where to send the call notification.
Reusing a call id
Call IDs in general can be reused - you can join a call with the same id many times. However, the ringing is done only once per call ID. Therefore, if you implement calls with ringing, make sure that you provide a unique ID every time, in order for the ring functionality to work. One option is to use a UUID
as a call ID.
(iOS) CallKit integration issues
If you followed the CallKit guide, and still have issues, here are some troubleshooting steps:
- make sure there are no connection issues (see points above)
- make sure you don’t have a Do Not Disturb focus turned on (or any other focus that might block CallKit)
- check if the generated VoIP certificate matches the bundle id specified in the dashboard
- check if the app is using the correct bundle id
- check if you have created push providers and you specified their correct names when creating the SDK
- check the “Webhook & Push Logs” section on the dashboard to see if there are any push notification failures
- make sure the app has Push Notifications Capability added in Xcode
- check if correct background modes are set in Xcode (processing, remote-notification, voip)
- try sending a hardcoded VoIP notification using a third-party service, to make sure your app integration is correct
Note that if you have failed to report a VoIP notification to CallKit
, the operating system may stop sending you notifications. In those cases, you need to re-install the app and try again.
Logs
For further debugging, you can turn on more detailed logging. In order to do that, specify a logPriority
when creating StreamVideo` instance.