• listerrr
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies

Hi,

I'm trying to use create contact with prefilled info. But there is an issue when i use frontdoor.jsp with retURL. It does not redirect to the url given in query string retURL.

ap1.salesforce.com/secur/frontdoor.jsp?sid=<REALLY_LONG_OAUTH_TOKEN_HERE>&retURL=003/e?name_firstcon2=palani&name_lastcon2=raja

At the moment it strips everything after first query parameter

it redirects to ap1.salesforce.com//e?name_firstcon2=palani ignoring name_lastcon2=raja

 

 

Duplicating it here - github.com/forcedotcom/SalesforceMobileSDK-iOS/issues/391

Hi,

I'm trying to use create contact with prefilled info. But there is an issue when i use frontdoor.jsp with retURL. It does not redirect to the url given in query string retURL.

ap1.salesforce.com/secur/frontdoor.jsp?sid=<REALLY_LONG_OAUTH_TOKEN_HERE>&retURL=003/e?name_firstcon2=palani&name_lastcon2=raja

At the moment it strips everything after first query parameter

it redirects to ap1.salesforce.com//e?name_firstcon2=palani ignoring name_lastcon2=raja

 

 

Duplicating it here - github.com/forcedotcom/SalesforceMobileSDK-iOS/issues/391

I am working on salesforce attachment app.This app shows the Attachment list of particular objects like leads,Contacts,opportunity,cases,campaign.

I have successfully uploaded the attachment like images,videos,audio from my app to salesforce account and also download it from salesforce in blob format and show it in my attachment successfully.

For this I have created App on my salesforce account whose name is "salesforce attachment" and generate Consumer key,callback url,Client secrete successfully.

Then I link this consumer key and callback url to my iOS app and I am login successfully.

Now to access the attachment blob,firstly I needed access token.

To get access token I used OAuth 2.0 token flow.
In this I have pass following parameter,
grant_type=password,
client_id=consumerKey,
username=username,
password=password,
Redirect_uri=callbackUrl,

by passing this parameter I have generate access token successfully.

I am using this token every time when I need to get attachment data from salesforce.

Now the problem is that when I login in to my iOS app with my salesforce account on which my salesforce app is created "Salesforce Attachment" my app is working fine.

**But when I login with another salesforce account in my iOS app.I am getting attachment list but not Attachment Blob**

I am getting following error,

{ "message" : "The requested resource does not exist", "errorCode" : "NOT_FOUND" }.

here is my code for getting attachment blob.


NSString *blobPost = [NSString stringWithFormat:@"OAuth %@",access_token];

NSString *urlString=[NSString stringWithFormat:@"%@%@/Body",instance_url,attachmentUrl];

NSURL *blobUrl=[NSURL URLWithString:urlString];

[blobRequest setURL:blobUrl];
[blobRequest setHTTPMethod:@"GET"];
blobRequest setValue:blobPost forHTTPHeaderField:@"Authorization"];
[blobRequest setValue:@"application/pdf" forHTTPHeaderField:@"Content-Type"];

[NSURLConnection
sendAsynchronousRequest:blobRequest
queue:[[NSOperationQueue alloc] init]
completionHandler:^(NSURLResponse *response,
NSData *data,
NSError *error)
{

if ([data length] >0 && error == nil)
{

//here i can get attachment data
imageData=[[NSData alloc]initWithData&colon;data];

}
else if ([data length] == 0 && error == nil)
{
NSLog(@"Nothing was downloaded.");
[HUD hide:NO];

}
else if (error != nil){
NSLog(@"Error = %@", error);
}
}];


I need your help.Thanks in advanced

 

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