0
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())
}

}

4

1 回答 1

0

mesibo 不知道名称,除非您使用用户配置文件 API 设置它。在这种情况下,它将名称设置为地址。您应该使用 mesibo 用户配置文件 API 来设置地址和保存配置文件。

https://mesibo.com/documentation/api/real-time-api/profiles/

配置文件允许您将诸如姓名、图片、状态、存在信息等人类可读信息与用户或组相关联。

于 2021-01-21T15:09:52.353 回答