• Nithya venkat
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

I am building a native iOS app.I want to populate images in the attachments of a salesforce object to the app.I  can query to get body from object as  /services/data/v23.0/sobjects/Attachment/xxxxxxxxxxxxxxx/Body. I tried to send this body field of attachment  via a asihttp request with request header Authorization which gives response string as ÿØÿà. 

 

Summary: Any method to access salesforce files to native iOS app.

 

Thank you very much in advance.

I am new in Salesforce and ios development. I need to download a text file and images from Salesforce (Files or Libraries) and save it on disk using ios and rest api. I am trying this code below, but it doesn't work or not complete. Please, someone help me to know :

1) What is the correct url?

2) What is object id length : 15 or 18?

3) How to get OAuth token and Authorization? I have my consumer key, login domain,...

4) The complete code like methods to handle the response, error, ...

 

    NSURL *myURL = [NSURL URLWithString:@"https://test.salesforce.com/v23.0/sobjects/ContentVersion/<objectID>/VersionData"];
    NSMutableURLRequest* requestDoc = [[NSMutableURLRequest alloc] initWithURL:myURL];
    [requestDoc addValue:@"OAuth token" forHTTPHeaderField:@"Authorization"];
    [NSURLConnection connectionWithRequest:requestDoc delegate:self];

 

Thanks,

brum

  • May 16, 2012
  • Like
  • 0