Authentication Forwarding
If your host app has already been authenticated with the phone number verification system, you can forward that authentication token to the StreamLayer SDK. By doing so, your users won't need to authenticate repeatedly in our SDK - they will be automatically authenticated instead.
The following method during the authentication on your side to delegate the authentication token:
do {
try await StreamLayer.setAuthorizationBypass(token: "YOUR_TOKEN", schema: "YOUR SCHEMA")
// authorization is successful
} catch {
// there is some error during authorization
}The StreamLayer SDK requests user data from the backend side. If the response is successful, the client creates a user entry into a database for SDK based upon the received data. SDK authorization flow checks data about user and if it exists authorization steps will be skipped.
In case if host app doesn’t perform authorization for StreamLayer SDK the customer will not be able to use functions such as Gamification, Watch Party, chat, profile and so on and will show alert with message "Sign up to enable this option"
In order to remove user data from the database and to clear the user local cache, your app should call the method listed below:
StreamLayer.logout()Updated 6 months ago
