1

I'm actually creating an ipad application which will have to have offline capability. If we use xcode we can create it by integrating with salesforce mobile sdk.While integrating the frameworks like smartstore and smartsync will get added as a part of integration. But I'm using xamarin.ios for creating this application. Is there a similar framework that will allow me to use xamarin.ios?

1

Unfortunately, SmartSync is only available for the Salesforce Mobile SDK for iOS and Android platforms.

You can use the Salesforce SDK for Xamarin to create your base application but you will need to implement the offline functionality in a custom manner.

I'd recommend using a component like Couchbase LITE for .NET - it's a NoSQL JSON data store similar to the SmartStore used by Salesforce Mobile SDK.

Creating a connection and doing CRUD operations is easy using the Salesforce SDK for Xamarin and involves setting up a connection, logging in the active user and firing SOQL queries.

// Create our connection to salesforce.
var client = new SalesforceClient (clientId, clientSecret, redirectUrl);

// Get authenticated users from the local keystore
var users = client.LoadUsers ();

if (!users.Any ()) {
    client.AuthenticationComplete += (sender, e) => OnAuthenticationCompleted (e);

    // Start the Salesforce login process.
    var loginUI = client.GetLoginInterface ();
    DisplayThe(loginUI);
} else {
    // We're ready to fetch some data!
    // Let's grab some sales accounts to display.
    IEnumerable<SObject> results =
        await client.ReadAsync ("SELECT Name, AccountNumber FROM Account");

    // DO YOUR CUSTOM OFFLINE PROCESSING HERE
}
| improve this answer | |
  • Thanks for the response @Gaurav Kheterpal,For syncing with database time to time what do have to do ? – Ramcharan Reddy Jun 28 '16 at 8:56
  • You may want to post another question but some quick notes - you can typically sync based on 2 models A) Event-driven - you would do this based on some changes in local data that you want to push upstream/ pull downstream or vice-versa B) Periodic - you can do upstream and downstream refreshes on a regular interval – Gaurav Kheterpal Jun 28 '16 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.