Skip to content

Commit 2eb0268

Browse files
committed
CORE-2024 correct available check for tvOS
1 parent 3aba4a2 commit 2eb0268

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Branch-SDK/BNCKeyChain.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ + (NSDate *) retrieveDateForService:(NSString *)service key:(NSString *)key erro
9292
id value = nil;
9393
if (valueData) {
9494
@try {
95-
if (@available(iOS 12.0, *)) {
95+
if (@available(iOS 11.0, tvOS 11.0, *)) {
9696
value = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSDate class] fromData:(__bridge NSData*)valueData error:NULL];
9797
} else {
9898
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000
@@ -120,7 +120,7 @@ + (NSError *) storeDate:(NSDate *)date
120120

121121
NSData* valueData = nil;
122122
@try {
123-
if (@available( iOS 12.0, *)) {
123+
if (@available(iOS 11.0, tvOS 11.0, *)) {
124124
valueData = [NSKeyedArchiver archivedDataWithRootObject:date requiringSecureCoding:YES error:NULL];
125125
} else {
126126
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000

Branch-SDK/BNCPreferenceHelper.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ - (void)persistPrefsToDisk {
744744
if (!self.persistenceDict) return;
745745
NSData *data = nil;
746746
@try {
747-
if (@available( iOS 12.0, *)) {
747+
if (@available(iOS 11.0, tvOS 11.0, *)) {
748748
data = [NSKeyedArchiver archivedDataWithRootObject:self.persistenceDict requiringSecureCoding:YES error:NULL];
749749
} else {
750750
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000
@@ -787,7 +787,7 @@ - (NSMutableDictionary *)persistenceDict {
787787
NSError *error = nil;
788788
NSData *data = [NSData dataWithContentsOfURL:self.class.URLForPrefsFile options:0 error:&error];
789789
if (!error && data) {
790-
if (@available(iOS 12.0, *)) {
790+
if (@available(iOS 11.0, tvOS 11.0, *)) {
791791
persistenceDict = [NSKeyedUnarchiver unarchivedObjectOfClass:[BNCServerRequest class] fromData:data error:NULL];
792792
} else {
793793
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 12000

Branch-SDK/BNCServerRequestQueue.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ - (NSData *)oldArchiveQueue:(NSArray<BNCServerRequest *> *)queue {
324324
- (NSData *)archiveObject:(NSObject *)object {
325325
NSData *data = nil;
326326
NSError *error = nil;
327-
if (@available(iOS 12.0, *)) {
327+
if (@available(iOS 11.0, tvOS 11.0, *)) {
328328
data = [NSKeyedArchiver archivedDataWithRootObject:object requiringSecureCoding:YES error:&error];
329329

330330
if (!data && error) {
@@ -381,7 +381,7 @@ - (void)retrieve {
381381

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

387387
} else {

0 commit comments

Comments
 (0)