I would suggest writing a custom plugin and store the settings properly in the Objective-C user defaults.
LocalStorage is not permanent storage, and WebSQL seems like overkill for storing settings.
You don't have to get too involved in Objective-C and there are good Phonegap/Cordova plugin guides:
http://docs.phonegap.com/en/3.3.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide
I use this code to store a "FirstRun" variable to check if the app is a new install. The plugin checks if the app has been run before, and returns 1 or 0, which is parsed to an integer and evaluated as true/false.
You could update this code and add more methods to the "AppChecks" class. I put all simple checks and setting storage in this class.
AppChecks.h
#import <Cordova/CDVPlugin.h>
@interface AppChecks : CDVPlugin
- (void) checkFirstRun:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
@end
AppChecks.m
#import "AppChecks.h"
#import <Cordova/CDVPluginResult.h>
@implementation AppChecks
- (void) checkFirstRun:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options {
NSString* callbackId = [arguments objectAtIndex:0];
CDVPluginResult* pluginResult = nil;
NSString* javaScript = nil;
@try {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *isFirstRun = @"1";
if (![defaults objectForKey:@"firstRun"]) {
[defaults setObject:[NSDate date] forKey:@"firstRun"];
} else {
isFirstRun = @"0";
}
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:isFirstRun];
javaScript = [pluginResult toSuccessCallbackString:callbackId];
} @catch (NSException* exception) {
// could not get locale
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_JSON_EXCEPTION messageAsString:[exception reason]];
javaScript = [pluginResult toErrorCallbackString:callbackId];
}
[self writeJavascript:javaScript];
}
@end
Used in my Javascript code:
cordova.exec(
function( isFirstRun ) {
isFirstRun = parseInt( isFirstRun );
if( isFirstRun ) {
// do stuff for first run
}
},
function(err) {
// handle error from plugin
},
"AppChecks",
"checkFirstRun",
[]
);