在Salesforce iOS SDK中查询用户名 [英] Query for username in Salesforce iOS SDK
问题描述
我有一个使用最新Salesforce iOS SDK的iOS应用。它使用Salesforce站点上的oAuth2.0通过webview对用户进行身份验证,因此我不会在应用程序中捕获用户名。有没有办法可以使用API或会话信息以某种方式查询用户名?我只是希望能够显示用户名,以便用户知道他们登录了哪个帐户(如果他们有多个帐号)
谢谢,
Joseph
I have an iOS app using the latest Salesforce iOS SDK. It authenticates users through a webview using oAuth2.0 on the Salesforce site so I do not capture the username in my app. Is there a way that I can query for the username either using the API or the session information somehow? I just want to be able to display the username so that the user knows which account they have logged into (if they have more than one) Thanks, Joseph
推荐答案
当前用户的用户名存储在SFIdentityData对象中
username of current user is stored in SFIdentityData object
#import "SFIdentityData.h"
NSString *userName = [SFAccountManager sharedInstance].idData.username;
这篇关于在Salesforce iOS SDK中查询用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!