Hello Team,
It will display Invalid authentication token (0). when i call following code
AmityCoreClient.setup(
apiKey = BuildConfig.AMITY_API_KEY,
endpoint = AmityEndpoint.SG,
).subscribe()
private fun registerDevice(userId: String, displayName: String? = "") {
AmityCoreClient.login(userId, object : SessionHandler {
override fun sessionWillRenewAccessToken(renewal: AccessTokenRenewal) {
renewal.renew()
}
})
.apply {
if (!displayName.isNullOrEmpty()) {
displayName(displayName)
}
}
.build()
.submit()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnComplete {
registerForPushNotifications()
val intent = Intent(this, AmitySettingActivity::class.java)
startActivity(intent)
}
.doOnError {
findViewById<View>(android.R.id.content).showSnackBar("Could not register user " + it.message)
}
.untilLifecycleEnd(this)
.subscribe()
}