Giter Site home page Giter Site logo

twelveparsecs's Introduction

Introduction

This application is a Proof of Concept to show how Salesforce SmartSync can be used to handle offline data and synchronization with salesforce server.

Requirements

This is an iOS application to be run in an iPhone/iPad device. It uses Pod to retrieve all its dependencies:

  1. XCode 7.2
  2. iOS SDK 8+
  3. Salesforce SDK
  4. SmartStore
  5. SmartSync
  6. WYPopoverController
  7. FMDB

Setup

  1. Run this code and login with [email protected] / t0pc0d3r
  2. If you want to point it to you sfdc org here is the unmanaged package for the object setup: unamangaged package

See deployment guide in doc dir. Please note the credinetials in the word doc wont work with this code because the developer used a namespace prefix which has been removed.

Implementation information

This application was based on a sample provided by Salesforce team that demonstrates the usage of SmartStore and SmartSync functionalities. It was extended to allow multiple soups to be stored in SmartStore for different objects defined in Salesforce.

For this particular application it was used the Contact object and 2 new custom objects, Product and Sample Request. To allow many-to-many relationship between Sample Request object and User object a junction object called Authorized_Users was created.

Since the Sample Request object depends on data from Contact and Product objects some care has been taken:

  1. When a new Contact or Product is just created it can't be used in a Sample Request until it has been synchronized with the server and an unique ID has been provided.
  2. Synchronization is always done in background so user never gets blocked.
  3. Synchronization with server is only done if internet connection is online.
  4. Synchronization is done automatically if some data was changed (new or edit), every 5 minutes (configurable in the device settings), when the device is online after being offline and changed data exists, or if requested manually by user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.