Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to Set Access Token Mesibo After Mesibo Stop #72

Open
adisiji opened this issue Aug 13, 2021 · 3 comments
Open

Fail to Set Access Token Mesibo After Mesibo Stop #72

adisiji opened this issue Aug 13, 2021 · 3 comments

Comments

@adisiji
Copy link

adisiji commented Aug 13, 2021

Hi there,
Thank you for your kind support here.

I have a problem when I stop Mesibo, then setup the access token with different token. Because I want to change the user.
Code to Stop Mesibo:

if (Mesibo.isReady()) {
    Mesibo.getSelfProfile().removeLocalProfile()
    val mesiboStop = Mesibo.stop(true)
    Mesibo.reset()
    Timber.d("Stop Mesibo = $mesiboStop")
    mNotifyUser?.clearNotification()
    started = false
}

Then I'm trying to start the Mesibo again:

// set access token
   val mesiboToken = tokenRepository.loadMesiboToken()
   val setAccessToken = Mesibo.setAccessToken(mesiboToken)
   Timber.d("SetAccessToken Mesibo : $setAccessToken") --> return -1

   val setDatabase = Mesibo.setDatabase("", 0)
   Timber.d("SetDB Mesibo : $setDatabase") --> return false

   // Now start mesibo
   val startMesibo = Mesibo.start()
   Timber.d("Start Mesibo : $startMesibo") --> return 0

   MesiboCall.getInstance().run {
         val uiProperties = createCallProperties(true).ui
         uiProperties.title = context.getString(R.string.app_name)
         setDefaultUiProperties(uiProperties)
   }

Android SDK Mesibo Version:

MESIBO_API = "1.6.4"
MESIBO_CALLS = "1.6.4"
MESIBO_UI = "1.6.4"

Thank You

@mesibo
Copy link
Owner

mesibo commented Aug 13, 2021

Thanks for the elaborations. Try setting calling access token with null before setting a new token and let us know.

setAccessToken(null);
setAccessToken(newToken);

@adisiji
Copy link
Author

adisiji commented Aug 13, 2021

Ok. Thanks, Now setAccessToken has return 0.
But why the Mesibo.setDatabase keep returning false ?

@mesibo
Copy link
Owner

mesibo commented Aug 13, 2021

Let me raise an internal ticket on this. Some of the restrictions were put for privacy reasons.

In the meantime, look at the messenger implementation where we restart on logout for a clean start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants