function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
massayagmassayag 

RestKit object mapping

Hi,

The Salesforce iOS SDK contains two classes: SFRestAPI and SFRestRequest. Basically, we can invoke the methods of these classes to retrieve data from Salesforce and also update/delete etc..

I guess that they use a wrapper of RestKit methods combined with the SFOAuth that takes care of authentification tasks(refreshing tokens...) to enable secured access to server.

But RestKit has a powerful object mapping that takes a JSON response and populates the fields of a mapped object. It is one of the best features of RestKit and the SDK does not provide access to such features.

Do you know if there is a way to access these capabilities using the current SDK?

If not, any source of conversion of Salesforces fields types to iOS known data types?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
tstellanova-sfdctstellanova-sfdc

We don't currently layer anything on top of the RestKit object mapping; however it is present with the Salesforce Mobile SDK and you're free to continue using it along with the OAuth context that the Mobile SDK provides.

 

Take a look at the source code for RKRequestDelegateWrapper for an example of how we are injecting the OAuth credentials into each REST request.  

 

If you'd like to see more direct RKObjectMapper support added to a future version of the SDK, please file an enhancement request here:

 

https://github.com/forcedotcom/SalesforceMobileSDK-iOS/issues

 

And as always we welcome contributions of features such as these from the community. 

All Answers

tstellanova-sfdctstellanova-sfdc

We don't currently layer anything on top of the RestKit object mapping; however it is present with the Salesforce Mobile SDK and you're free to continue using it along with the OAuth context that the Mobile SDK provides.

 

Take a look at the source code for RKRequestDelegateWrapper for an example of how we are injecting the OAuth credentials into each REST request.  

 

If you'd like to see more direct RKObjectMapper support added to a future version of the SDK, please file an enhancement request here:

 

https://github.com/forcedotcom/SalesforceMobileSDK-iOS/issues

 

And as always we welcome contributions of features such as these from the community. 

This was selected as the best answer
Cesar_RNCesar_RN
Hello, sorry to open again this question.

Any news about it?

Thanks.