Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d96955d
update watchos in podspec
charlotteliang Oct 7, 2019
1e841e2
add watchOS in podspec
charlotteliang Oct 7, 2019
d288358
fix a few breakage from watchos
charlotteliang Oct 8, 2019
8262f55
fix
charlotteliang Oct 21, 2019
8bb8583
fix entitlements locatio for watch
charlotteliang Oct 22, 2019
b303e69
fix missing keychain logics for watch
charlotteliang Oct 23, 2019
eb85c84
add comments
charlotteliang Oct 28, 2019
79a3737
update bundle Identifier for independent watchOS
charlotteliang Nov 2, 2019
b2ca455
minor fix
charlotteliang Nov 7, 2019
e190be2
remove SystemConfiguration from podspec for now
charlotteliang Nov 7, 2019
b05f6a0
enable image/videos for notifications on watch
charlotteliang Nov 7, 2019
b834615
fix nits
charlotteliang Nov 7, 2019
c1b7405
fix format
charlotteliang Nov 8, 2019
51dbf68
update framework based on each platform
charlotteliang Nov 8, 2019
b3ff2fe
better naming and remove macro that is no longer needed
charlotteliang Nov 8, 2019
c565015
Merge branch 'master' of github.com:firebase/firebase-ios-sdk into fc…
charlotteliang Nov 19, 2019
ecb1de4
fix unit test in instanceID with latest ocmock
charlotteliang Nov 19, 2019
ec86598
Merge branch 'master' of github.com:firebase/firebase-ios-sdk into fc…
charlotteliang Nov 25, 2019
0474155
fix watch spec
charlotteliang Dec 4, 2019
322f651
Merge branch 'master' of github.com:firebase/firebase-ios-sdk into fc…
charlotteliang Dec 13, 2019
2fe1f54
exclude watchos from unit test
charlotteliang Dec 16, 2019
3ef0144
need to put __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 back as it break…
charlotteliang Dec 17, 2019
8e37bd3
adjust the macro
charlotteliang Dec 17, 2019
abccbea
limit all podspec unit test target to exclude watchos
charlotteliang Dec 17, 2019
d9f13c8
update google utilities podspec as well
charlotteliang Dec 19, 2019
f711c12
Merge branch 'master' of github.com:firebase/firebase-ios-sdk into fc…
charlotteliang Dec 19, 2019
3883653
add macro to supress deprecate warning inside watchos
charlotteliang Dec 19, 2019
1f079c8
fix macro for iOS 7 and lower warning
charlotteliang Dec 19, 2019
e278e8e
update .travis.yml to run google utilities pob lib lint on platform s…
charlotteliang Dec 20, 2019
4ad2fe9
Merge branch 'master' of github.com:firebase/firebase-ios-sdk into fc…
charlotteliang Dec 20, 2019
92db615
update GoogleUtilitiesCron
charlotteliang Dec 20, 2019
de191d3
enable watchos for installations
charlotteliang Dec 20, 2019
2469a4f
add a few comments and todo
charlotteliang Dec 20, 2019
ef6c930
disable unused code in watch and remove a property that is only used …
charlotteliang Dec 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,22 @@ jobs:
env:
- PROJECT=GoogleUtilities METHOD=pod-lib-lint
script:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please make the same change for the GoogleUtilitiesCron job below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. There are two cmds under GoogleUtilitiesCron so I split each of them to 3 platforms.

- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb GoogleUtilities.podspec
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --platforms=ios
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --platforms=tvos
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --platforms=macos

- stage: test
if: type = cron
env:
- PROJECT=GoogleUtilitiesCron METHOD=pod-lib-lint
script:

- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-libraries
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-modular-headers
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-libraries --platforms=ios
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-libraries --platforms=tvos
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-libraries --platforms=macos
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-modular-headers --platforms=ios
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-modular-headers --platforms=tvos
- travis_retry ./scripts/pod_lib_lint.rb GoogleUtilities.podspec --use-modular-headers --platforms=macos

- stage: test
env:
Expand Down
16 changes: 0 additions & 16 deletions Example/Messaging/Tests/FIRMessagingInstanceTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ class FIRMessagingInstanceTest: XCTestCase {
FirebaseApp.configure(options: options)
let original = Messaging.messaging()

// Ensure the client is set up as expected.
guard let isOrigClientSetup = original.value(forKey: "isClientSetup") as? Bool else {
XCTFail("Could not get internal Messaging variable `isClientSetup`.")
return
}

XCTAssertTrue(isOrigClientSetup, "Property `isClientSetup` should be true after creation.")

// Get and delete the default app.
guard let defaultApp = FirebaseApp.app() else {
XCTFail("Default app was not configured properly.")
Expand All @@ -54,13 +46,5 @@ class FIRMessagingInstanceTest: XCTestCase {
// Get another instance of Messaging, make sure it's not the same instance.
let postDelete = Messaging.messaging()
XCTAssertNotEqual(original, postDelete)

// Ensure the new client is set up as expected.
guard let isClientSetup = postDelete.value(forKey: "isClientSetup") as? Bool else {
XCTFail("Could not get internal Messaging variable `isClientSetup`.")
return
}

XCTAssertTrue(isClientSetup, "Property `isClientSetup` should be true after creation.")
}
}
6 changes: 3 additions & 3 deletions Firebase/Core/FIRApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -887,16 +887,16 @@ - (void)sendLogsWithServiceName:(NSString *)serviceName
- (void)subscribeForAppDidBecomeActiveNotifications {
#if TARGET_OS_IOS || TARGET_OS_TV
NSNotificationName notificationName = UIApplicationDidBecomeActiveNotification;
#endif

#if TARGET_OS_OSX
#elif TARGET_OS_OSX
NSNotificationName notificationName = NSApplicationDidBecomeActiveNotification;
#endif

#if !TARGET_OS_WATCH
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appDidBecomeActive:)
name:notificationName
object:nil];
#endif
}

- (void)appDidBecomeActive:(NSNotification *)notification {
Expand Down
20 changes: 9 additions & 11 deletions Firebase/InstanceID/FIRInstanceID.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
// change.
NSInteger const kMaxRetryCountForDefaultToken = 5;

#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
static NSString *const kEntitlementsAPSEnvironmentKey = @"Entitlements.aps-environment";
#else
static NSString *const kEntitlementsAPSEnvironmentKey = @"com.apple.developer.aps-environment";
static NSString *const kEntitlementsAPSEnvironmentKey =
@"Entitlements.com.apple.developer.aps-environment";
#endif
static NSString *const kEntitlementsKeyForMac = @"Entitlements";
static NSString *const kAPSEnvironmentDevelopmentValue = @"development";
/// FIRMessaging selector that returns the current FIRMessaging auto init
/// enabled flag.
Expand Down Expand Up @@ -617,10 +617,14 @@ - (void)configureInstanceIDWithOptions:(FIROptions *)options {
[self updateFirebaseInstallationID];

// FCM generates a FCM token during app start for sending push notification to device.
// This is not needed for app extension.
// This is not needed for app extension except for watch.
#if TARGET_OS_WATCH
[self didCompleteConfigure];
#else
if (![GULAppEnvironmentUtil isAppExtension]) {
[self didCompleteConfigure];
}
#endif
}

// This is used to start any operations when we receive FirebaseSDK setup notification
Expand Down Expand Up @@ -978,7 +982,7 @@ - (BOOL)isProductionApp {
// Apps distributed via AppStore or TestFlight use the Production APNS certificates.
return defaultAppTypeProd;
}
#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
NSString *path = [[[NSBundle mainBundle] bundlePath]
stringByAppendingPathComponent:@"embedded.mobileprovision"];
#elif TARGET_OS_OSX
Expand Down Expand Up @@ -1061,13 +1065,7 @@ - (BOOL)isProductionApp {
@"most likely a Dev profile.");
}

#if TARGET_OS_IOS || TARGET_OS_TV
NSString *apsEnvironment = [plistMap valueForKeyPath:kEntitlementsAPSEnvironmentKey];
#elif TARGET_OS_OSX
NSDictionary *entitlements = [plistMap valueForKey:kEntitlementsKeyForMac];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to confirm that plistMap does contain a value for valueForKeyPath:kEntitlementsAPSEnvironmentKey for macOS still.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we redefined this key at line 60 for macOS

#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
static NSString *const kEntitlementsAPSEnvironmentKey = @"Entitlements.aps-environment";
#else
static NSString *const kEntitlementsAPSEnvironmentKey =
@"Entitlements.com.apple.developer.aps-environment";
#endif

NSString *apsEnvironment = [entitlements valueForKey:kEntitlementsAPSEnvironmentKey];
#endif

NSString *debugString __unused =
[NSString stringWithFormat:@"APNS Environment in profile: %@", apsEnvironment];
FIRInstanceIDLoggerDebug(kFIRInstanceIDMessageCodeInstanceID013, @"%@", debugString);
Expand Down
4 changes: 2 additions & 2 deletions Firebase/InstanceID/FIRInstanceIDAuthKeyChain.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (NSMutableDictionary *)keychainQueryForService:(NSString *)service account:(NS
// FIRInstanceIDKeychain should only take a query and return a result, will handle the query here.
NSArray *passwordInfos =
CFBridgingRelease([[FIRInstanceIDKeychain sharedInstance] itemWithQuery:keychainQuery]);
#elif TARGET_OS_OSX
#elif TARGET_OS_OSX || TARGET_OS_WATCH
keychainQuery[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne;
NSData *passwordInfos =
CFBridgingRelease([[FIRInstanceIDKeychain sharedInstance] itemWithQuery:keychainQuery]);
Expand Down Expand Up @@ -120,7 +120,7 @@ - (NSMutableDictionary *)keychainQueryForService:(NSString *)service account:(NS
[results addObject:passwordInfo[(__bridge id)kSecValueData]];
}
}
#elif TARGET_OS_OSX
#elif TARGET_OS_OSX || TARGET_OS_WATCH
[results addObject:passwordInfos];
#endif
// We query the keychain because it didn't exist in cache, now query is done, update the result in
Expand Down
23 changes: 18 additions & 5 deletions Firebase/InstanceID/FIRInstanceIDUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,29 @@ int64_t FIRInstanceIDCurrentTimestampInMilliseconds() {
return version;
}

NSString *FIRInstanceIDBundleIDByRemovingLastPartFrom(NSString *bundleID) {
NSString *bundleIDComponentsSeparator = @".";

NSMutableArray<NSString *> *bundleIDComponents =
[[bundleID componentsSeparatedByString:bundleIDComponentsSeparator] mutableCopy];
[bundleIDComponents removeLastObject];

return [bundleIDComponents componentsJoinedByString:bundleIDComponentsSeparator];
}

NSString *FIRInstanceIDAppIdentifier() {
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
if (!bundleIdentifier.length) {
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
if (!bundleID.length) {
FIRInstanceIDLoggerError(kFIRInstanceIDMessageCodeUtilitiesMissingBundleIdentifier,
@"The mainBundle's bundleIdentifier returned '%@'. Bundle identifier "
@"expected to be non-empty.",
bundleIdentifier);
bundleID);
return @"";
}
return bundleIdentifier;
#if TARGET_OS_WATCH
return FIRInstanceIDBundleIDByRemovingLastPartFrom(bundleID);
#endif
return bundleID;
}

NSString *FIRInstanceIDFirebaseAppID() {
Expand All @@ -111,7 +124,7 @@ int64_t FIRInstanceIDCurrentTimestampInMilliseconds() {
NSString *FIRInstanceIDOperatingSystemVersion() {
#if TARGET_OS_IOS || TARGET_OS_TV
return [UIDevice currentDevice].systemVersion;
#elif TARGET_OS_OSX
#elif TARGET_OS_OSX || TARGET_OS_WATCH
return [NSProcessInfo processInfo].operatingSystemVersionString;
#endif
}
Expand Down
13 changes: 6 additions & 7 deletions Firebase/Messaging/FIRMessaging.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ @interface FIRMessaging ()<FIRMessagingClientDelegate, FIRMessagingReceiverDeleg

@property(nonatomic, readwrite, strong) FIRInstanceID *instanceID;

@property(nonatomic, readwrite, assign) BOOL isClientSetup;

@property(nonatomic, readwrite, strong) FIRMessagingClient *client;
@property(nonatomic, readwrite, strong) GULReachabilityChecker *reachability;
@property(nonatomic, readwrite, strong) FIRMessagingDataMessageManager *dataMessageManager;
Expand Down Expand Up @@ -270,6 +268,10 @@ - (void)configureNotificationSwizzlingIfEnabled {
}

- (void)start {
[self setupFileManagerSubDirectory];
[self setupNotificationListeners];

#if !TARGET_OS_WATCH
// Print the library version for logging.
NSString *currentLibraryVersion = FIRMessagingCurrentLibraryVersion();
FIRMessagingLoggerInfo(kFIRMessagingMessageCodeMessagingPrintLibraryVersion,
Expand All @@ -283,16 +285,14 @@ - (void)start {
withHost:hostname];
[self.reachability start];

[self setupFileManagerSubDirectory];
// setup FIRMessaging objects
[self setupRmqManager];
[self setupClient];
[self setupSyncMessageManager];
[self setupDataMessageManager];
[self setupTopics];

self.isClientSetup = YES;
[self setupNotificationListeners];
#endif
}

- (void)setupFileManagerSubDirectory {
Expand Down Expand Up @@ -373,7 +373,6 @@ - (void)teardown {
self.rmq2Manager = nil;
self.dataMessageManager = nil;
self.client = nil;
self.isClientSetup = NO;
FIRMessagingLoggerDebug(kFIRMessagingMessageCodeMessaging001, @"Did successfully teardown");
}

Expand Down Expand Up @@ -687,7 +686,7 @@ - (BOOL)isDirectChannelEstablished {
}

- (BOOL)shouldBeConnectedAutomatically {
#if TARGET_OS_OSX
#if TARGET_OS_OSX || TARGET_OS_WATCH
return NO;
#else
// We require a token from Instance ID
Expand Down
4 changes: 2 additions & 2 deletions Firebase/Messaging/FIRMessagingExtensionHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (void)populateNotificationContent:(UNMutableNotificationContent *)content
self.bestAttemptContent = content;

// The `userInfo` property isn't available on newer versions of tvOS.
#if TARGET_OS_IOS || TARGET_OS_OSX
#if TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_WATCH
NSString *currentImageURL = content.userInfo[kPayloadOptionsName][kPayloadOptionsImageURLName];
if (!currentImageURL) {
[self deliverNotification];
Expand All @@ -59,7 +59,7 @@ - (void)populateNotificationContent:(UNMutableNotificationContent *)content
#endif
}

#if TARGET_OS_IOS || TARGET_OS_OSX
#if TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_WATCH
- (void)loadAttachmentForURL:(NSURL *)attachmentURL
completionHandler:(void (^)(UNNotificationAttachment *))completionHandler {
__block UNNotificationAttachment *attachment = nil;
Expand Down
21 changes: 20 additions & 1 deletion Firebase/Messaging/FIRMessagingUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,27 @@ int64_t FIRMessagingCurrentTimestampInMilliseconds(void) {
return version;
}


NSString * FIRMessagingBundleIDByRemovingLastPartFrom(NSString *bundleID) {
NSString *bundleIDComponentsSeparator = @".";

NSMutableArray<NSString *> *bundleIDComponents =
[[bundleID componentsSeparatedByString:bundleIDComponentsSeparator] mutableCopy];
[bundleIDComponents removeLastObject];

return [bundleIDComponents componentsJoinedByString:bundleIDComponentsSeparator];
}

NSString *FIRMessagingAppIdentifier(void) {
return [[NSBundle mainBundle] bundleIdentifier];
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
#if TARGET_OS_WATCH
// The code is running in watchKit extension target but the actually bundleID is in the watchKit
// target. So we need to remove the last part of the bundle ID in watchKit extension to match
// the one in watchKit target.
return FIRMessagingBundleIDByRemovingLastPartFrom(bundleID);
#else
return bundleID;
#endif
}

uint64_t FIRMessagingGetFreeDiskSpaceInMB(void) {
Expand Down
2 changes: 2 additions & 0 deletions FirebaseAnalyticsInterop.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'

s.source_files = 'Interop/Analytics/**/*.h'
s.public_header_files = 'Interop/Analytics/Public/*.h'
end
2 changes: 2 additions & 0 deletions FirebaseCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
Expand All @@ -43,6 +44,7 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration
'OTHER_CFLAGS' => '-fno-autolink'
}
s.test_spec 'unit' do |unit_tests|
unit_tests.platforms = {:ios => '8.0', :osx => '10.11', :tvos => '10.0'}
unit_tests.source_files = 'Example/Core/Tests/**/*.[mh]'
unit_tests.requires_app_host = true
unit_tests.dependency 'OCMock'
Expand Down
2 changes: 2 additions & 0 deletions FirebaseCoreDiagnostics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ non-Cocoapod integration. This library also respects the Firebase global data co
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
Expand Down Expand Up @@ -51,6 +52,7 @@ non-Cocoapod integration. This library also respects the Firebase global data co
s.dependency 'nanopb', '~> 0.3.901'

s.test_spec 'unit' do |unit_tests|
unit_tests.platforms = {:ios => '8.0', :osx => '10.11', :tvos => '10.0'}
unit_tests.dependency 'GoogleUtilities/UserDefaults', '~> 6.2'
unit_tests.dependency 'OCMock'
unit_tests.source_files = 'Example/CoreDiagnostics/Tests/**/*.[mh]'
Expand Down
1 change: 1 addition & 0 deletions FirebaseCoreDiagnosticsInterop.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'
s.source_files = 'Interop/CoreDiagnostics/**/*.h'
s.public_header_files = 'Interop/CoreDiagnostics/Public/*.h'
end
2 changes: 2 additions & 0 deletions FirebaseInstallations.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
Expand Down Expand Up @@ -54,6 +55,7 @@ Pod::Spec.new do |s|
end

s.test_spec 'integration' do |int_tests|
int_tests.platforms = {:ios => '8.0', :osx => '10.11', :tvos => '10.0'}
int_tests.source_files = base_dir + 'Tests/Integration/**/*.[mh]'
int_tests.resources = base_dir + 'Tests/Resources/**/*'
if ENV['FIS_INTEGRATION_TESTS_REQUIRED'] && ENV['FIS_INTEGRATION_TESTS_REQUIRED'] == '1' then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ - (instancetype)initWithGCMSenderID:(NSString *)GCMSenderID {
unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&archiverError];
} else {
@try {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
#pragma clang diagnostic pop
} @catch (NSException *exception) {
archiverError = [FIRInstallationsErrorUtil keyedArchiverErrorWithException:exception];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ - (nullable NSData *)archiveDataForObject:(id<NSSecureCoding>)object error:(NSEr
} else {
@try {
NSMutableData *data = [NSMutableData data];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
#pragma clang diagnostic pop
archiver.requiresSecureCoding = YES;

[archiver encodeObject:object forKey:NSKeyedArchiveRootObjectKey];
Expand Down Expand Up @@ -232,7 +235,10 @@ - (nullable id)unarchivedObjectOfClass:(Class)class
}
} else {
@try {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
#pragma clang diagnostic pop
unarchiver.requiresSecureCoding = YES;

object = [unarchiver decodeObjectOfClass:class forKey:NSKeyedArchiveRootObjectKey];
Expand Down
Loading