Skip to content

Commit 32a0c18

Browse files
author
Edward Smith
committed
Fixed some tests.
1 parent 9b6c045 commit 32a0c18

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Branch-SDK-Tests/Branch-SDK-Tests/BNCKeyChain.Test.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ - (void)testKeyChain {
8383
}
8484

8585
- (void) testSecurityAccessGroup {
86+
if ([UIApplication sharedApplication] == nil) {
87+
NSLog(@"No host application for keychain testing!");
88+
return;
89+
}
8690
NSString *group = [BNCKeyChain securityAccessGroup];
8791
XCTAssert(group.length > 0);
8892
}

Branch-SDK/Branch-SDK/BNCKeyChain.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ + (NSString*_Nullable) securityAccessGroup {
221221
static NSString*_securityAccessGroup = nil;
222222
if (_securityAccessGroup) return _securityAccessGroup;
223223

224+
// First store a value:
225+
NSError*error = [self storeValue:@"Value" forService:@"BranchKeychainService" key:@"Temp" cloudAccessGroup:nil];
226+
if (error) BNCLogDebugSDK(@"Error storing temp value: %@.", error);
227+
224228
NSDictionary* dictionary = @{
225229
(__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword,
226230
(__bridge id)kSecReturnAttributes: (__bridge id)kCFBooleanTrue,

0 commit comments

Comments
 (0)