2012-07-03 115 views
1

变种SalesforceOAuthPlugin = {的UserInfo SalesForce公司

/** 
* Obtain authentication credentials, calling 'authenticate' only if necessary. 
* Most index.html authors can simply use this method to obtain auth credentials 
* after onDeviceReady. 
* success - The success callback function to use. 
* fail - The failure/error callback function to use. 
* PhoneGap returns a dictionary with: 
* accessToken 
* refreshToken 
* clientId 
* userId 
* orgId 
* loginUrl 
* instanceUrl 
* userAgent 
*/ 
getAuthCredentials: function(success, fail) { 
    PhoneGap.exec(success, fail, "com.salesforce.oauth","getAuthCredentials",[]); 
}, 

SalesforceOAuthPlugin.getAuthCredentials(getUserid(),getAuthCredentialsError);

我想获得使用上述功能的用户的ID,但它不工作。

回答

2

使用此格式的链接https://na1.salesforce.com/id/1/1 na1 - salesforce实例,first 1 - organizationId,next 1 - userId。

请注意,在这样的get你应该记录(提供OAuth令牌)。

我认为你在URL中提供的实际userId或token或id之间的映射。