forcedotcom / SalesforceMobileSDK-Android

Android SDK for Salesforce
Other
341 stars 386 forks source link

How to access Custom Attributes in Android #2503

Closed nzsrini closed 7 months ago

nzsrini commented 8 months ago

Please fill out the following details:

  1. Version of Mobile SDK Used: 11.1.0
  2. Issue found in Native App or Hybrid App:Native APP

In IOS we acesss the custom attribute using the following method UserAccountManager.shared.currentUserAccount?.idData.customAttributes?["xx"] Please can you help us how to access customAttribute in Android?

wmathurin commented 7 months ago

Custom attributes are captured from the id service response here. They are saved as preferences here.

To get a custom attribute simply call getPref on AdminSettingsManager.

SalesforceSDKManager.getInstance().adminSettingsManager.getPref(customAttributeKey, userAccount);