You need to sign in to do that
Don't have an account?
admintrmp
User ID in hybrid app
Anyone know how to get the user ID in the hybrid application. I'd imagine there would be one of two options:
1. Get it from a stored variable somewhere in the application.
2. Use a command in REST API.
But how do we do it?
Thanks in advance
The SalesforceOAuthPlugin.getAuthCredentials() method will return an object with the current user's configured credentials, though asynchronously. So you could make a call like this in your JS:
All Answers
It's returned in the oauth login response URI
access_token=[ACCESS TOKEN (Session Id)]
&refresh_token=[REFRESH TOKEN]
&instance_url=https%3A%2F%2Fna1.salesforce.com
&id=https%3A%2F%2Flogin.salesforce.com%2Fid%[ORG ID]%[USER ID]
&issued_at=1312403866216
&signature=[SIGNATURE]
The SalesforceOAuthPlugin.getAuthCredentials() method will return an object with the current user's configured credentials, though asynchronously. So you could make a call like this in your JS: