Jump to content
Welcome to our new Citrix community!
  • 0

What are the differences between "MamSdk.getInstance(context, null).userName" and "MamSdk.getInstance(context, null).getUserName(context)"


Tobias Tharaldsen

Question

I am trying to build the start up/launching of an app and need to get the username as quickly as possible (I'm developing an Android app with the Android API, and I am using Kotlin).

Unfortunately I do not have a Citrix environment set up, and have to send my app to the customer for them to test, which is a bit tedious (and is why I may be asking a lot of newbie questions).

 

I was wondering what I could expect to get in return when running any of these two methods:

  • MamSdk.getInstance(context, null).userName
  • MamSdk.getInstance(context, null).getUserName(context)

 

And some follow up questions that would enlighten me even more if I knew the answers to them are:

Is it safe to to check if any of them is "not null", and then I would know that I have a correct username?

Will the method call work if it is the first call I make in my app, or do I have to run any other methods first (like starting the tunnel)?

Can the return value be "null" at first, and then return the correct username later (which mean I should listen for changes and not only call it once)?

Link to comment

1 answer to this question

Recommended Posts

  • 0

Solution:

I have now confirmed that I successfully found the username immediately when running MamSdk.getInstance(context, null).getUserName(context).

I did not find anything when running the other function (it returned null).

 

This makes it very easy to use, one can just call the function once and if everything is set up correctly, the username should immediately be returned ?

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...