• tstellanova-sfdc
  • NEWBIE
  • 25 Points
  • Member since 2011

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

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

Folks, if you want to bring bugs or feature requests to the attention of the Salesforce Mobile SDK team, the most direct route is to submit an issue in github at the appropriate site, ie:

 

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

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

 

We use github every day and can quickly triage bugs in that forum.   You can also submit your code contributions in a pull request on github for inclusion in the Mobile SDK. 

 

However, if you just have questions about using the Mobile SDK, please continue to use this discussion board for that. 

It seems that the SalesforceMobileSDK-iOS requires the /Developer folder, which is no longer part of the XCode setup. So how do I update/resolve the compiler errors when trying to run ./install.sh for the sdk setup?

Hi, 

 

I have read the article "Getting Started with the Mobile SDK for Android". And I practice the demo which the article mentioned.

 

I found the demo project "TemplateApp" is based on the OAuth2.0 User-Agent Flow.

So, I want to know is there has any example or article about how to use OAuth2.0 Username-Password Flow with MobileSDK?

Or is there has anybody try it ?

 

Thanks!

Hi guys,

 

I am using phonegap and salesforce mobile SDK. I want to post a file to chatter. But I am unable to make out. Following is my code snippet. Any kind of help will be highly appriciated.

 

    	
        var comment = $("#comment").val();
    				 
	var params = new Object();
	params.desc = "description";
	params.fileName = "filename";
	params.text = comment;
        params.feedItemFileUpload = imageData; // response from phonegap getPicture methods
    				 
        forcetkClient.createFeedItem(params, postSuccess, postError);


    forcetk.Client.prototype.createFeedItem = function(fields, callback, error) {
    	  var str = [];
          for(var p in fields)
	     str.push(p + "=" + encodeURIComponent(fields[p]));
		  
	str = str.join("&");
		  
        this.ajax('/' + this.apiVersion + '/chatter/feeds/news/me/feed-items'
        , callback, error, "POST", str);
    }

 

Thanks

  • February 16, 2012
  • Like
  • 0

I downloaded the latest version of the Mobile SDK today and ran ./install.sh but am getting build errors specifically with the json library.  The git commands seemed to work correctly and located all the libraries.  I have tried ./reset.sh and ./install.sh again with no change.  Here is the area that's failing:  (Note: all of the configurations for json lib fail the same way)

 

pre:

dependency.oauth.check:

iOSShared.dependency.oauth:

dependency.sbjson.check:

iOSShared.dependency.sbjson:

dependency.sbjson.compile:

initArtifacts:
     [echo] artifacts.dir is '/Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/sfdc_build/artifacts'

pre:

build:

compileDebug:

iOSShared.compile:
     [echo] installing SBJson for SDK iphoneos
     [exec] Build settings from command line:
     [exec]     INSTALL_ROOT = /Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/sfdc_build/artifacts/SBJson
     [exec]     SDKROOT = iphoneos5.0
     [exec]
     [exec] === BUILD NATIVE TARGET sbjson-ios OF PROJECT SBJson WITH CONFIGURATION Debug ===
     [exec] Check dependencies
     [exec]
     [exec] SetOwnerAndGroup "chrisn5555:staff" /Users/chrisn5555/Documents/xcode-shared/UninstalledProducts/libsbjson-ios.a
     [exec]     cd /Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/json-framework
     [exec]     setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/chrisn5555/Downloads/eclipse/plugins/org.jruby_1.2.0.9419p1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
     [exec]     /usr/sbin/chown -RH "chrisn5555:staff" /Users/chrisn5555/Documents/xcode-shared/UninstalledProducts/libsbjson-ios.a
     [exec]
     [exec] SetMode u+w,go-w,a+rX /Users/chrisn5555/Documents/xcode-shared/UninstalledProducts/libsbjson-ios.a
     [exec]     cd /Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/json-framework
     [exec]     setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/chrisn5555/Downloads/eclipse/plugins/org.jruby_1.2.0.9419p1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
     [exec]     /bin/chmod -RH u+w,go-w,a+rX /Users/chrisn5555/Documents/xcode-shared/UninstalledProducts/libsbjson-ios.a
     [exec]
     [exec]
     [exec] ** BUILD SUCCEEDED **
     [exec]

BUILD FAILED
/Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/shared/build.xml:214: The following error occurred while executing this line:
/Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/shared/build.xml:222: The following error occurred while executing this line:
/Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/sfdc_build/build.xml:40: The following error occurred while executing this line:
/Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/sfdc_build/build.xml:58: Warning: Could not find file /Users/chrisn5555/Documents/sf/SalesforceMobileSDK-iOS/external/json-framework/json-framework/build/UninstalledProducts/libsbjson-ios.a to copy.

I just updated to the latest version of the salesforce sdk framework and i am getting a different value in the properties of the SFOauthCredentials object. I was expecting the userId of the user, but instead I am getting null values. Here's the printout of the credentials object: 

 

po [[[SFRestAPI sharedInstance] coordinator] credentials]

<SFOAuthCredentials identifier="(identifier value)" clientId="(client id value)" domain="test.salesforce.com/" identityUrl="(null)" instanceUrl="(null)" issuedAt="(null)" organizationId="(null)" protocol="https" redirectUri="sfdc://success">

 

 

any ideas?

  • February 02, 2012
  • Like
  • 0

I have an iOS that connects to sfdc and runs a SOQL query, but more than 2000 results are returned, so I can see the nextRecordsURL in the json data, but then how do I use that hyperlink to get the next set of results? I have tried to use the SFRestRequest with the following code:

 

SFRestRequest *tempRequest = [[SFRestRequestalloc] init];

[tempRequest setPath:strDone];  // this is the URL returned in nextRecordsUrl

[tempRequest setMethod:SFRestMethodGET];

[[SFRestAPI sharedInstance] send:tempRequest delegate:self];

 

I get the following error message:

Error Domain=com.salesforce.RestAPI.ErrorDomain Code=999 "The operation couldn’t be completed. (com.salesforce.RestAPI.ErrorDomain error 999.)" UserInfo=0xf0c3fb0 {message=The requested resource does not exist, errorCode=NOT_FOUND}

 

I have tried appending the auth token to url and that does not work either.

 

Thanks.


  • February 02, 2012
  • Like
  • 0
Could someone help me understand the purpose of these comments in SalesforceOAuthPlugin.js ? * PhoneGap returns a dictionary with: * accessToken * refreshToken * clientId * userId * orgId * loginUrl * instanceUrl * userAgent What is the PhoneGap dictionary and how can it be used? Is it possible to use navigator.notification,alert() or console.log() to verify the current userId, orgId, or even sessionId?
  • February 02, 2012
  • Like
  • 0

When I create a new Native Force.com REST App in Xcode

 

And when I try to run the project in the iPad simulator I get this error, after doing all the oauth verification stuff. The programm just stops. Can anyone help figure out why its not working. I downloaded the Cloudtunes app and it works but creating your own sample app does not. 

 

WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[NSURL length]: unrecognized selector sent to instance 0x6c98e30


In SFNativeRestDelegate.m,  (SFOAuthCoordinator*)coordinator function, forgot to release creds variable

 

Hi

 

Can Mobile SDK be the front end to any ERP system?

 

As all the documentation is having salesforce.com as the backend. What if my backend application is a SAP system, how would disconnected service work?

 

Thanks

 

EB

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

I am trying to create my first hybrid iPad application using force.com ...

 

The installation appears to be successful, and I was able to create a new project in XCode using the force.com template (the icon showed up). I then compiled the empty application which failed to link because of the JSON library (libsbjson-ios.a). When I searched in FINDER, It is a zero-length file.

 

Is there a way to rebuild this library without uninstall/install?

 

Any tips to troubleshoot and fix?

Hi Guys,

I'm pretty new to salesforce and haven't worked with it before. I'm currently writing an iPhone Application using the salesforce iOS SDK.

 

In Salesforce we have an Object "Zeiterfassung__c" with a Master-Object "Kontierungsmonat__c". 

Now I'm trying to create a new Object by using  requestForCreateWithObjectType. Unfortuantly it fails because i don't have the right ObjectID for Master-Object i want to set up the relation to.

 

Is there any chance to receive the Object ID from the Master-Object? I can query a list of all Objects from type "Kontierungsmonat__c". But "Kontierungsmonat__c" doesn't have a ID field :(

 

Let me know if you have any questions.

 

Thanks for your help!

 

Daniel

 

 

 

  • January 18, 2012
  • Like
  • 0

I am using the SDK to access Salesforce and have no problem working with objects, but I would like to know if it is possible to incorporate dashboards into the app.  I don't want to just use a UIWebView pointing to the dashboard page because I want to remove the typical browser "clutter".  Is this possible?

  • January 11, 2012
  • Like
  • 0

 I want to Invoke OAuth service via REST API with JQuery $.ajax object for a mobile app. Can someone help me on this.

 

Thanks

 

 

 
 
 
 

 

  • December 29, 2011
  • Like
  • 0

Hi I have tried a few option here but none seem to work, I dont know if it's because the sdk will only work with JSON data and not sure if i should go for SOAP Calls. I can list my libraries, and documents contained but cant download a document.

 

//# Option 1: Using the api factory method for the request. Of course it expects JSON return.
SFRestRequest *request = [[SFRestAPI sharedInstance] requestForRetrieveWithObjectType:@"ContentVersion" objectId:documentId fieldList: @"VersionData"];
    
     //# Option 2: Method executes but again it's expecting json return
    SFRestRequest *request = [[SFRestRequest alloc] init];
    [request setPath: @"/v23.0/sobjects/ContentVersion/[object id]/VersionData"];
    [request setMethod: SFRestMethodGET];
    [[SFRestAPI sharedInstance] send:request delegate:self];
    
    //#Option 3: get html error saying that the page doesnt exist,  could be related to the new url that needs to be set after login process, dont know how tho get it from the framework.

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

 

  • December 28, 2011
  • Like
  • 0