Skip to content

Commit

Permalink
Made ARTDevicePushDetails properties readonly and made both `ARTDev…
Browse files Browse the repository at this point in the history
…iceDetails` and `ARTDevicePushDetails` sendable.
  • Loading branch information
maratal committed Sep 3, 2024
1 parent daacb62 commit dc8f168
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
8 changes: 8 additions & 0 deletions Ably.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@
84039A4C2C811F49001C053E /* ARTChannelOptions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 84039A4B2C811F49001C053E /* ARTChannelOptions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
84039A4D2C811F49001C053E /* ARTChannelOptions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 84039A4B2C811F49001C053E /* ARTChannelOptions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
84039A4E2C811F49001C053E /* ARTChannelOptions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 84039A4B2C811F49001C053E /* ARTChannelOptions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
840FCE532C875B8A001163E1 /* ARTDevicePushDetails+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 840FCE522C875B8A001163E1 /* ARTDevicePushDetails+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
840FCE542C875B8A001163E1 /* ARTDevicePushDetails+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 840FCE522C875B8A001163E1 /* ARTDevicePushDetails+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
840FCE552C875B8A001163E1 /* ARTDevicePushDetails+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 840FCE522C875B8A001163E1 /* ARTDevicePushDetails+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
841134782722205400CFA837 /* ARTArchiveTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 841134772722205400CFA837 /* ARTArchiveTests.m */; };
8412FDE72661AC37001FE9E6 /* AblyDeltaCodec.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8412FDE12661AC37001FE9E6 /* AblyDeltaCodec.xcframework */; };
8412FDED2661AC37001FE9E6 /* msgpack.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8412FDE32661AC37001FE9E6 /* msgpack.xcframework */; };
Expand Down Expand Up @@ -1236,6 +1239,7 @@
56190953238C3D3200A862A6 /* CryptoTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CryptoTest.m; sourceTree = "<group>"; };
80E519C62BBCBE20006545B4 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
84039A4B2C811F49001C053E /* ARTChannelOptions+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "ARTChannelOptions+Private.h"; path = "PrivateHeaders/Ably/ARTChannelOptions+Private.h"; sourceTree = "<group>"; };
840FCE522C875B8A001163E1 /* ARTDevicePushDetails+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "ARTDevicePushDetails+Private.h"; path = "PrivateHeaders/Ably/ARTDevicePushDetails+Private.h"; sourceTree = "<group>"; };
841134772722205400CFA837 /* ARTArchiveTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ARTArchiveTests.m; sourceTree = "<group>"; };
8412FDE12661AC37001FE9E6 /* AblyDeltaCodec.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = AblyDeltaCodec.xcframework; path = Carthage/Build/AblyDeltaCodec.xcframework; sourceTree = "<group>"; };
8412FDE32661AC37001FE9E6 /* msgpack.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = msgpack.xcframework; path = Carthage/Build/msgpack.xcframework; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2162,6 +2166,7 @@
844B9CCE2C807BC400A260E8 /* ARTDeviceDetails+Private.h */,
D7B621931E4A6FE600684474 /* ARTDeviceDetails.m */,
D768C6AA1E4B5B0200436011 /* ARTDevicePushDetails.h */,
840FCE522C875B8A001163E1 /* ARTDevicePushDetails+Private.h */,
D768C6AB1E4B5B0200436011 /* ARTDevicePushDetails.m */,
D777EEDE206285CF002EBA03 /* ARTDeviceIdentityTokenDetails.h */,
2124B7A229DB153500AD8361 /* ARTDeviceIdentityTokenDetails+Private.h */,
Expand Down Expand Up @@ -2243,6 +2248,7 @@
EB2D84F71CD75CCE00F23CDA /* ARTReachability.h in Headers */,
D73B655523EF2B2900D459A6 /* ARTDeltaCodec.h in Headers */,
1C1EC3FA1AE26A8B00AAADD7 /* ARTStatus.h in Headers */,
840FCE532C875B8A001163E1 /* ARTDevicePushDetails+Private.h in Headers */,
D70EAAED1BC3376200CD8B9E /* ARTRestChannel.h in Headers */,
96BF61581A35B52C004CF2B3 /* ARTHttp.h in Headers */,
96BF61641A35CDE1004CF2B3 /* ARTBaseMessage.h in Headers */,
Expand Down Expand Up @@ -2484,6 +2490,7 @@
D710D51621949C42008F54AD /* ARTPush.h in Headers */,
D737F827263AF4CE0064FA05 /* ARTFallbackHosts.h in Headers */,
D710D4D521949BF9008F54AD /* ARTRealtimeChannel.h in Headers */,
840FCE542C875B8A001163E1 /* ARTDevicePushDetails+Private.h in Headers */,
21276CBB29EF323100107B5F /* ARTContinuousClock.h in Headers */,
D710D51721949C42008F54AD /* ARTPushChannel.h in Headers */,
D710D51E21949C42008F54AD /* ARTLocalDeviceStorage.h in Headers */,
Expand Down Expand Up @@ -2653,6 +2660,7 @@
D710D52821949C44008F54AD /* ARTPush.h in Headers */,
D737F828263AF4CE0064FA05 /* ARTFallbackHosts.h in Headers */,
D710D4E521949BFB008F54AD /* ARTRealtimeChannel.h in Headers */,
840FCE552C875B8A001163E1 /* ARTDevicePushDetails+Private.h in Headers */,
21276CBC29EF323100107B5F /* ARTContinuousClock.h in Headers */,
D710D52921949C44008F54AD /* ARTPushChannel.h in Headers */,
D710D53021949C44008F54AD /* ARTLocalDeviceStorage.h in Headers */,
Expand Down
3 changes: 2 additions & 1 deletion Source/ARTDevicePushDetails.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "ARTDevicePushDetails.h"
#import "ARTPush.h"
#import "ARTDevicePushDetails.h"
#import "ARTDevicePushDetails+Private.h"

@implementation ARTDevicePushDetails

Expand Down
1 change: 1 addition & 0 deletions Source/ARTJsonLikeEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#import "ARTDeviceDetails+Private.h"
#import "ARTDeviceIdentityTokenDetails.h"
#import "ARTDevicePushDetails.h"
#import "ARTDevicePushDetails+Private.h"
#import "ARTConnectionDetails.h"
#import "ARTRest+Private.h"
#import "ARTJsonEncoder.h"
Expand Down
1 change: 1 addition & 0 deletions Source/Ably.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ framework module Ably {
header "ARTFallbackHosts.h"
header "ARTLocalDevice+Private.h"
header "ARTDeviceDetails+Private.h"
header "ARTDevicePushDetails+Private.h"
header "ARTPush+Private.h"
header "ARTPushAdmin+Private.h"
header "ARTPushDeviceRegistrations+Private.h"
Expand Down
15 changes: 15 additions & 0 deletions Source/PrivateHeaders/Ably/ARTDevicePushDetails+Private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#import <Ably/ARTDevicePushDetails.h>

@class ARTErrorInfo;

NS_ASSUME_NONNULL_BEGIN

@interface ARTDevicePushDetails ()

@property (nonatomic, readwrite) NSMutableDictionary<NSString *, NSObject *> *recipient;
@property (nullable, nonatomic, readwrite) NSString *state;
@property (nullable, nonatomic, readwrite) ARTErrorInfo *errorReason;

@end

NS_ASSUME_NONNULL_END
1 change: 1 addition & 0 deletions Source/include/Ably/ARTDeviceDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Contains the properties of a device registered for push notifications.
*/
NS_SWIFT_SENDABLE
@interface ARTDeviceDetails : NSObject

/**
Expand Down
7 changes: 4 additions & 3 deletions Source/include/Ably/ARTDevicePushDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Contains the details of the push registration of a device.
*/
NS_SWIFT_SENDABLE
@interface ARTDevicePushDetails : NSObject

/**
* A JSON object of key-value pairs that contains of the push transport and address.
*/
@property (nonatomic) NSMutableDictionary<NSString *, NSObject *> *recipient;
@property (nonatomic, readonly) NSMutableDictionary<NSString *, NSObject *> *recipient;

/**
* The current state of the push registration.
*/
@property (nullable, nonatomic) NSString *state;
@property (nullable, nonatomic, readonly) NSString *state;

/**
* An `ARTErrorInfo` object describing the most recent error when the `state` is `Failing` or `Failed`.
*/
@property (nullable, nonatomic) ARTErrorInfo *errorReason;
@property (nullable, nonatomic, readonly) ARTErrorInfo *errorReason;

/// :nodoc:
- (instancetype)init;
Expand Down

0 comments on commit dc8f168

Please sign in to comment.