4

I am new to SalesforceMobileSDK 2.0, I have developed a hybrid application via sencha touch 2.1 using smart store. The problem is that when I logout from salesforce, all data stored in soups destroys.

Is this default behaviour?

I need to save soup data for different-different users, then how can I achieve that with mobile sdk 2.0

  • I wouldn't expect that as default, no. What is your cache config? – joshbirk Aug 22 '13 at 17:20
  • "What is your cache config"? I didn't get it. Does hybrid app have any cache config file? If yes where? – Manish Kumar Aug 30 '13 at 6:06
6

This is by design, refer this bug for this issue on Github Force.com iOS SDK which was closed with the appropriate explanation - Github Issue 392

2

You'll need to post some code, since you're using Sencha Touch we're going to need to know what libraries you are using to control the SmartStore functionality. In the SDK2.0 which uses the ForceTK library, you need to tell what your cache flow is ... here's an example using a thin wrapper to Force called SmartObjectJS:

https://github.com/joshbirk/ScorecardMobile/blob/master/Scorecard/www/index.html

1

Yes its an default behavior. But you can use your own approach to store data locally. iOS has delegate method for application terminate event in that method you can perform database commit:

- (void)applicationWillTerminate:(UIApplication *)application

and for Android you can perform saving before calling finish()

Salesforce Mobile SDK for iOS and Android has SmartStore abstraction to SQLite, which uses FMDB on iOS and SQLCipher on Android. These facilities allows you to store data in JSON format locally on your device. And data can be retrieved by indexes.

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.