Features Integration
Integration additional features
Watch Party
To ingrate watch party feature, need setup a feature module
dependencies {
implementation "io.streamlayer:androidsdk:<insert latest version>"
implementation "io.streamlayer:android-watchparty:<insert latest version>"
}import io.streamlayer.sdk.StreamLayer
import io.streamlayer.sdk.watchparty.StreamLayerWatchParty
override fun onCreate() {
super.onCreate()
// initialize the StreamLayer SDK with SDK key
StreamLayer.initializeApp(this, {SDK_KEY})
// initialize the StremaLayer Watch Party
StreamLayerWatchParty.initSdk(this)
}Google Pal Advertising
Module contains "com.google.android.gms:play-services-pal" dependencies
dependencies {
implementation "io.streamlayer:android-googlepal:<insert latest version>"
}import io.streamlayer.sdk.StreamLayer
import io.streamlayer.sdk.googlepal.StreamLayerGooglePal
override fun onCreate() {
super.onCreate()
// above code
StreamLayerGooglePal.initSdk(this)
}Anonymous User Authentication
For full access to the feature, you need to authenticate the User. The SDK provides several ways to complete auth. In this guide we use the simplest of them - Anonymous authentication. In this case the SDK will assign userID without collecting the phone number. To use Anonymous authentication you need call StreamLayer.useAnonymousAuth() function from any CoroutineScope:
import io.streamlayer.sdk.StreamLayer
override fun onCreate() {
super.onCreate()
appScope.launch{
runCatching { StreamLayer.useAnonymousAuth() }
.onFailure{
// check error message here
}
}
}
Updated 2 months ago
