incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [6/7] ios commit: [ios] On iOS6, set UserDefaults and don't use the LocalStorage Plugin to persists WebStorage
Date Fri, 24 Aug 2012 00:19:42 GMT
[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/b7741dca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/b7741dca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/b7741dca

Branch: refs/heads/master
Commit: b7741dca88d16f197d05b5ef0f0e4454bca50f29
Parents: 242837e
Author: Michal Mocny <mmocny@gmail.com>
Authored: Mon Aug 20 14:15:47 2012 -0400
Committer: Michal Mocny <mmocny@gmail.com>
Committed: Tue Aug 21 12:51:39 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/b7741dca/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index f3b1d73..9ce1d45 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -220,11 +220,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])];
+        }
     }
     
     /*


Mime
View raw message