Skip to content

Commit

Permalink
Merge pull request #823 from ably/multi-platform
Browse files Browse the repository at this point in the history
Multi platform
  • Loading branch information
ricardopereira authored Jan 9, 2019
2 parents c67eabb + 65f739c commit 24cca64
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 25 deletions.
8 changes: 5 additions & 3 deletions Ably.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions Source/ARTDeviceIdentityTokenDetails.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 2 additions & 1 deletion Source/ARTPush.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#import <Foundation/Foundation.h>
#import <Ably/ARTTypes.h>
#import <Ably/ARTPushAdmin.h>

@class ARTRest;
@class ARTRealtime;
@class ARTPushAdmin;
@class ARTDeviceDetails;
@class ARTDeviceIdentityTokenDetails;

Expand Down Expand Up @@ -61,6 +61,7 @@ NS_ASSUME_NONNULL_BEGIN

/// Unregister a device.
- (void)deactivate;

#endif

@end
Expand Down
3 changes: 2 additions & 1 deletion Source/ARTPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions Source/ARTPushActivationEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 3 additions & 0 deletions Source/ARTPushActivationState.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
7 changes: 1 addition & 6 deletions Source/ARTPushAdmin+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// Copyright © 2017 Ably. All rights reserved.
//

#ifndef ARTPushAdmin_Private_h
#define ARTPushAdmin_Private_h

#import <Ably/ARTPushAdmin.h>

@class ARTRest;
Expand All @@ -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 */
4 changes: 2 additions & 2 deletions Source/ARTPushAdmin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Source/ARTPushAdmin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ARTPushChannelSubscriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Source/ARTPushChannelSubscriptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion Source/ARTPushDeviceRegistrations.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Source/ARTPushDeviceRegistrations.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 24cca64

Please sign in to comment.