0

when the app is totally closed, I don't receive calls, I don't know why can any one help me ?? I'm using this code to setup 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())

also I have implement all Mesibo Call Listeners

Jemy
  • 3
  • 3

1 Answers1

0

Once the operating system suspends your app, it will not be able to run and hence receive new messages or calls until it is activated again. Hence, when your app has a new message or a new incoming call, you need to wake up your app from the sleep state to deliver messages and calls in real-time. This is where you need to send push notifications. Push notification wakes up your app and moves it from the sleep state to the active state. Once the app moves to the active state, Mesibo will automatically connect and start receiving messages and calls.

From https://mesibo.com/documentation/api/push-notifications/

ganY
  • 43
  • 1
  • 6