diff --git a/Ably.podspec b/Ably.podspec index bbd7ed856..75f7055a6 100644 --- a/Ably.podspec +++ b/Ably.podspec @@ -11,15 +11,17 @@ Pod::Spec.new do |s| s.source = { :git => "/~https://github.com/ably/ably-ios.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/ablyrealtime' s.documentation_url = "https://www.ably.io/documentation" - s.platform = :ios, '8.0' + s.ios.deployment_target = '8.0' + s.tvos.deployment_target = '10.0' + s.osx.deployment_target = '10.10' s.requires_arc = true s.swift_version = '4.2' - s.source_files = 'Source/**/*.{h,m}' + s.source_files = 'Source/**/*.{h,m,swift}' s.private_header_files = 'Source/*+Private.h', 'Source/Private/*.h' s.module_map = 'Source/Ably.modulemap' s.dependency 'SocketRocketAblyFork', '0.5.2-ably-2' s.dependency 'MsgPackAblyFork', '0.2.0-ably-1' s.dependency 'KSCrashAblyFork', '1.15.18-ably-1' - s.dependency 'ULID', '1.0.4' + s.dependency 'ULID', '1.1.0' s.dependency 'SAMKeychain', '1.5.3' end diff --git a/Cartfile b/Cartfile index de538ec8d..139a57f0e 100644 --- a/Cartfile +++ b/Cartfile @@ -1,5 +1,5 @@ github "ably-forks/SocketRocket" == 0.5.2-ably-2 github "ably-forks/msgpack-objective-C" == 0.2.0-ably-1 github "ably-forks/KSCrash" == 1.15.18-ably-1 -github "whitesmith/ulid" == 1.0.4 +github "whitesmith/ulid" == 1.1.0 github "soffes/SAMKeychain" == 1.5.3 diff --git a/Cartfile.resolved b/Cartfile.resolved index 8394bb2dd..bd2783158 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,9 +1,9 @@ github "Quick/Nimble" "v7.3.1" github "Quick/Quick" "v1.3.2" github "SwiftyJSON/SwiftyJSON" "4.2.0" -github "ably-forks/KSCrash" "1.15.8-ably-2" +github "ably-forks/KSCrash" "1.15.18-ably-1" github "ably-forks/SocketRocket" "0.5.2-ably-2" github "ably-forks/msgpack-objective-C" "0.2.0-ably-1" github "soffes/SAMKeychain" "v1.5.3" github "whitesmith/Aspects" "1.4.2-ws1" -github "whitesmith/ulid" "1.0.4" +github "whitesmith/ulid" "1.1.0" diff --git a/README.md b/README.md index b5a46796c..36edde161 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ An iOS client library for [ably.io](https://www.ably.io), the realtime messaging This SDK is compatible with projects that target: -- iOS 9.0+ -- tvOS 9.0+ +- iOS 8.0+ +- tvOS 10.0+ - macOS 10.10+ We maintain compatibility and explicitly support these platform versions, including performing CI testing on all library revisions. diff --git a/Source/ARTDeviceIdentityTokenDetails.m b/Source/ARTDeviceIdentityTokenDetails.m index 4cfce4f37..63df5937c 100644 --- a/Source/ARTDeviceIdentityTokenDetails.m +++ b/Source/ARTDeviceIdentityTokenDetails.m @@ -86,6 +86,9 @@ - (NSData *)archive { } + (ARTDeviceIdentityTokenDetails *)unarchive:(NSData *)data { + if (!data) { + return nil; + } if (@available(macOS 10.13, iOS 11, tvOS 11, *)) { NSError *error; ARTDeviceIdentityTokenDetails *result = [NSKeyedUnarchiver unarchivedObjectOfClass:[self class] fromData:data error:&error]; diff --git a/Source/ARTPush.h b/Source/ARTPush.h index d7a870113..b79040786 100644 --- a/Source/ARTPush.h +++ b/Source/ARTPush.h @@ -8,10 +8,10 @@ #import #import -#import @class ARTRest; @class ARTRealtime; +@class ARTPushAdmin; @class ARTDeviceDetails; @class ARTDeviceIdentityTokenDetails; @@ -61,6 +61,7 @@ NS_ASSUME_NONNULL_BEGIN /// Unregister a device. - (void)deactivate; + #endif @end diff --git a/Source/ARTPush.m b/Source/ARTPush.m index e76477c90..c8cf408fb 100644 --- a/Source/ARTPush.m +++ b/Source/ARTPush.m @@ -17,6 +17,7 @@ #if TARGET_OS_IOS #import "ARTPushActivationStateMachine.h" #endif +#import "ARTPushAdmin.h" #import "ARTPushActivationEvent.h" #import "ARTClientOptions+Private.h" #import "ARTPushAdmin+Private.h" @@ -38,7 +39,7 @@ - (instancetype)init:(ARTRest *)rest { if (self = [super init]) { _rest = rest; _logger = [rest logger]; - _admin = [[ARTPushAdmin alloc] init:rest]; + _admin = [[ARTPushAdmin alloc] initWithRest:rest]; } return self; } diff --git a/Source/ARTPushActivationEvent.m b/Source/ARTPushActivationEvent.m index a80ed168e..7760580d7 100644 --- a/Source/ARTPushActivationEvent.m +++ b/Source/ARTPushActivationEvent.m @@ -54,6 +54,9 @@ - (NSData *)archive { } + (ARTPushActivationEvent *)unarchive:(NSData *)data { + if (!data) { + return nil; + } if (@available(macOS 10.13, iOS 11, tvOS 11, *)) { NSError *error; ARTPushActivationEvent *result = [NSKeyedUnarchiver unarchivedObjectOfClass:[self class] fromData:data error:&error]; diff --git a/Source/ARTPushActivationState.m b/Source/ARTPushActivationState.m index 50b0499fc..052efc69c 100644 --- a/Source/ARTPushActivationState.m +++ b/Source/ARTPushActivationState.m @@ -77,6 +77,9 @@ - (NSData *)archive { } + (ARTPushActivationState *)unarchive:(NSData *)data { + if (!data) { + return nil; + } if (@available(macOS 10.13, iOS 11, tvOS 11, *)) { NSError *error; ARTPushActivationState *result = [NSKeyedUnarchiver unarchivedObjectOfClass:[self class] fromData:data error:&error]; diff --git a/Source/ARTPushAdmin+Private.h b/Source/ARTPushAdmin+Private.h index 195f3020f..f8a36aa6d 100644 --- a/Source/ARTPushAdmin+Private.h +++ b/Source/ARTPushAdmin+Private.h @@ -6,9 +6,6 @@ // Copyright © 2017 Ably. All rights reserved. // -#ifndef ARTPushAdmin_Private_h -#define ARTPushAdmin_Private_h - #import @class ARTRest; @@ -17,10 +14,8 @@ NS_ASSUME_NONNULL_BEGIN @interface ARTPushAdmin () -- (instancetype)init:(ARTRest *)rest; +- (instancetype)initWithRest:(ARTRest *)rest; @end NS_ASSUME_NONNULL_END - -#endif /* ARTPushAdmin_Private_h */ diff --git a/Source/ARTPushAdmin.h b/Source/ARTPushAdmin.h index a9314b26b..6b287e6ee 100644 --- a/Source/ARTPushAdmin.h +++ b/Source/ARTPushAdmin.h @@ -21,8 +21,8 @@ NS_ASSUME_NONNULL_BEGIN /// Publish a push notification. - (void)publish:(ARTPushRecipient *)recipient data:(ARTJsonObject *)data callback:(nullable void (^)(ARTErrorInfo *_Nullable error))callback; -@property (nonatomic, readonly) ARTPushDeviceRegistrations* deviceRegistrations; -@property (nonatomic, readonly) ARTPushChannelSubscriptions* channelSubscriptions; +@property (nonatomic, readonly) ARTPushDeviceRegistrations *deviceRegistrations; +@property (nonatomic, readonly) ARTPushChannelSubscriptions *channelSubscriptions; @end diff --git a/Source/ARTPushAdmin.m b/Source/ARTPushAdmin.m index 2f7ef0b19..af4394c6b 100644 --- a/Source/ARTPushAdmin.m +++ b/Source/ARTPushAdmin.m @@ -22,12 +22,12 @@ @implementation ARTPushAdmin { dispatch_queue_t _queue; } -- (instancetype)init:(ARTRest *)rest { +- (instancetype)initWithRest:(ARTRest *)rest { if (self = [super init]) { _rest = rest; _logger = [rest logger]; - _deviceRegistrations = [[ARTPushDeviceRegistrations alloc] init:rest]; - _channelSubscriptions = [[ARTPushChannelSubscriptions alloc] init:rest]; + _deviceRegistrations = [[ARTPushDeviceRegistrations alloc] initWithRest:rest]; + _channelSubscriptions = [[ARTPushChannelSubscriptions alloc] initWithRest:rest]; _userQueue = rest.userQueue; _queue = rest.queue; } diff --git a/Source/ARTPushChannelSubscriptions.h b/Source/ARTPushChannelSubscriptions.h index 9a8680238..4fc351036 100644 --- a/Source/ARTPushChannelSubscriptions.h +++ b/Source/ARTPushChannelSubscriptions.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @interface ARTPushChannelSubscriptions : NSObject - (instancetype)init NS_UNAVAILABLE; -- (instancetype)init:(ARTRest *)rest; +- (instancetype)initWithRest:(ARTRest *)rest; - (void)save:(ARTPushChannelSubscription *)channelSubscription callback:(void (^)(ARTErrorInfo *_Nullable))callback; diff --git a/Source/ARTPushChannelSubscriptions.m b/Source/ARTPushChannelSubscriptions.m index 2e1d763dd..05d439114 100644 --- a/Source/ARTPushChannelSubscriptions.m +++ b/Source/ARTPushChannelSubscriptions.m @@ -25,7 +25,7 @@ @implementation ARTPushChannelSubscriptions { dispatch_queue_t _userQueue; } -- (instancetype)init:(ARTRest *)rest { +- (instancetype)initWithRest:(ARTRest *)rest { if (self = [super init]) { _rest = rest; _logger = [rest logger]; diff --git a/Source/ARTPushDeviceRegistrations.h b/Source/ARTPushDeviceRegistrations.h index 61c976cef..977f01a14 100644 --- a/Source/ARTPushDeviceRegistrations.h +++ b/Source/ARTPushDeviceRegistrations.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @interface ARTPushDeviceRegistrations : NSObject - (instancetype)init NS_UNAVAILABLE; -- (instancetype)init:(ARTRest *)rest; +- (instancetype)initWithRest:(ARTRest *)rest; - (void)save:(ARTDeviceDetails *)deviceDetails callback:(void (^)(ARTErrorInfo *_Nullable))callback; diff --git a/Source/ARTPushDeviceRegistrations.m b/Source/ARTPushDeviceRegistrations.m index f94e1b588..f2d6a1a14 100644 --- a/Source/ARTPushDeviceRegistrations.m +++ b/Source/ARTPushDeviceRegistrations.m @@ -26,7 +26,7 @@ @implementation ARTPushDeviceRegistrations { dispatch_queue_t _userQueue; } -- (instancetype)init:(ARTRest *)rest { +- (instancetype)initWithRest:(ARTRest *)rest { if (self = [super init]) { _rest = rest; _logger = [rest logger];