override fun Mesibo_onMessage(p0: Mesibo.MessageParams?, p1: ByteArray?): Boolean {
if (userManager.isLogged()) {
Timber.d(" on message : %s", p0?.profile?.name)
Timber.d(" on message : %s", p0?.profile?.address)
p0?.profile?.name?.let { sendNotification(it, String(p1!!, StandardCharsets.UTF_8), applicationContext) }
}
return true
}
**我正在使用此代码在收到消息后显示通知,我不知道为什么配置文件名称返回用户的地址而不是他的姓名
**
我正在使用此代码来设置 mesibo 并设置我的个人资料,但它不起作用还在消息参数配置文件名称中给我用户地址
private fun setupMesibo() {
val user = UserManager.getInstance().getUser()
if (UserManager.getInstance().isLogged()) {
Mesibo.getInstance().init(this)
Mesibo.addListener(this)
Mesibo.setRestartListener(this)
Mesibo.setSecureConnection(true)
Mesibo.setAccessToken(user?.mesiboToken)
val myProfile = UserProfile()
myProfile.name = userManager.getUser()?.name
myProfile.address = userManager.getUser()?.mesiboAddress
Mesibo.setSelfProfile(myProfile)
Mesibo.setUserProfile(myProfile, true)
Mesibo.setDatabase("mydb", 0)
MesiboCall.getInstance().init(applicationContext)
Mesibo.setAppInForeground(this, 0, true)
Mesibo.start()
Mesibo.setPushToken(TokenManager.getInstance().getFCMToken())
}
}