IOSAD-150 Returning app group container URL. IOSAD-150
authorDirk Zimmermann <dz@pep.security>
Wed, 09 Oct 2019 09:30:57 +0200
branchIOSAD-150
changeset 1305af8a3f033c00
parent 1304 0f6add4c3cce
child 1306 9c7c1c67b789
IOSAD-150 Returning app group container URL.
pEpObjCAdapter/PEPObjCAdapter.m
     1.1 --- a/pEpObjCAdapter/PEPObjCAdapter.m	Wed Oct 09 09:30:57 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPObjCAdapter.m	Wed Oct 09 09:30:57 2019 +0200
     1.3 @@ -90,37 +90,8 @@
     1.4      NSString *appGroupId = @"group.security.pep.pep4ios";
     1.5      NSFileManager *fm = [NSFileManager defaultManager];
     1.6      NSURL *containerUrl = [fm containerURLForSecurityApplicationGroupIdentifier:appGroupId];
     1.7 -    NSLog(@"containerUrl |%@|", containerUrl);
     1.8 -
     1.9 -    NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
    1.10 -    if (!bundleID) {
    1.11 -        // This can happen in unit tests
    1.12 -        bundleID = @"test";
    1.13 -    }
    1.14 -    NSURL *dirPath = nil;
    1.15 -    
    1.16 -    // Find the application support directory in the home directory.
    1.17 -    NSArray *appSupportDir = [fm URLsForDirectory:NSApplicationSupportDirectory
    1.18 -                                        inDomains:NSUserDomainMask];
    1.19 -    if ([appSupportDir count] > 0)
    1.20 -    {
    1.21 -        // Append the bundle ID to the URL for the
    1.22 -        // Application Support directory.
    1.23 -        // Mainly needed for OS X, but doesn't do any harm on iOS
    1.24 -        dirPath = [[appSupportDir objectAtIndex:0] URLByAppendingPathComponent:bundleID];
    1.25 -        
    1.26 -        // If the directory does not exist, this method creates it.
    1.27 -        // This method is only available in OS X v10.7 and iOS 5.0 or later.
    1.28 -        NSError *theError = nil;
    1.29 -        if (![fm createDirectoryAtURL:dirPath withIntermediateDirectories:YES
    1.30 -                           attributes:nil error:&theError])
    1.31 -        {
    1.32 -            // Handle the error.
    1.33 -            return nil;
    1.34 -        }
    1.35 -    }
    1.36 -    
    1.37 -    return dirPath;
    1.38 +    NSLog(@"containerUrl '%@'", containerUrl);
    1.39 +    return containerUrl;
    1.40  }
    1.41  
    1.42  /**