You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/08/24 02:19:42 UTC

[7/7] ios commit: [ios] On iOS6, set UserDefaults and don't use the LocalStorage Plugin to persists WebStorage

[ios] On iOS6, set UserDefaults and don't use the LocalStorage Plugin to persists WebStorage


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/ab390322
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/ab390322
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/ab390322

Branch: refs/heads/master
Commit: ab39032287aa87658941a7ab8229613aa5e8e33a
Parents: 5c4b670
Author: Michal Mocny <mm...@gmail.com>
Authored: Mon Aug 20 14:15:47 2012 -0400
Committer: Michal Mocny <mm...@gmail.com>
Committed: Mon Aug 20 15:27:16 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ab390322/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 6add9af..71c35a5 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -219,11 +219,14 @@
     }
     
     /*
-     * Fire up CDVLocalStorage to work-around iOS 5.1 WebKit storage limitations
+     * Fire up CDVLocalStorage on iOS 5.1 to work-around WebKit storage limitations, or adjust set user defaults on iOS 6.0+
      */
-
     if (backupWebStorage) {
-        [self.commandDelegate registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVLocalStorage class])];
+        if (IsAtLeastiOSVersion(@"6.0")) {
+            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitStoreWebDataForBackup"];
+        } else {
+            [self.commandDelegate registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVLocalStorage class])];
+        }
     }
     
     /*