在Salesforce iOS SDK中查询用户名 [英] Query for username in Salesforce iOS SDK

查看:204
本文介绍了在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆