0

当应用程序完全关闭时,我不接听电话,我不知道为什么有人可以帮助我??我正在使用此代码来设置 mesibo :

  Mesibo.getInstance().init(this)
  Mesibo.addListener(this)
  Mesibo.setRestartListener(this)
  Mesibo.setSecureConnection(true)
  Mesibo.setAccessToken(user?.mesiboToken)
  val myProfile = UserProfile()
  myProfile.name = user?.name
  myProfile.address = user?.mesiboAddress
  Mesibo.setDatabase("mydb", 0)
  MesiboCall.getInstance().init(applicationContext)
  Mesibo.setAppInForeground(this, 0, true)
  Mesibo.start()
  val profiles = Mesibo.getUserProfiles()
  profiles.forEach { (key, profile) ->
    val split = key.split("-")
    if (!split.isNullOrEmpty()) {
      val userProfile = UserProfile()
      userProfile.name = split[0]
      userProfile.address = key
      Mesibo.setUserProfile(userProfile, false)
    }
  }
  Mesibo.setPushToken(TokenManager.getInstance().getFCMToken())

我也实现了所有 Mesibo 呼叫侦听器

4

1 回答 1

0

一旦操作系统暂停您的应用程序,它将无法运行并因此接收新消息或呼叫,直到它再次被激活。因此,当您的应用有新消息或新来电时,您需要将应用从睡眠状态唤醒以实时传递消息和呼叫。这是您需要发送推送通知的地方。推送通知唤醒您的应用程序并将其从睡眠状态移动到活动状态。一旦应用程序进入活动状态,Mesibo 将自动连接并开始接收消息和呼叫。

来自https://mesibo.com/documentation/api/push-notifications/

于 2021-03-24T13:57:46.537 回答