1. Launch Gluedin as a Guest user on Button click:Sample code below:
fun launchGluedAsGuestUser() {
val callback: GluedInSDKCallBack = object : GluedInSDKCallBack {
override fun onSdkInitSuccess(
isSuccess: Boolean,
gluedInSdkException: GluedInSdkException?
) = Unit
override fun onSdkLogout() = Unit
override fun onUserProfileClick(userId: String) = Unit
override fun onAppAuthSuccess(
isSuccess: Boolean,
gluedInSdkException: GluedInSdkException?
) = Unit
override fun onGluedInShareAction(shareData: ShareData) = Unit
override fun onLoginRegistrationRequired(
currentVideo: VideoInfo?,
isLoginAction: Boolean
) = Unit
override fun onProductCTAClicked(assetId: String, eventRefId: Int) = Unit
override fun onSdkExit() = Unit
}
val gluedInConfigurations = GluedInInitializer.Configurations.Builder()
.setSdkCallback(callback)
.setApiKey("put_your_api_key")
.setSecretKey("put_your_secret_key")
.setFeedType(GluedInInitializer.Configurations.FeedType.VERTICAL) // GluedInInitializer.Configurations.FeedType.SQUARE
.create()
gluedInConfigurations.validateAndLaunchGluedInSDK(
this,
GluedInConstants.LaunchType.APP,
intent
)
}
2. Launch GluedIn as a authenticated user: Sample code below:
func launchGluedAsRegisteredUser() {
val callback: GluedInSDKCallBack = object : GluedInSDKCallBack {
override fun onSdkInitSuccess(
isSuccess: Boolean,
gluedInSdkException: GluedInSdkException?
) = Unit
override fun onSdkLogout() = Unit
override fun onUserProfileClick(userId: String) = Unit
override fun onAppAuthSuccess(
isSuccess: Boolean,
gluedInSdkException: GluedInSdkException?
) = Unit
override fun onGluedInShareAction(shareData: ShareData) = Unit
override fun onLoginRegistrationRequired(
currentVideo: VideoInfo?,
isLoginAction: Boolean
) = Unit
override fun onProductCTAClicked(assetId: String, eventRefId: Int) = Unit
override fun onSdkExit() = Unit
}
val gluedInConfigurations = GluedInInitializer.Configurations.Builder()
.setSdkCallback(callback)
.setApiKey("put_your_api_key")
.setSecretKey("put_your_secret_key")
.setFeedType(GluedInInitializer.Configurations.FeedType.VERTICAL) // GluedInInitializer.Configurations.FeedType.SQUARE
.setUserInfoForAutoSignIn(UserInfoAutoSignIn("email_id", "password", "full_name", "profile_picture"))
.create()
gluedInConfigurations.validateAndLaunchGluedInSDK(
this,
GluedInConstants.LaunchType.APP,
intent
)
}
If user is coming from the external deeplink (i.e. WhatsApp, FB or Instagram) and a particular SDK screen needs to be open then using the below SDK method, user can be navigated on respective screen.