Register
Submit a solution
The challenge is finished.

Challenge Overview

This challenge is the third in a series where we will attempt to build the components for a native iOS Mobile Sales App that uses Salesforce Backend.    The premise of the of the App is for Corellian Engineering Corporation  Salesperson to request sample equipment for their customers (Rebellion Space Pilots)  while they are on planets that may not have wifi or any network connectivity.  Based on the earlier two challenges, we’ve built an app which allows the user to sign a sample request and store it as an attachment in Salesforce.



 

Now, we want to extend it further to support syncing using the Salesforce Mobile SDK SmartStore feature.

 

The winning code from previous challenge and the demo org credentials are provided in the challenge forums.  There are 2 primary objectives of this challenge

  1. Allow the user to sign a sample request offline and store it in SmartStore. A user should be able to sign a sample request multiple times so you should be able to store multiple signature images/ PDFs offline. The use case here is that a rep may sign thousands of offline requests while NOT having any Internet connectivity. Once, he has Internet, the app should detect the same and upload all signatures to Salesforce in a non-obtrusive manner. Currently, if the user goes offline while signing, the sample request is not signed but the signature is preserved and the user manually needs to press ‘Confirm’ to sync the data to Salesforce. This limitation must go away and the user should be able to sign a sample request in the same manner regardless of whether they’re offline or online. The current online flow for signing must work as is.

Screen Shot 2016-02-07 at 3.06.50 PM.png

 

  1. When Internet Connectivity is available, the app should automatically sync all unsynced signatures with Salesforce. Once syncing is complete, the app should then show a pop-up showing how many sample requests were sync’d up stream to Salesforce and if there were errors if any.

Suggested approach

 

  • While signing, check whether user is online or not

  • If online, current flow works as is

  • if offline, store the current signature with sample request id, user id and isSynced (set to false) in SmartStore

  • When user has Internet connectivity, check all requests in SmartStore which have isSynced set to false and sync these with Salesforce.

  • If a sample request signature is synced to Salesforce, set it’s isSynced flag to true so it’s not processed in the next offline run


One of the key objectives of this challenge is that the app app must demonstrate that it’s possible to send large number of signature data in an asynchronous and real time manner.

 

Resources on SmartStore/ Syncing

https://developer.salesforce.com/blogs/developer-relations/2012/11/using-smartstore-with-native-ios.html

https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/entity_framework_native_using.htm

 



Final Submission Guidelines

1.  Please include you code in a single ziped file, starting from the code provided in the forums.  

2.  Please provide a video of your code in action, you may annotate the video if you are not comfortable with spoke English. The video is mandatory and reviewers are expected to score you down if it's not provided

3. Provide a deployment guide with complete instructions to run and how to verify the requirements on your submission.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30052916