Skip to content

Commit 4017960

Browse files
authored
Allow ios backup: Apply @tiltshift's patch
This is being applied to @craftzdog's master v3.6.2 (commit 64ec364). Here's the patch, a PR which has yet to be approved... craftzdog#108
1 parent 64ec364 commit 4017960

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ios/RNSqlite2.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ -(void)pluginInitialize {
3131
dbQueues = [NSMutableDictionary dictionaryWithCapacity:0];
3232
NSString *dbDir = [self getDatabaseDir];
3333

34-
// create "NoCloud" if it doesn't exist
34+
// create storage directory if it doesn't exist
3535
[[NSFileManager defaultManager] createDirectoryAtPath: dbDir
3636
withIntermediateDirectories: NO
3737
attributes: nil
3838
error: nil];
39-
// make it non-syncable to iCloud
40-
NSURL *url = [ NSURL fileURLWithPath: dbDir];
41-
[url setResourceValue: [NSNumber numberWithBool: YES]
42-
forKey: NSURLIsExcludedFromBackupKey
43-
error: nil];
39+
4440
}
4541

4642
- (dispatch_queue_t)getDatabaseQueue:(NSString *)dbName {
@@ -53,8 +49,10 @@ - (dispatch_queue_t)getDatabaseQueue:(NSString *)dbName {
5349
}
5450

5551
-(NSString*) getDatabaseDir {
56-
NSString *libDir = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex: 0];
57-
return [libDir stringByAppendingPathComponent:@"NoCloud"];
52+
NSString *appSupportDir = nil;
53+
appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) objectAtIndex: 0];
54+
NSString *appBundleID = [[NSBundle mainBundle] bundleIdentifier];
55+
return [NSString stringWithFormat:@"%@/%@", appSupportDir, appBundleID];
5856
}
5957

6058
-(id) getPathForDB:(NSString *)dbName {

0 commit comments

Comments
 (0)