Merge branch 'charlesmchen/testsVsNSUserDefaults'
This commit is contained in:
commit
910fa11ada
@ -293,6 +293,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return [groupContainerDirectoryURL path];
|
||||
}
|
||||
|
||||
- (NSUserDefaults *)appUserDefaults
|
||||
{
|
||||
return [[NSUserDefaults alloc] initWithSuiteName:SignalApplicationGroup];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic) SSKTestKeychainStorage *testKeychainStorage;
|
||||
@property (nonatomic) NSString *mockAppDocumentDirectoryPath;
|
||||
@property (nonatomic) NSString *mockAppSharedDataDirectoryPath;
|
||||
@property (nonatomic) NSUserDefaults *appUserDefaults;
|
||||
|
||||
@end
|
||||
|
||||
@ -37,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
NSString *temporaryDirectory = OWSTemporaryDirectory();
|
||||
self.mockAppDocumentDirectoryPath = [temporaryDirectory stringByAppendingPathComponent:NSUUID.UUID.UUIDString];
|
||||
self.mockAppSharedDataDirectoryPath = [temporaryDirectory stringByAppendingPathComponent:NSUUID.UUID.UUIDString];
|
||||
|
||||
self.appUserDefaults = [[NSUserDefaults alloc] init];
|
||||
_appLaunchTime = [NSDate new];
|
||||
|
||||
return self;
|
||||
|
||||
@ -100,6 +100,8 @@ NSString *NSStringForUIApplicationState(UIApplicationState value);
|
||||
|
||||
- (NSString *)appSharedDataDirectoryPath;
|
||||
|
||||
- (NSUserDefaults *)appUserDefaults;
|
||||
|
||||
@end
|
||||
|
||||
id<AppContext> CurrentAppContext(void);
|
||||
|
||||
@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
+ (NSUserDefaults *)appUserDefaults
|
||||
{
|
||||
return [[NSUserDefaults alloc] initWithSuiteName:SignalApplicationGroup];
|
||||
return CurrentAppContext().appUserDefaults;
|
||||
}
|
||||
|
||||
+ (void)migrateToSharedUserDefaults
|
||||
|
||||
@ -229,6 +229,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return [groupContainerDirectoryURL path];
|
||||
}
|
||||
|
||||
- (NSUserDefaults *)appUserDefaults
|
||||
{
|
||||
return [[NSUserDefaults alloc] initWithSuiteName:SignalApplicationGroup];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
Loading…
Reference in New Issue
Block a user