function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gshuflingshuflin 

How do I get the username of the user who is currently logged in using the iOS Toolkit?

I'm using the ios toolkit as per http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Toolkit_for_iOS. I need to programatically get the user id of the user who is currently logged in so I can query for various objects that that user owns. How would I go about doing this?

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

the getUserInfo call has that data (in the IOS toolkit, i beleive its getUserInfoWithTarget on the Switchboard object)

All Answers

SuperfellSuperfell

the getUserInfo call has that data (in the IOS toolkit, i beleive its getUserInfoWithTarget on the Switchboard object)

This was selected as the best answer
gshuflingshuflin

Thanks, that did it. 

 

I might mention for people who are trying to do this in the future that you need to use the ZKUserInfo object when writing the method that gets called back to handle the username query, this isn't made particularly clear in the documentation.

John T.John T.

Hi guys,

 

I'm just wondering, how where you able to get the username of the user using zkUserinfo?

 

An example of how to get this would much be appreciated.

 

Thanks,