Skip to content

Commit

Permalink
CORE-2024 correct available check for tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-branch committed Oct 12, 2021
1 parent 3aba4a2 commit 2eb0268
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Branch-SDK/BNCKeyChain.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ + (NSDate *) retrieveDateForService:(NSString *)service key:(NSString *)key erro
id value = nil;
if (valueData) {
@try {
if (@available(iOS 12.0, *)) {
if (@available(iOS 11.0, tvOS 11.0, *)) {
value = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSDate class] fromData:(__bridge NSData*)valueData error:NULL];
} else {
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000
Expand Down Expand Up @@ -120,7 +120,7 @@ + (NSError *) storeDate:(NSDate *)date

NSData* valueData = nil;
@try {
if (@available( iOS 12.0, *)) {
if (@available(iOS 11.0, tvOS 11.0, *)) {
valueData = [NSKeyedArchiver archivedDataWithRootObject:date requiringSecureCoding:YES error:NULL];
} else {
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000
Expand Down
4 changes: 2 additions & 2 deletions Branch-SDK/BNCPreferenceHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ - (void)persistPrefsToDisk {
if (!self.persistenceDict) return;
NSData *data = nil;
@try {
if (@available( iOS 12.0, *)) {
if (@available(iOS 11.0, tvOS 11.0, *)) {
data = [NSKeyedArchiver archivedDataWithRootObject:self.persistenceDict requiringSecureCoding:YES error:NULL];
} else {
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000
Expand Down Expand Up @@ -787,7 +787,7 @@ - (NSMutableDictionary *)persistenceDict {
NSError *error = nil;
NSData *data = [NSData dataWithContentsOfURL:self.class.URLForPrefsFile options:0 error:&error];
if (!error && data) {
if (@available(iOS 12.0, *)) {
if (@available(iOS 11.0, tvOS 11.0, *)) {
persistenceDict = [NSKeyedUnarchiver unarchivedObjectOfClass:[BNCServerRequest class] fromData:data error:NULL];
} else {
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000
Expand Down
4 changes: 2 additions & 2 deletions Branch-SDK/BNCServerRequestQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ - (NSData *)oldArchiveQueue:(NSArray<BNCServerRequest *> *)queue {
- (NSData *)archiveObject:(NSObject *)object {
NSData *data = nil;
NSError *error = nil;
if (@available(iOS 12.0, *)) {
if (@available(iOS 11.0, tvOS 11.0, *)) {
data = [NSKeyedArchiver archivedDataWithRootObject:object requiringSecureCoding:YES error:&error];

if (!data && error) {
Expand Down Expand Up @@ -381,7 +381,7 @@ - (void)retrieve {

- (id)unarchiveObjectFromData:(NSData *)data {
id object = nil;
if (@available(iOS 12.0, *)) {
if (@available(iOS 11.0, tvOS 11.0, *)) {
object = [NSKeyedUnarchiver unarchivedObjectOfClasses:[BNCServerRequestQueue encodableClasses] fromData:data error:nil];

} else {
Expand Down

0 comments on commit 2eb0268

Please sign in to comment.