From d4df02b194f033feaec05311caadf4b8e81bd63e Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Mon, 18 Nov 2024 15:47:45 +0200 Subject: [PATCH] Add custom message type support (#461) feat(message-type): add custom message type support Add custom message type support for the following APIs: publish, signal, share file, subscribe and history. --- .github/workflows/run-tests.yml | 8 +- .pubnub.yml | 15 +- CHANGELOG.md | 6 + Framework/PubNub/Info.plist | 6 +- Framework/PubNub/PubNub-iOS-Info.plist | 6 +- Framework/PubNub/PubNub-tvOS-Info.plist | 6 +- Framework/PubNub/PubNub-watchOS-Info.plist | 6 +- PubNub.podspec | 2 +- PubNub/Core/PubNub+Files.m | 1 + PubNub/Core/PubNub+Publish.m | 23 +- .../History/PNHistoryAPICallBuilder.h | 12 + .../History/PNHistoryAPICallBuilder.m | 7 + .../Publish/PNPublishAPICallBuilder.h | 10 + .../Publish/PNPublishAPICallBuilder.m | 10 + .../PNPublishFileMessageAPICallBuilder.h | 10 + .../PNPublishFileMessageAPICallBuilder.m | 10 + .../API Call/Publish/PNSignalAPICallBuilder.h | 10 + .../API Call/Publish/PNSignalAPICallBuilder.m | 10 + PubNub/Misc/PNConstants.h | 2 +- .../Requests/Files/PNSendFileRequest.h | 6 + .../PNHistoryFetchRequest.h | 8 + .../PNHistoryFetchRequest.m | 5 + .../Requests/Publish/PNBasePublishRequest.h | 6 + .../Requests/Publish/PNBasePublishRequest.m | 3 +- .../Network/Requests/Signal/PNSignalRequest.h | 6 + .../Network/Requests/Signal/PNSignalRequest.m | 1 + .../Message Persistence/PNHistoryFetchData.m | 8 +- .../Subscribe/PNSubscribeFileEventData.h | 3 + .../Subscribe/PNSubscribeFileEventData.m | 3 +- .../Subscribe/PNSubscribeMessageEventData.h | 3 + .../Subscribe/PNSubscribeMessageEventData.m | 9 +- README.md | 2 +- Tests/Podfile | 5 +- Tests/Podfile.lock | 21 +- ...AndReceiveResultWithExpectedOperation.json | 4 +- ...TypeAndIncludeMessageActionsFlagIsSet.json | 1278 +++++++++++++++++ ...lToDecryptWhenDifferentCipherKeyIsSet.json | 4 +- ...WhenIncludeCustomMessageTypeFlagIsSet.json | 318 ++++ ...WhenIncludeCustomMessageTypeFlagIsSet.json | 580 ++++++++ ...thActionsUsingBuilderPatternInterface.json | 6 +- ...BuilderPatternInterfaceWhenLimitIsSet.json | 6 +- ...gesForEachChannelWithUsedBatchBuilder.json | 6 +- ...AndReceiveResultWithExpectedOperation.json | 4 +- ...ForEachChannelWithOutUUIDUsingBuilder.json | 6 +- ...ChannelAndReceiveMessageWhenPublished.json | 112 +- ...SingleChannelAndReceiveSignalWhenSent.json | 248 ++++ Tests/Tests/Helpers/PNRecordableTestCase.h | 33 + Tests/Tests/Helpers/PNRecordableTestCase.m | 46 +- .../Files/PNFilesIntegrationTests.m | 46 + .../Integration/PNHistoryIntegrationTests.m | 94 ++ .../Integration/PNSubscribeIntegrationTest.m | 47 +- VERSION | 2 +- 52 files changed, 2958 insertions(+), 131 deletions(-) create mode 100644 Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithCustomMessageTypeWhenIncludeCustomMessageTypeAndIncludeMessageActionsFlagIsSet.json create mode 100644 Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithoutCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json create mode 100644 Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelsWithCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json create mode 100644 Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveSignalWhenSent.json diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1bfbb32fc..1d45a74f2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -44,7 +44,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 3.2.2 - bundler-cache: true + bundler-cache: false - name: Setup CocoaPods run: gem install cocoapods - name: Cache installed Pods @@ -59,7 +59,7 @@ jobs: run: xcrun simctl list -j - name: Install dependencies run: | - gem install xcpretty + gem install xcpretty -v 0.3.0 cd ./Tests && pod install && cd .. - name: Configure test environment run: | @@ -81,7 +81,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 3.2.2 - bundler-cache: true + bundler-cache: false - name: Setup Node.js 20.x uses: actions/setup-node@v4 with: @@ -110,7 +110,7 @@ jobs: features-path: Tests/Support Files/Features - name: Install dependencies run: | - gem install xcpretty + gem install xcpretty -v 0.3.0 cd ./Tests && pod install && cd .. - name: Configure test environment run: ./Tests/Support\ Files/Scripts/create-configuration.sh diff --git a/.pubnub.yml b/.pubnub.yml index 86fde73e7..eb5f02b51 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,14 @@ --- name: objective-c scm: github.com/pubnub/objective-c -version: "5.6.1" +version: "5.7.0" schema: 1 changelog: + - date: 2024-11-18 + version: v5.7.0 + changes: + - type: feature + text: "Add custom message type support for the following APIs: publish, signal, share file, subscribe and history." - date: 2024-07-08 version: v5.6.1 changes: @@ -1365,7 +1370,7 @@ sdks: - distribution-type: source distribution-repository: GitHub release package-name: PubNub.framework - location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.6.1.zip + location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.7.0.zip supported-platforms: supported-operating-systems: macOS: @@ -1426,7 +1431,7 @@ sdks: - distribution-type: library distribution-repository: GitHub release package-name: PubNub.ios.xcframework.tar.gz - location: https://github.com/pubnub/objective-c/releases/download/v5.6.1/PubNub.ios.xcframework.tar.gz + location: https://github.com/pubnub/objective-c/releases/download/v5.7.0/PubNub.ios.xcframework.tar.gz supported-platforms: supported-operating-systems: iOS: @@ -1445,7 +1450,7 @@ sdks: - distribution-type: library distribution-repository: GitHub release package-name: PubNub.macos.framework.tar.gz - location: https://github.com/pubnub/objective-c/releases/download/v5.6.1/PubNub.macos.framework.tar.gz + location: https://github.com/pubnub/objective-c/releases/download/v5.7.0/PubNub.macos.framework.tar.gz supported-platforms: supported-operating-systems: macOS: @@ -1461,7 +1466,7 @@ sdks: - distribution-type: library distribution-repository: GitHub release package-name: PubNub.tvos.xcframework.tar.gz - location: https://github.com/pubnub/objective-c/releases/download/v5.6.1/PubNub.tvos.xcframework.tar.gz + location: https://github.com/pubnub/objective-c/releases/download/v5.7.0/PubNub.tvos.xcframework.tar.gz supported-platforms: supported-operating-systems: tvOS: diff --git a/CHANGELOG.md b/CHANGELOG.md index 615fb6ed9..d29ccaa3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v5.7.0 +November 18 2024 + +#### Added +- Add custom message type support for the following APIs: publish, signal, share file, subscribe and history. + ## v5.6.1 July 08 2024 diff --git a/Framework/PubNub/Info.plist b/Framework/PubNub/Info.plist index de50bfee2..90ba35cb6 100644 --- a/Framework/PubNub/Info.plist +++ b/Framework/PubNub/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 5.6.1 + 5.7.0 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.6.1 + 5.7.0 CFBundleSignature ???? CFBundleVersion - 5.6.1 + 5.7.0 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/Framework/PubNub/PubNub-iOS-Info.plist b/Framework/PubNub/PubNub-iOS-Info.plist index de50bfee2..90ba35cb6 100644 --- a/Framework/PubNub/PubNub-iOS-Info.plist +++ b/Framework/PubNub/PubNub-iOS-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 5.6.1 + 5.7.0 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.6.1 + 5.7.0 CFBundleSignature ???? CFBundleVersion - 5.6.1 + 5.7.0 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/Framework/PubNub/PubNub-tvOS-Info.plist b/Framework/PubNub/PubNub-tvOS-Info.plist index de50bfee2..90ba35cb6 100644 --- a/Framework/PubNub/PubNub-tvOS-Info.plist +++ b/Framework/PubNub/PubNub-tvOS-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 5.6.1 + 5.7.0 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.6.1 + 5.7.0 CFBundleSignature ???? CFBundleVersion - 5.6.1 + 5.7.0 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/Framework/PubNub/PubNub-watchOS-Info.plist b/Framework/PubNub/PubNub-watchOS-Info.plist index de50bfee2..90ba35cb6 100644 --- a/Framework/PubNub/PubNub-watchOS-Info.plist +++ b/Framework/PubNub/PubNub-watchOS-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 5.6.1 + 5.7.0 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.6.1 + 5.7.0 CFBundleSignature ???? CFBundleVersion - 5.6.1 + 5.7.0 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/PubNub.podspec b/PubNub.podspec index 1a65c0cea..ea73ff92f 100644 --- a/PubNub.podspec +++ b/PubNub.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.name = 'PubNub' - spec.version = '5.6.1' + spec.version = '5.7.0' spec.summary = 'The PubNub Real-Time Network. Build real-time apps quickly and scale them globally.' spec.homepage = 'https://github.com/pubnub/objective-c' diff --git a/PubNub/Core/PubNub+Files.m b/PubNub/Core/PubNub+Files.m index ced6082fb..3044b4c4b 100644 --- a/PubNub/Core/PubNub+Files.m +++ b/PubNub/Core/PubNub+Files.m @@ -499,6 +499,7 @@ - (void)handleUploadFileSuccessWithFileIdentifier:(NSString *)fileIdentifier fileIdentifier:fileIdentifier name:fileName]; request.arbitraryQueryParameters = sendFileRequest.arbitraryQueryParameters; + request.customMessageType = sendFileRequest.customMessageType; request.metadata = sendFileRequest.fileMessageMetadata; request.store = sendFileRequest.fileMessageStore; request.message = sendFileRequest.message; diff --git a/PubNub/Core/PubNub+Publish.m b/PubNub/Core/PubNub+Publish.m index a511de4e0..d8e0947c2 100644 --- a/PubNub/Core/PubNub+Publish.m +++ b/PubNub/Core/PubNub+Publish.m @@ -30,6 +30,7 @@ @interface PubNub (PublishProtected) /// - compressed Whether message should be compressed before sending or not. /// - replicate: Whether message should be replicated across the **PubNub** network and sent simultaneously to all /// subscribed clients on a channel. +/// - customMessageType: User-specified message type. /// - metadata: `NSDictionary` with values which should be used by **PubNub** network to filter messages. /// - queryParameters: List arbitrary query parameters which should be sent along with original API call. /// - block: Publish completion block which. @@ -40,6 +41,7 @@ - (void)publish:(nullable id)message ttl:(nullable NSNumber *)ttl compressed:(BOOL)compressed withReplication:(BOOL)replicate + customMessageType:(nullable NSString *)customMessageType metadata:(nullable NSDictionary *)metadata queryParameters:(nullable NSDictionary *)queryParameters completion:(nullable PNPublishCompletionBlock)block; @@ -55,10 +57,12 @@ - (void)publish:(nullable id)message /// - Parameters: /// - message Object (`NSString`, `NSNumber`, `NSArray`, `NSDictionary`) which will be sent with signal. /// - channel: Name of the channel to which signal should be sent. +/// - customMessageType: User-specified message type. /// - queryParameters: List arbitrary query parameters which should be sent along with original API call. /// - block: Signal completion block. - (void)signal:(id)message channel:(NSString *)channel + customMessageType:(nullable NSString *)customMessageType withQueryParameters:(nullable NSDictionary *)queryParameters completion:(nullable PNSignalCompletionBlock)block; @@ -132,12 +136,13 @@ @implementation PubNub (Publish) NSString *channel = parameters[NSStringFromSelector(@selector(channel))]; NSNumber *shouldStore = parameters[NSStringFromSelector(@selector(shouldStore))]; NSNumber *ttl = parameters[NSStringFromSelector(@selector(ttl))]; - + if (shouldStore && !shouldStore.boolValue) ttl = nil; PNPublishFileMessageRequest *request = [PNPublishFileMessageRequest requestWithChannel:channel fileIdentifier:identifier name:filename]; + request.customMessageType = parameters[NSStringFromSelector(@selector(customMessageType))]; request.metadata = parameters[NSStringFromSelector(@selector(metadata))]; request.message = parameters[NSStringFromSelector(@selector(message))]; request.arbitraryQueryParameters = parameters[@"queryParam"]; @@ -188,12 +193,17 @@ @implementation PubNub (Publish) __weak __typeof(self) weakSelf = self; builder = [PNSignalAPICallBuilder builderWithExecutionBlock:^(NSArray *flags, NSDictionary *parameters) { + NSString *customMessageType = parameters[NSStringFromSelector(@selector(customMessageType))]; id message = parameters[NSStringFromSelector(@selector(message))]; NSString *channel = parameters[NSStringFromSelector(@selector(channel))]; NSDictionary *queryParam = parameters[@"queryParam"]; id block = parameters[@"block"]; - [weakSelf signal:message channel:channel withQueryParameters:queryParam completion:block]; + [weakSelf signal:message + channel:channel + customMessageType:customMessageType + withQueryParameters:queryParam + completion:block]; }]; return ^PNSignalAPICallBuilder * { @@ -493,6 +503,7 @@ - (void)publish:(id)message ttl:nil compressed:compressed withReplication:YES + customMessageType:nil metadata:metadata queryParameters:nil completion:block]; @@ -505,12 +516,15 @@ - (void)publish:(id)message ttl:(NSNumber *)ttl compressed:(BOOL)compressed withReplication:(BOOL)replicate + customMessageType:(nullable NSString *)customMessageType metadata:(NSDictionary *)metadata queryParameters:(NSDictionary *)queryParameters completion:(PNPublishCompletionBlock)block { PNPublishRequest *request = [PNPublishRequest requestWithChannel:channel]; + request.arbitraryQueryParameters = queryParameters; + request.customMessageType = customMessageType; request.replicate = replicate; request.compress = compressed; request.metadata = metadata; @@ -554,15 +568,17 @@ - (void)sendSignalWithRequest:(PNSignalRequest *)userRequest completion:(PNSigna } - (void)signal:(id)message channel:(NSString *)channel withCompletion:(PNSignalCompletionBlock)block { - [self signal:message channel:channel withQueryParameters:nil completion:block]; + [self signal:message channel:channel customMessageType:nil withQueryParameters:nil completion:block]; } - (void)signal:(id)message channel:(NSString *)channel + customMessageType:(nullable NSString *)customMessageType withQueryParameters:(NSDictionary *)queryParameters completion:(PNSignalCompletionBlock)block { PNSignalRequest *request = [PNSignalRequest requestWithChannel:channel signal:message]; + request.customMessageType = customMessageType; request.arbitraryQueryParameters = queryParameters; [self sendSignalWithRequest:request completion:block]; } @@ -692,6 +708,7 @@ - (void)handlePublishBuilderExecutionWithFlags:(NSArray *)flags para ttl:ttl compressed:compressed.boolValue withReplication:(replicate ? replicate.boolValue : YES) + customMessageType:parameters[NSStringFromSelector(@selector(customMessageType))] metadata:parameters[NSStringFromSelector(@selector(metadata))] queryParameters:parameters[@"queryParam"] completion:parameters[@"block"]]; diff --git a/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.h b/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.h index a7d6d12f7..79f050339 100644 --- a/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.h +++ b/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.h @@ -76,6 +76,17 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, strong) PNHistoryAPICallBuilder * (^limit)(NSUInteger limit); +/** + * @brief Messages' custom type flag. + * + * @note Message / signal and file messages may contain user-provided type. + * + *@param includeCustomMessageType Whether custom message type should be included in response or not. + * + * @return API call configuration builder. + */ +@property (nonatomic, readonly, strong) PNHistoryAPICallBuilder * (^includeCustomMessageType)(BOOL includeCustomMessageType); + /** * @brief Events' time tokens presence flag. * @@ -91,6 +102,7 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, strong) PNHistoryAPICallBuilder * (^includeTimeToken)(BOOL includeTimeToken); + /** * @brief Events' metadata presence flag. * diff --git a/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.m b/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.m index ec537eb62..6ae17d9bf 100644 --- a/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.m +++ b/PubNub/Data/Builders/API Call/History/PNHistoryAPICallBuilder.m @@ -55,6 +55,13 @@ @implementation PNHistoryAPICallBuilder }; } +- (PNHistoryAPICallBuilder * (^)(BOOL))includeCustomMessageType { + return ^PNHistoryAPICallBuilder * (BOOL includeCustomMessageType) { + [self setValue:@(includeCustomMessageType) forParameter:NSStringFromSelector(_cmd)]; + return self; + }; +} + - (PNHistoryAPICallBuilder * (^)(BOOL includeTimeToken))includeTimeToken { return ^PNHistoryAPICallBuilder * (BOOL includeTimeToken) { [self setValue:@(includeTimeToken) forParameter:NSStringFromSelector(_cmd)]; diff --git a/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.h b/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.h index 8c0a59706..1e9c1b15e 100644 --- a/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.h +++ b/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.h @@ -42,6 +42,16 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, strong) PNPublishAPICallBuilder * (^message)(id message); +/** + * @brief User-specified message type. + * + * \b Important: string limited by \b 3 - \b 50 case-sensitive alphanumeric characters with only \c - and \c _ special + * characters allowed. + * + * @return API call configuration builder. + */ +@property (nonatomic, readonly, strong) PNPublishAPICallBuilder * (^customMessageType)(NSString *customMessageType); + /** * @brief Message metadata addition block. * diff --git a/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.m b/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.m index 6b2ac4781..a55c19552 100644 --- a/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.m +++ b/PubNub/Data/Builders/API Call/Publish/PNPublishAPICallBuilder.m @@ -35,6 +35,16 @@ @implementation PNPublishAPICallBuilder }; } +- (PNPublishAPICallBuilder * (^)(NSString *customMessageType))customMessageType { + return ^PNPublishAPICallBuilder * (NSString *customMessageType) { + if ([customMessageType isKindOfClass:[NSString class]]) { + [self setValue:customMessageType forParameter:NSStringFromSelector(_cmd)]; + } + + return self; + }; +} + - (PNPublishAPICallBuilder * (^)(NSDictionary *metadata))metadata { return ^PNPublishAPICallBuilder * (NSDictionary *metadata) { diff --git a/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.h b/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.h index 04a786703..7b3d3a569 100644 --- a/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.h +++ b/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.h @@ -58,6 +58,16 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, strong) PNPublishFileMessageAPICallBuilder * (^message)(id message); +/** + * @brief User-specified message type. + * + * \b Important: string limited by \b 3 - \b 50 case-sensitive alphanumeric characters with only \c - and \c _ special + * characters allowed. + * + * @return API call configuration builder. + */ +@property (nonatomic, readonly, strong) PNPublishFileMessageAPICallBuilder * (^customMessageType)(NSString *customMessageType); + /** * @brief Message metadata. * diff --git a/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.m b/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.m index 873bf2660..1594be354 100644 --- a/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.m +++ b/PubNub/Data/Builders/API Call/Publish/PNPublishFileMessageAPICallBuilder.m @@ -57,6 +57,16 @@ @implementation PNPublishFileMessageAPICallBuilder }; } +- (PNPublishFileMessageAPICallBuilder * (^)(NSString *customMessageType))customMessageType { + return ^PNPublishFileMessageAPICallBuilder * (NSString *customMessageType) { + if ([customMessageType isKindOfClass:[NSString class]]) { + [self setValue:customMessageType forParameter:NSStringFromSelector(_cmd)]; + } + + return self; + }; +} + - (PNPublishFileMessageAPICallBuilder * (^)(NSDictionary *metadata))metadata { return ^PNPublishFileMessageAPICallBuilder * (NSDictionary *metadata) { if ([metadata isKindOfClass:[NSDictionary class]]) { diff --git a/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.h b/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.h index 61954a2e6..20e37a470 100644 --- a/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.h +++ b/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.h @@ -39,6 +39,16 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly, strong) PNSignalAPICallBuilder * (^message)(id message); +/** + * @brief User-specified message type. + * + * \b Important: string limited by \b 3 - \b 50 case-sensitive alphanumeric characters with only \c - and \c _ special + * characters allowed. + * + * @return API call configuration builder. + */ +@property (nonatomic, readonly, strong) PNSignalAPICallBuilder * (^customMessageType)(NSString *customMessageType); + #pragma mark - Execution diff --git a/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.m b/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.m index 51979910f..619beb0c8 100644 --- a/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.m +++ b/PubNub/Data/Builders/API Call/Publish/PNSignalAPICallBuilder.m @@ -39,6 +39,16 @@ @implementation PNSignalAPICallBuilder }; } +- (PNSignalAPICallBuilder * (^)(NSString * customMessageType))customMessageType { + return ^PNSignalAPICallBuilder * (NSString *customMessageType) { + if ([customMessageType isKindOfClass:[NSString class]]) { + [self setValue:customMessageType forParameter:NSStringFromSelector(_cmd)]; + } + + return self; + }; +} + #pragma mark - Execution diff --git a/PubNub/Misc/PNConstants.h b/PubNub/Misc/PNConstants.h index ae0eaecb3..fe09c8690 100644 --- a/PubNub/Misc/PNConstants.h +++ b/PubNub/Misc/PNConstants.h @@ -15,7 +15,7 @@ #pragma mark General information constants // Stores client library version number -static NSString * const kPNLibraryVersion = @"5.6.1"; +static NSString * const kPNLibraryVersion = @"5.7.0"; // Stores information about SDK codebase static NSString * const kPNCommit = @"fd5c7ed678527fce07eaf7eb162935caf1bfd303"; diff --git a/PubNub/Network/Requests/Files/PNSendFileRequest.h b/PubNub/Network/Requests/Files/PNSendFileRequest.h index 9a6b8fa8b..95ef90e5a 100644 --- a/PubNub/Network/Requests/Files/PNSendFileRequest.h +++ b/PubNub/Network/Requests/Files/PNSendFileRequest.h @@ -22,6 +22,12 @@ NS_ASSUME_NONNULL_BEGIN /// `NSDictionary` with values which should be used by **PubNub** service to filter `file messages`. @property(strong, nullable, nonatomic) NSDictionary *fileMessageMetadata; +/// User-specified message type. +/// +/// > Important: string limited by **3**-**50** case-sensitive alphanumeric characters with only `-` and `_` special +/// characters allowed. +@property(copy, nullable, nonatomic) NSString *customMessageType; + /// Key which should be used for uploaded data `encryption`. /// /// This property allows setting up data _encryption_ using a different cipher key than the one set during **PubNub** diff --git a/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.h b/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.h index 2fbbc9b18..28674aa5c 100644 --- a/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.h +++ b/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.h @@ -19,6 +19,14 @@ NS_ASSUME_NONNULL_BEGIN /// > Notes: Maximum 500 channels. @property(copy, nonatomic, readonly) NSArray *channels; +/// Include messages' custom type flag. +/// +/// Message / signal and file messages may contain user-provided type. +/// +/// > Important: This option can be used only if a request created with `requestWithChannels` or `includeMessageActions` +/// options is set to `YES`. +@property(assign, nonatomic) BOOL includeCustomMessageType; + /// Include events' actions presence flag. /// /// Each fetched entry will contain published data under `message` key and added `message actions` will be available diff --git a/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.m b/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.m index 2e2b5686e..e97648d87 100644 --- a/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.m +++ b/PubNub/Network/Requests/Message Persistence/PNHistoryFetchRequest.m @@ -97,6 +97,11 @@ - (NSDictionary *)query { query[@"include_uuid"] = self.includeUUID ? @"true" : @"false"; } + // `includeCustomMessageType` available only for v3 history and history with message actions. + if (self.multipleChannels || self.includeMessageActions) { + query[@"include_custom_message_type"] = self.includeCustomMessageType ? @"true" : @"false"; + } + if (!self.multipleChannels && self.includeTimeToken) query[@"include_token"] = @"true"; if (self.arbitraryQueryParameters) [query addEntriesFromDictionary:self.arbitraryQueryParameters]; diff --git a/PubNub/Network/Requests/Publish/PNBasePublishRequest.h b/PubNub/Network/Requests/Publish/PNBasePublishRequest.h index baf5107c5..fda73bb93 100644 --- a/PubNub/Network/Requests/Publish/PNBasePublishRequest.h +++ b/PubNub/Network/Requests/Publish/PNBasePublishRequest.h @@ -21,6 +21,12 @@ NS_ASSUME_NONNULL_BEGIN ///clients on a channel. @property(assign, nonatomic, getter = shouldReplicate) BOOL replicate; +/// User-specified message type. +/// +/// > Important: string limited by **3**-**50** case-sensitive alphanumeric characters with only `-` and `_` special +/// characters allowed. +@property(copy, nullable, nonatomic) NSString *customMessageType; + /// Whether `published` data should be stored and available with history API or not. @property(assign, nonatomic, getter = shouldStore) BOOL store; diff --git a/PubNub/Network/Requests/Publish/PNBasePublishRequest.m b/PubNub/Network/Requests/Publish/PNBasePublishRequest.m index f329f910e..d569db80a 100644 --- a/PubNub/Network/Requests/Publish/PNBasePublishRequest.m +++ b/PubNub/Network/Requests/Publish/PNBasePublishRequest.m @@ -78,7 +78,8 @@ - (NSDictionary *)headers { - (NSDictionary *)query { NSMutableDictionary *query = [NSMutableDictionary new]; - + + if (self.customMessageType.length) query[@"custom_message_type"] = self.customMessageType; if (self.preparedMetadata.length) query[@"meta"] = self.preparedMetadata; if (self.ttl > 0) query[@"ttl"] = @(self.ttl).stringValue; if (!self.shouldReplicate) query[@"norep"] = @"true"; diff --git a/PubNub/Network/Requests/Signal/PNSignalRequest.h b/PubNub/Network/Requests/Signal/PNSignalRequest.h index ca15ea52e..2704d82c2 100644 --- a/PubNub/Network/Requests/Signal/PNSignalRequest.h +++ b/PubNub/Network/Requests/Signal/PNSignalRequest.h @@ -16,6 +16,12 @@ NS_ASSUME_NONNULL_BEGIN /// Arbitrary percent encoded query parameters which should be sent along with original API call. @property(strong, nullable, nonatomic) NSDictionary *arbitraryQueryParameters; +/// User-specified message type. +/// +/// > Important: string limited by **3**-**50** case-sensitive alphanumeric characters with only `-` and `_` special +/// characters allowed. +@property(copy, nullable, nonatomic) NSString *customMessageType; + /// Name of channel to which signal should be send. @property(copy, nonatomic, readonly) NSString *channel; diff --git a/PubNub/Network/Requests/Signal/PNSignalRequest.m b/PubNub/Network/Requests/Signal/PNSignalRequest.m index 9c52a54ec..c992f663d 100644 --- a/PubNub/Network/Requests/Signal/PNSignalRequest.m +++ b/PubNub/Network/Requests/Signal/PNSignalRequest.m @@ -60,6 +60,7 @@ - (PNOperationType)operation { - (NSDictionary *)query { NSMutableDictionary *query = [NSMutableDictionary new]; + if (self.customMessageType.length) query[@"custom_message_type"] = self.customMessageType; if (self.arbitraryQueryParameters.count) [query addEntriesFromDictionary:self.arbitraryQueryParameters]; return query.count ? query : nil; diff --git a/PubNub/Network/Responses/Message Persistence/PNHistoryFetchData.m b/PubNub/Network/Responses/Message Persistence/PNHistoryFetchData.m index 590ea85f4..d0983600d 100644 --- a/PubNub/Network/Responses/Message Persistence/PNHistoryFetchData.m +++ b/PubNub/Network/Responses/Message Persistence/PNHistoryFetchData.m @@ -189,6 +189,7 @@ - (NSMutableArray *)formattedUpdatesFromArray:(NSArray *)updates __block NSError *decError; [updates enumerateObjectsUsingBlock:^(id entry, __unused NSUInteger entryIdx, __unused BOOL *stop) { + NSString *customMessageType = nil; NSDictionary *actions = nil; NSDictionary *metadata = nil; NSNumber *messageType = nil; @@ -197,8 +198,10 @@ - (NSMutableArray *)formattedUpdatesFromArray:(NSArray *)updates id message = entry; if ([entry isKindOfClass:[NSDictionary class]] && entry[@"message"] && - (entry[@"timetoken"] || entry[@"meta"] || entry[@"actions"] || entry[@"message_type"] || entry[@"uuid"])) { + (entry[@"timetoken"] || entry[@"meta"] || entry[@"actions"] || entry[@"message_type"] || + entry[@"custom_message_type"] || entry[@"uuid"])) { + customMessageType = entry[@"custom_message_type"]; messageType = entry[@"message_type"]; timeToken = entry[@"timetoken"]; message = entry[@"message"]; @@ -216,9 +219,10 @@ - (NSMutableArray *)formattedUpdatesFromArray:(NSArray *)updates message = [self decryptedMessageFromData:message withCryptoModule:cryptoModule error:&error]; if (message) { - if (timeToken || metadata || actions || messageType || senderUUID) { + if (timeToken || metadata || actions || messageType || customMessageType || senderUUID) { NSMutableDictionary *messageWithInfo = [@{ @"message": message } mutableCopy]; if ([messageType isKindOfClass:[NSNumber class]]) messageWithInfo[@"messageType"] = messageType; + if (customMessageType) messageWithInfo[@"customMessageType"] = customMessageType; if (timeToken) messageWithInfo[@"timetoken"] = timeToken; if (metadata) messageWithInfo[@"metadata"] = metadata; if (actions) messageWithInfo[@"actions"] = actions; diff --git a/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.h b/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.h index 83d16d7f8..598896eaa 100644 --- a/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.h +++ b/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.h @@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Properties +/// User-specified message type. +@property(strong, nullable, nonatomic, readonly) NSString *customMessageType; + /// Information about file which has been uploaded to `channel`. @property (nonatomic, nullable, readonly, strong) PNFile *file; diff --git a/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.m b/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.m index 1d37c55fe..489a5333e 100644 --- a/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.m +++ b/PubNub/Network/Responses/Subscribe/PNSubscribeFileEventData.m @@ -32,13 +32,14 @@ @implementation PNSubscribeFileEventData + (NSDictionary *)codingKeys { return @{ + @"customMessageType": @"cmt", @"message": @"message", @"file": @"file" }; } + (NSArray *)optionalKeys { - return @[@"message"]; + return @[@"customMessageType", @"message"]; } + (NSArray *)ignoredKeys { diff --git a/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.h b/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.h index b295ac67b..b4650dafd 100644 --- a/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.h +++ b/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.h @@ -11,6 +11,9 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Properties +/// User-specified message type. +@property(strong, nullable, nonatomic, readonly) NSString *customMessageType; + /// Message which has been delivered through data object live feed. @property(strong, nullable, nonatomic, readonly) id message; diff --git a/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.m b/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.m index ad1bebafd..1a3bdad53 100644 --- a/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.m +++ b/PubNub/Network/Responses/Subscribe/PNSubscribeMessageEventData.m @@ -32,7 +32,14 @@ @implementation PNSubscribeMessageEventData #pragma mark - Properties + (NSDictionary *)codingKeys { - return @{ @"message": @"message" }; + return @{ + @"customMessageType": @"cmt", + @"message": @"message" + }; +} + ++ (NSArray *)optionalKeys { + return @[@"customMessageType"]; } + (NSArray *)ignoredKeys { diff --git a/README.md b/README.md index 4e3ea444d..8a7d76fbd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PubNub 5.6.1 for iOS 9+ +# PubNub 5.7.0 for iOS 9+ [![Twitter](https://img.shields.io/badge/twitter-%40PubNub-blue.svg?style=flat)](https://twitter.com/PubNub) [![Twitter Releases](https://img.shields.io/badge/twitter-%40PubNubRelease-blue.svg?style=flat)](https://twitter.com/PubNubRelease) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/PubNub.svg?style=flat)](https://img.shields.io/cocoapods/v/PubNub.svg) diff --git a/Tests/Podfile b/Tests/Podfile index 71d3154e6..b9f0528fe 100644 --- a/Tests/Podfile +++ b/Tests/Podfile @@ -39,7 +39,8 @@ end abstract_target 'ContractTests' do - pod 'Cucumberish', :git => 'https://github.com/parfeon/Cucumberish.git', :branch => 'master', :inhibit_warnings => true +# pod 'Cucumberish', :git => 'https://github.com/parfeon/Cucumberish.git', :branch => 'master', :inhibit_warnings => true + pod 'Cucumberish' pod 'PubNub', :path => '../' target '[iOS] Contract Tests' do @@ -79,4 +80,4 @@ post_install do |installer_representation| end end end -end \ No newline at end of file +end diff --git a/Tests/Podfile.lock b/Tests/Podfile.lock index 80d2100c2..382467242 100644 --- a/Tests/Podfile.lock +++ b/Tests/Podfile.lock @@ -1,40 +1,33 @@ PODS: - Cucumberish (1.4.0) - OCMock (3.6) - - PubNub (5.6.0): - - PubNub/Core (= 5.6.0) - - PubNub/Core (5.6.0) + - PubNub (5.6.1): + - PubNub/Core (= 5.6.1) + - PubNub/Core (5.6.1) - YAHTTPVCR (1.5.0) DEPENDENCIES: - - Cucumberish (from `https://github.com/parfeon/Cucumberish.git`, branch `master`) + - Cucumberish - OCMock (= 3.6) - PubNub (from `../`) - YAHTTPVCR SPEC REPOS: trunk: + - Cucumberish - OCMock - YAHTTPVCR EXTERNAL SOURCES: - Cucumberish: - :branch: master - :git: https://github.com/parfeon/Cucumberish.git PubNub: :path: "../" -CHECKOUT OPTIONS: - Cucumberish: - :commit: 6a9a44002b8ba9be6edc957357c244f9f9c7f94e - :git: https://github.com/parfeon/Cucumberish.git - SPEC CHECKSUMS: Cucumberish: 6cbd0c1f50306b369acebfe7d9f514c9c287d26c OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 - PubNub: 4c06870a45eba7d59ac5f6598de28207fe7dac17 + PubNub: 6ae1c3e6b2e023236d51282058ad264dd42ab234 YAHTTPVCR: cb7a710d4289ee9b038fd708d2fb8df4e6521bc0 -PODFILE CHECKSUM: fb38a10e9ab7ec6c9e4fe43e6a3b6ffc35154550 +PODFILE CHECKSUM: 3f7212ecda9adc899686ebfa6bbaabcad2b2ef49 COCOAPODS: 1.15.2 diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithActionsAndReceiveResultWithExpectedOperation.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithActionsAndReceiveResultWithExpectedOperation.json index dfed5045d..895b227c1 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithActionsAndReceiveResultWithExpectedOperation.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithActionsAndReceiveResultWithExpectedOperation.json @@ -598,7 +598,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_custom_message_type=0&include_message_type=1" }, "type" : 0 }, @@ -607,7 +607,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_custom_message_type=0&include_message_type=1", "headers" : { "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithCustomMessageTypeWhenIncludeCustomMessageTypeAndIncludeMessageActionsFlagIsSet.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithCustomMessageTypeWhenIncludeCustomMessageTypeAndIncludeMessageActionsFlagIsSet.json new file mode 100644 index 000000000..e073571db --- /dev/null +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithCustomMessageTypeWhenIncludeCustomMessageTypeAndIncludeMessageActionsFlagIsSet.json @@ -0,0 +1,1278 @@ +[ + { + "id" : "92978876-5D86-48C1-AED6-F63187B2843C", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "92978876-5D86-48C1-AED6-F63187B2843C", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 21:48:48 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "92978876-5D86-48C1-AED6-F63187B2843C", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjc1MzI4NTI3NDk2NCJd" + }, + "type" : 2 + }, + { + "id" : "92978876-5D86-48C1-AED6-F63187B2843C", + "type" : 4 + }, + { + "id" : "60EE46CF-1537-4B0A-AA8E-3066898CAF92", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "60EE46CF-1537-4B0A-AA8E-3066898CAF92", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 21:48:49 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "60EE46CF-1537-4B0A-AA8E-3066898CAF92", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjc1MzI5MjM1MDY0MiJd" + }, + "type" : 2 + }, + { + "id" : "60EE46CF-1537-4B0A-AA8E-3066898CAF92", + "type" : 4 + }, + { + "id" : "4B49E015-5B14-47EC-BEA0-00FB9ED8A79B", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "4B49E015-5B14-47EC-BEA0-00FB9ED8A79B", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 21:48:49 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "4B49E015-5B14-47EC-BEA0-00FB9ED8A79B", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjc1MzI5OTQ3MzA5MyJd" + }, + "type" : 2 + }, + { + "id" : "4B49E015-5B14-47EC-BEA0-00FB9ED8A79B", + "type" : 4 + }, + { + "id" : "D472E7D8-72D8-4D0B-84D3-6E9919CAC092", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "D472E7D8-72D8-4D0B-84D3-6E9919CAC092", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 21:48:50 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "D472E7D8-72D8-4D0B-84D3-6E9919CAC092", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjc1MzMwNjU5OTYxMCJd" + }, + "type" : 2 + }, + { + "id" : "D472E7D8-72D8-4D0B-84D3-6E9919CAC092", + "type" : 4 + }, + { + "id" : "B7CE59DE-4C0F-448B-8886-86C58C022650", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWUyIn0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "B7CE59DE-4C0F-448B-8886-86C58C022650", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:54 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "B7CE59DE-4C0F-448B-8886-86C58C022650", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjg1Mjc0OTY0IiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTIiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzMzQzOTczNTIwIn19" + }, + "type" : 2 + }, + { + "id" : "B7CE59DE-4C0F-448B-8886-86C58C022650", + "type" : 4 + }, + { + "id" : "8C6881C8-B3D7-4334-97AA-D25CB432D324", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "48", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoiY3VzdG9tIiwidmFsdWUiOiJ2YWx1ZTMifQ==" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "8C6881C8-B3D7-4334-97AA-D25CB432D324", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:55 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "189", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "8C6881C8-B3D7-4334-97AA-D25CB432D324", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjg1Mjc0OTY0IiwgInR5cGUiOiAiY3VzdG9tIiwgInV1aWQiOiAiU2VyaGlpIiwgInZhbHVlIjogInZhbHVlMyIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzNTEyMTIxMzAifX0=" + }, + "type" : 2 + }, + { + "id" : "8C6881C8-B3D7-4334-97AA-D25CB432D324", + "type" : 4 + }, + { + "id" : "D30D321C-1C23-422B-B42C-277C5C05FD1A", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "50", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVhY3Rpb24iLCJ2YWx1ZSI6InZhbHVlNCJ9" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "D30D321C-1C23-422B-B42C-277C5C05FD1A", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:55 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "191", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "D30D321C-1C23-422B-B42C-277C5C05FD1A", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjg1Mjc0OTY0IiwgInR5cGUiOiAicmVhY3Rpb24iLCAidXVpZCI6ICJTZXJoaWkiLCAidmFsdWUiOiAidmFsdWU0IiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzM1ODQ3Njg1MCJ9fQ==" + }, + "type" : 2 + }, + { + "id" : "D30D321C-1C23-422B-B42C-277C5C05FD1A", + "type" : 4 + }, + { + "id" : "9C8525CE-EB75-4702-A731-8B427184EE51", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWU1In0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "9C8525CE-EB75-4702-A731-8B427184EE51", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753285274964?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:56 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "9C8525CE-EB75-4702-A731-8B427184EE51", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjg1Mjc0OTY0IiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTUiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzMzY1NzUyMTkwIn19" + }, + "type" : 2 + }, + { + "id" : "9C8525CE-EB75-4702-A731-8B427184EE51", + "type" : 4 + }, + { + "id" : "DB9F66B2-2E8F-40EF-B1DE-C263AD172B82", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWUyIn0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "DB9F66B2-2E8F-40EF-B1DE-C263AD172B82", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:57 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "DB9F66B2-2E8F-40EF-B1DE-C263AD172B82", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjkyMzUwNjQyIiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTIiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzMzczMDIzMjMyIn19" + }, + "type" : 2 + }, + { + "id" : "DB9F66B2-2E8F-40EF-B1DE-C263AD172B82", + "type" : 4 + }, + { + "id" : "F1B68BB1-5E85-4723-BF8F-03155F03ACA5", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "48", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoiY3VzdG9tIiwidmFsdWUiOiJ2YWx1ZTMifQ==" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "F1B68BB1-5E85-4723-BF8F-03155F03ACA5", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:58 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "189", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "F1B68BB1-5E85-4723-BF8F-03155F03ACA5", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjkyMzUwNjQyIiwgInR5cGUiOiAiY3VzdG9tIiwgInV1aWQiOiAiU2VyaGlpIiwgInZhbHVlIjogInZhbHVlMyIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzODAyOTkxNDAifX0=" + }, + "type" : 2 + }, + { + "id" : "F1B68BB1-5E85-4723-BF8F-03155F03ACA5", + "type" : 4 + }, + { + "id" : "B664E7F7-C2AE-47E9-A9E4-85DF89FA34C3", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "50", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVhY3Rpb24iLCJ2YWx1ZSI6InZhbHVlNCJ9" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "B664E7F7-C2AE-47E9-A9E4-85DF89FA34C3", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:58 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "191", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "B664E7F7-C2AE-47E9-A9E4-85DF89FA34C3", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjkyMzUwNjQyIiwgInR5cGUiOiAicmVhY3Rpb24iLCAidXVpZCI6ICJTZXJoaWkiLCAidmFsdWUiOiAidmFsdWU0IiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzM4NzU5NDIyMCJ9fQ==" + }, + "type" : 2 + }, + { + "id" : "B664E7F7-C2AE-47E9-A9E4-85DF89FA34C3", + "type" : 4 + }, + { + "id" : "3898D776-F09A-4D57-9B6B-A6697911522F", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWU1In0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "3898D776-F09A-4D57-9B6B-A6697911522F", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753292350642?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:48:59 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "3898D776-F09A-4D57-9B6B-A6697911522F", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjkyMzUwNjQyIiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTUiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzMzk0ODYwNjAwIn19" + }, + "type" : 2 + }, + { + "id" : "3898D776-F09A-4D57-9B6B-A6697911522F", + "type" : 4 + }, + { + "id" : "53B94756-13AF-4F18-AD32-B79B64A25794", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWUyIn0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "53B94756-13AF-4F18-AD32-B79B64A25794", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:00 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "53B94756-13AF-4F18-AD32-B79B64A25794", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjk5NDczMDkzIiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTIiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzNDAyMTA1NjAwIn19" + }, + "type" : 2 + }, + { + "id" : "53B94756-13AF-4F18-AD32-B79B64A25794", + "type" : 4 + }, + { + "id" : "739D37DB-A989-46B5-91D7-62ECE058DB9D", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "48", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoiY3VzdG9tIiwidmFsdWUiOiJ2YWx1ZTMifQ==" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "739D37DB-A989-46B5-91D7-62ECE058DB9D", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:00 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "189", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "739D37DB-A989-46B5-91D7-62ECE058DB9D", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjk5NDczMDkzIiwgInR5cGUiOiAiY3VzdG9tIiwgInV1aWQiOiAiU2VyaGlpIiwgInZhbHVlIjogInZhbHVlMyIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0MDk0Nzg3MDAifX0=" + }, + "type" : 2 + }, + { + "id" : "739D37DB-A989-46B5-91D7-62ECE058DB9D", + "type" : 4 + }, + { + "id" : "48960B08-E45B-4FC3-ABE2-38D1746DFF79", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "50", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVhY3Rpb24iLCJ2YWx1ZSI6InZhbHVlNCJ9" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "48960B08-E45B-4FC3-ABE2-38D1746DFF79", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:01 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "191", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "48960B08-E45B-4FC3-ABE2-38D1746DFF79", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjk5NDczMDkzIiwgInR5cGUiOiAicmVhY3Rpb24iLCAidXVpZCI6ICJTZXJoaWkiLCAidmFsdWUiOiAidmFsdWU0IiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzQxNjczOTgyMCJ9fQ==" + }, + "type" : 2 + }, + { + "id" : "48960B08-E45B-4FC3-ABE2-38D1746DFF79", + "type" : 4 + }, + { + "id" : "2EC7EDBC-D0FE-49B1-931D-FD6C544BB849", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWU1In0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "2EC7EDBC-D0FE-49B1-931D-FD6C544BB849", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753299473093?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:02 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "2EC7EDBC-D0FE-49B1-931D-FD6C544BB849", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMjk5NDczMDkzIiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTUiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzNDIzOTk1NzQwIn19" + }, + "type" : 2 + }, + { + "id" : "2EC7EDBC-D0FE-49B1-931D-FD6C544BB849", + "type" : 4 + }, + { + "id" : "B21E5D9B-76AA-4365-86E7-7601670FC4AF", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWUyIn0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "B21E5D9B-76AA-4365-86E7-7601670FC4AF", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:03 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "B21E5D9B-76AA-4365-86E7-7601670FC4AF", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMzA2NTk5NjEwIiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTIiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzNDMxMjI5NjkwIn19" + }, + "type" : 2 + }, + { + "id" : "B21E5D9B-76AA-4365-86E7-7601670FC4AF", + "type" : 4 + }, + { + "id" : "9D20AF15-E4D2-4E37-A6FD-B58C2F1123A7", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "48", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoiY3VzdG9tIiwidmFsdWUiOiJ2YWx1ZTMifQ==" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "9D20AF15-E4D2-4E37-A6FD-B58C2F1123A7", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:03 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "189", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "9D20AF15-E4D2-4E37-A6FD-B58C2F1123A7", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMzA2NTk5NjEwIiwgInR5cGUiOiAiY3VzdG9tIiwgInV1aWQiOiAiU2VyaGlpIiwgInZhbHVlIjogInZhbHVlMyIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0Mzg1MTYxMDgifX0=" + }, + "type" : 2 + }, + { + "id" : "9D20AF15-E4D2-4E37-A6FD-B58C2F1123A7", + "type" : 4 + }, + { + "id" : "7A802555-06CF-44CA-BDAF-10BC0B0A146A", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "50", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVhY3Rpb24iLCJ2YWx1ZSI6InZhbHVlNCJ9" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "7A802555-06CF-44CA-BDAF-10BC0B0A146A", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:04 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "191", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "7A802555-06CF-44CA-BDAF-10BC0B0A146A", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMzA2NTk5NjEwIiwgInR5cGUiOiAicmVhY3Rpb24iLCAidXVpZCI6ICJTZXJoaWkiLCAidmFsdWUiOiAidmFsdWU0IiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzQ0NTczODkwMCJ9fQ==" + }, + "type" : 2 + }, + { + "id" : "7A802555-06CF-44CA-BDAF-10BC0B0A146A", + "type" : 4 + }, + { + "id" : "05084629-60DA-4518-8EC1-B20CC9E18AE8", + "data" : { + "method" : "post", + "cls" : "NSURLRequest", + "cellular" : true, + "network" : 0, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Content-Length" : "49", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate", + "Content-Type" : "application\/json" + }, + "body" : { + "cls" : "NSData", + "base64" : "eyJ0eXBlIjoicmVjZWlwdCIsInZhbHVlIjoidmFsdWU1In0=" + }, + "pipeline" : false, + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "05084629-60DA-4518-8EC1-B20CC9E18AE8", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v1\/message-actions\/demo\/channel\/test-channel\/message\/17312753306599610?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:05 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "190", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "05084629-60DA-4518-8EC1-B20CC9E18AE8", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJkYXRhIjogeyJtZXNzYWdlVGltZXRva2VuIjogIjE3MzEyNzUzMzA2NTk5NjEwIiwgInR5cGUiOiAicmVjZWlwdCIsICJ1dWlkIjogIlNlcmhpaSIsICJ2YWx1ZSI6ICJ2YWx1ZTUiLCAiYWN0aW9uVGltZXRva2VuIjogIjE3MzEyNzUzNDUzMDUxMTE4In19" + }, + "type" : 2 + }, + { + "id" : "05084629-60DA-4518-8EC1-B20CC9E18AE8", + "type" : 4 + }, + { + "id" : "02BCF313-69CC-4F6E-A5B6-EFE55C7A6126", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&include_custom_message_type=1&include_message_type=1" + }, + "type" : 0 + }, + { + "id" : "02BCF313-69CC-4F6E-A5B6-EFE55C7A6126", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&include_custom_message_type=1&include_message_type=1", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Transfer-Encoding" : "Identity", + "Date" : "Sun, 10 Nov 2024 21:49:09 GMT", + "Content-Encoding" : "gzip", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "02BCF313-69CC-4F6E-A5B6-EFE55C7A6126", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJjaGFubmVscyI6IHsidGVzdC1jaGFubmVsIjogW3sidGltZXRva2VuIjogIjE3MzEyNzUzMjg1Mjc0OTY0IiwgInV1aWQiOiAiU2VyaGlpIiwgIm1lc3NhZ2UiOiB7Im1lc3NhZ2VJZHgiOiAibWVzc2FnZTogMCIsICJ0aW1lIjogMTU3NzkxODQxMn0sICJtZXNzYWdlX3R5cGUiOiBudWxsLCAiYWN0aW9ucyI6IHsicmVhY3Rpb24iOiB7InZhbHVlNCI6IFt7InV1aWQiOiAiU2VyaGlpIiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzM1ODQ3Njg1MCJ9XX0sICJyZWNlaXB0IjogeyJ2YWx1ZTIiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzNDM5NzM1MjAifV0sICJ2YWx1ZTUiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzNjU3NTIxOTAifV19LCAiY3VzdG9tIjogeyJ2YWx1ZTMiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzNTEyMTIxMzAifV19fSwgImN1c3RvbV9tZXNzYWdlX3R5cGUiOiAidGVzdC1tZXNzYWdlIn0sIHsidGltZXRva2VuIjogIjE3MzEyNzUzMjkyMzUwNjQyIiwgInV1aWQiOiAiU2VyaGlpIiwgIm1lc3NhZ2UiOiB7Im1lc3NhZ2VJZHgiOiAibWVzc2FnZTogMSIsICJ0aW1lIjogMTU3NzkxODQxM30sICJtZXNzYWdlX3R5cGUiOiBudWxsLCAiYWN0aW9ucyI6IHsicmVhY3Rpb24iOiB7InZhbHVlNCI6IFt7InV1aWQiOiAiU2VyaGlpIiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzM4NzU5NDIyMCJ9XX0sICJyZWNlaXB0IjogeyJ2YWx1ZTIiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzNzMwMjMyMzIifV0sICJ2YWx1ZTUiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzOTQ4NjA2MDAifV19LCAiY3VzdG9tIjogeyJ2YWx1ZTMiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTMzODAyOTkxNDAifV19fSwgImN1c3RvbV9tZXNzYWdlX3R5cGUiOiAidGVzdC1tZXNzYWdlIn0sIHsidGltZXRva2VuIjogIjE3MzEyNzUzMjk5NDczMDkzIiwgInV1aWQiOiAiU2VyaGlpIiwgIm1lc3NhZ2UiOiB7Im1lc3NhZ2VJZHgiOiAibWVzc2FnZTogMiIsICJ0aW1lIjogMTU3NzkxODQxNH0sICJtZXNzYWdlX3R5cGUiOiBudWxsLCAiYWN0aW9ucyI6IHsicmVhY3Rpb24iOiB7InZhbHVlNCI6IFt7InV1aWQiOiAiU2VyaGlpIiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzQxNjczOTgyMCJ9XX0sICJyZWNlaXB0IjogeyJ2YWx1ZTIiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0MDIxMDU2MDAifV0sICJ2YWx1ZTUiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0MjM5OTU3NDAifV19LCAiY3VzdG9tIjogeyJ2YWx1ZTMiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0MDk0Nzg3MDAifV19fSwgImN1c3RvbV9tZXNzYWdlX3R5cGUiOiAidGVzdC1tZXNzYWdlIn0sIHsidGltZXRva2VuIjogIjE3MzEyNzUzMzA2NTk5NjEwIiwgInV1aWQiOiAiU2VyaGlpIiwgIm1lc3NhZ2UiOiB7Im1lc3NhZ2VJZHgiOiAibWVzc2FnZTogMyIsICJ0aW1lIjogMTU3NzkxODQxNX0sICJtZXNzYWdlX3R5cGUiOiBudWxsLCAiYWN0aW9ucyI6IHsicmVhY3Rpb24iOiB7InZhbHVlNCI6IFt7InV1aWQiOiAiU2VyaGlpIiwgImFjdGlvblRpbWV0b2tlbiI6ICIxNzMxMjc1MzQ0NTczODkwMCJ9XX0sICJyZWNlaXB0IjogeyJ2YWx1ZTIiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0MzEyMjk2OTAifV0sICJ2YWx1ZTUiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0NTMwNTExMTgifV19LCAiY3VzdG9tIjogeyJ2YWx1ZTMiOiBbeyJ1dWlkIjogIlNlcmhpaSIsICJhY3Rpb25UaW1ldG9rZW4iOiAiMTczMTI3NTM0Mzg1MTYxMDgifV19fSwgImN1c3RvbV9tZXNzYWdlX3R5cGUiOiAidGVzdC1tZXNzYWdlIn1dfSwgImVycm9yX21lc3NhZ2UiOiAiIiwgImVycm9yIjogZmFsc2V9" + }, + "type" : 2 + }, + { + "id" : "02BCF313-69CC-4F6E-A5B6-EFE55C7A6126", + "type" : 4 + }, + { + "id" : "E6F585D6-DBFE-4003-AB0B-03A384D31670", + "data" : { + "method" : "delete", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "E6F585D6-DBFE-4003-AB0B-03A384D31670", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 21:49:09 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "52", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "E6F585D6-DBFE-4003-AB0B-03A384D31670", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJlcnJvciI6IGZhbHNlLCAiZXJyb3JfbWVzc2FnZSI6ICIifQ==" + }, + "type" : 2 + }, + { + "id" : "E6F585D6-DBFE-4003-AB0B-03A384D31670", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithEncryptedMessagesAndFailToDecryptWhenDifferentCipherKeyIsSet.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithEncryptedMessagesAndFailToDecryptWhenDifferentCipherKeyIsSet.json index d6563e4c7..a9804c771 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithEncryptedMessagesAndFailToDecryptWhenDifferentCipherKeyIsSet.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithEncryptedMessagesAndFailToDecryptWhenDifferentCipherKeyIsSet.json @@ -220,7 +220,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Kim&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Kim&include_custom_message_type=0&include_message_type=1" }, "type" : 0 }, @@ -229,7 +229,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Kim&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Kim&include_custom_message_type=0&include_message_type=1", "headers" : { "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithoutCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithoutCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json new file mode 100644 index 000000000..0b79fa8bf --- /dev/null +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelWithoutCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json @@ -0,0 +1,318 @@ +[ + { + "id" : "6D4EDF6A-25D8-4E75-B7D0-38F8A72B954F", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "6D4EDF6A-25D8-4E75-B7D0-38F8A72B954F", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 06:55:33 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "6D4EDF6A-25D8-4E75-B7D0-38F8A72B954F", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIxNzMzNDQxNTQ5MyJd" + }, + "type" : 2 + }, + { + "id" : "6D4EDF6A-25D8-4E75-B7D0-38F8A72B954F", + "type" : 4 + }, + { + "id" : "27963F75-6C95-4376-9848-9A028E9C61F7", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "27963F75-6C95-4376-9848-9A028E9C61F7", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 06:55:34 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "27963F75-6C95-4376-9848-9A028E9C61F7", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIxNzM0MDM4NjA1NiJd" + }, + "type" : 2 + }, + { + "id" : "27963F75-6C95-4376-9848-9A028E9C61F7", + "type" : 4 + }, + { + "id" : "AE9E1F1D-D1B7-491A-AE1C-ED786B9428D1", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "AE9E1F1D-D1B7-491A-AE1C-ED786B9428D1", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 06:55:34 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "AE9E1F1D-D1B7-491A-AE1C-ED786B9428D1", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIxNzM0NjM3MDQxNCJd" + }, + "type" : 2 + }, + { + "id" : "AE9E1F1D-D1B7-491A-AE1C-ED786B9428D1", + "type" : 4 + }, + { + "id" : "45542EE0-6543-4452-B343-EF0BB7FD632E", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "45542EE0-6543-4452-B343-EF0BB7FD632E", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 06:55:35 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "45542EE0-6543-4452-B343-EF0BB7FD632E", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIxNzM1MjI2NDU0NCJd" + }, + "type" : 2 + }, + { + "id" : "45542EE0-6543-4452-B343-EF0BB7FD632E", + "type" : 4 + }, + { + "id" : "48085BF4-ACD9-411E-80BA-EAC226D9C63B", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v2\/history\/sub-key\/demo\/channel\/test-channel?pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii" + }, + "type" : 0 + }, + { + "id" : "48085BF4-ACD9-411E-80BA-EAC226D9C63B", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v2\/history\/sub-key\/demo\/channel\/test-channel?pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Transfer-Encoding" : "Identity", + "Date" : "Sun, 10 Nov 2024 06:55:38 GMT", + "Content-Encoding" : "gzip", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "48085BF4-ACD9-411E-80BA-EAC226D9C63B", + "data" : { + "cls" : "NSData", + "base64" : "W1t7Im1lc3NhZ2VJZHgiOiJtZXNzYWdlOiAwIiwidGltZSI6MTU3NzkxODQxMn0seyJtZXNzYWdlSWR4IjoibWVzc2FnZTogMSIsInRpbWUiOjE1Nzc5MTg0MTN9LHsibWVzc2FnZUlkeCI6Im1lc3NhZ2U6IDIiLCJ0aW1lIjoxNTc3OTE4NDE0fSx7Im1lc3NhZ2VJZHgiOiJtZXNzYWdlOiAzIiwidGltZSI6MTU3NzkxODQxNX1dLDE3MzEyMjE3MzM0NDE1NDkzLDE3MzEyMjE3MzUyMjY0NTQ0XQ==" + }, + "type" : 2 + }, + { + "id" : "48085BF4-ACD9-411E-80BA-EAC226D9C63B", + "type" : 4 + }, + { + "id" : "1C2B20BA-CF95-43B9-BB7A-55BA764EB5C6", + "data" : { + "method" : "delete", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "1C2B20BA-CF95-43B9-BB7A-55BA764EB5C6", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 06:55:38 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "52", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "1C2B20BA-CF95-43B9-BB7A-55BA764EB5C6", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJlcnJvciI6IGZhbHNlLCAiZXJyb3JfbWVzc2FnZSI6ICIifQ==" + }, + "type" : 2 + }, + { + "id" : "1C2B20BA-CF95-43B9-BB7A-55BA764EB5C6", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelsWithCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelsWithCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json new file mode 100644 index 000000000..64f1deb69 --- /dev/null +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryForChannelsWithCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet.json @@ -0,0 +1,580 @@ +[ + { + "id" : "7265F2D4-036D-451E-9C51-E621704D4F5E", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "7265F2D4-036D-451E-9C51-E621704D4F5E", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:11 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "7265F2D4-036D-451E-9C51-E621704D4F5E", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTExMzQ0MTc2NCJd" + }, + "type" : 2 + }, + { + "id" : "7265F2D4-036D-451E-9C51-E621704D4F5E", + "type" : 4 + }, + { + "id" : "7526684C-9E99-41EE-BF41-8CA3B6528C16", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "7526684C-9E99-41EE-BF41-8CA3B6528C16", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:11 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "7526684C-9E99-41EE-BF41-8CA3B6528C16", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTExOTQ1OTMzMiJd" + }, + "type" : 2 + }, + { + "id" : "7526684C-9E99-41EE-BF41-8CA3B6528C16", + "type" : 4 + }, + { + "id" : "F40C11BE-8950-4978-89AE-1D1EA9741342", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "F40C11BE-8950-4978-89AE-1D1EA9741342", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:12 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "F40C11BE-8950-4978-89AE-1D1EA9741342", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTEyNTMyNjQ5NyJd" + }, + "type" : 2 + }, + { + "id" : "F40C11BE-8950-4978-89AE-1D1EA9741342", + "type" : 4 + }, + { + "id" : "F4374425-AACC-4B27-9B73-CADCD3DAA765", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "F4374425-AACC-4B27-9B73-CADCD3DAA765", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-alpha\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:13 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "F4374425-AACC-4B27-9B73-CADCD3DAA765", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTEzMTEyNDYwOSJd" + }, + "type" : 2 + }, + { + "id" : "F4374425-AACC-4B27-9B73-CADCD3DAA765", + "type" : 4 + }, + { + "id" : "B2889314-DC88-4660-8AC2-CF8A4C9CDFC2", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "B2889314-DC88-4660-8AC2-CF8A4C9CDFC2", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%200%22,%22time%22:1577918412%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918412%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:16 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "B2889314-DC88-4660-8AC2-CF8A4C9CDFC2", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTE2NzkzMjA3MCJd" + }, + "type" : 2 + }, + { + "id" : "B2889314-DC88-4660-8AC2-CF8A4C9CDFC2", + "type" : 4 + }, + { + "id" : "9B626401-8728-4144-B41D-AAC9D0F2D2A5", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "9B626401-8728-4144-B41D-AAC9D0F2D2A5", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%201%22,%22time%22:1577918413%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:17 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "9B626401-8728-4144-B41D-AAC9D0F2D2A5", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTE3Mzc5NzExMSJd" + }, + "type" : 2 + }, + { + "id" : "9B626401-8728-4144-B41D-AAC9D0F2D2A5", + "type" : 4 + }, + { + "id" : "8D1F7AAA-E08E-407B-8FBB-1C0C0648F855", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "8D1F7AAA-E08E-407B-8FBB-1C0C0648F855", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%202%22,%22time%22:1577918414%7D?custom_message_type=test-message&meta=%7B%22time%22:1577918414%7D&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:17 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "8D1F7AAA-E08E-407B-8FBB-1C0C0648F855", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTE3OTYzNzQyMiJd" + }, + "type" : 2 + }, + { + "id" : "8D1F7AAA-E08E-407B-8FBB-1C0C0648F855", + "type" : 4 + }, + { + "id" : "71B7D604-2FE4-40D4-8971-6EEF7BFAE7E6", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" + }, + "type" : 0 + }, + { + "id" : "71B7D604-2FE4-40D4-8971-6EEF7BFAE7E6", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel-beta\/0\/%7B%22messageIdx%22:%22message:%203%22,%22time%22:1577918415%7D?custom_message_type=test-message&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 07:15:18 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "71B7D604-2FE4-40D4-8971-6EEF7BFAE7E6", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjIyOTE4NTU3NzU0MSJd" + }, + "type" : 2 + }, + { + "id" : "71B7D604-2FE4-40D4-8971-6EEF7BFAE7E6", + "type" : 4 + }, + { + "id" : "FFEF8F8F-BA34-49D7-A7E9-3E30AD80C199", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel-alpha,test-channel-beta?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=25&include_custom_message_type=1&include_message_type=1" + }, + "type" : 0 + }, + { + "id" : "FFEF8F8F-BA34-49D7-A7E9-3E30AD80C199", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel-alpha,test-channel-beta?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=25&include_custom_message_type=1&include_message_type=1", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Transfer-Encoding" : "Identity", + "Date" : "Sun, 10 Nov 2024 07:15:22 GMT", + "Content-Encoding" : "gzip", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "FFEF8F8F-BA34-49D7-A7E9-3E30AD80C199", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJlcnJvciI6IGZhbHNlLCAiZXJyb3JfbWVzc2FnZSI6ICIiLCAiY2hhbm5lbHMiOiB7InRlc3QtY2hhbm5lbC1hbHBoYSI6W3sibWVzc2FnZSI6eyJtZXNzYWdlSWR4IjoibWVzc2FnZTogMCIsInRpbWUiOjE1Nzc5MTg0MTJ9LCJ0aW1ldG9rZW4iOiIxNzMxMjIyOTExMzQ0MTc2NCIsIm1lc3NhZ2VfdHlwZSI6bnVsbCwidXVpZCI6IlNlcmhpaSIsImN1c3RvbV9tZXNzYWdlX3R5cGUiOiJ0ZXN0LW1lc3NhZ2UifSx7Im1lc3NhZ2UiOnsibWVzc2FnZUlkeCI6Im1lc3NhZ2U6IDEiLCJ0aW1lIjoxNTc3OTE4NDEzfSwidGltZXRva2VuIjoiMTczMTIyMjkxMTk0NTkzMzIiLCJtZXNzYWdlX3R5cGUiOm51bGwsInV1aWQiOiJTZXJoaWkiLCJjdXN0b21fbWVzc2FnZV90eXBlIjoidGVzdC1tZXNzYWdlIn0seyJtZXNzYWdlIjp7Im1lc3NhZ2VJZHgiOiJtZXNzYWdlOiAyIiwidGltZSI6MTU3NzkxODQxNH0sInRpbWV0b2tlbiI6IjE3MzEyMjI5MTI1MzI2NDk3IiwibWVzc2FnZV90eXBlIjpudWxsLCJ1dWlkIjoiU2VyaGlpIiwiY3VzdG9tX21lc3NhZ2VfdHlwZSI6InRlc3QtbWVzc2FnZSJ9LHsibWVzc2FnZSI6eyJtZXNzYWdlSWR4IjoibWVzc2FnZTogMyIsInRpbWUiOjE1Nzc5MTg0MTV9LCJ0aW1ldG9rZW4iOiIxNzMxMjIyOTEzMTEyNDYwOSIsIm1lc3NhZ2VfdHlwZSI6bnVsbCwidXVpZCI6IlNlcmhpaSIsImN1c3RvbV9tZXNzYWdlX3R5cGUiOiJ0ZXN0LW1lc3NhZ2UifV0sInRlc3QtY2hhbm5lbC1iZXRhIjpbeyJtZXNzYWdlIjp7Im1lc3NhZ2VJZHgiOiJtZXNzYWdlOiAwIiwidGltZSI6MTU3NzkxODQxMn0sInRpbWV0b2tlbiI6IjE3MzEyMjI5MTY3OTMyMDcwIiwibWVzc2FnZV90eXBlIjpudWxsLCJ1dWlkIjoiU2VyaGlpIiwiY3VzdG9tX21lc3NhZ2VfdHlwZSI6InRlc3QtbWVzc2FnZSJ9LHsibWVzc2FnZSI6eyJtZXNzYWdlSWR4IjoibWVzc2FnZTogMSIsInRpbWUiOjE1Nzc5MTg0MTN9LCJ0aW1ldG9rZW4iOiIxNzMxMjIyOTE3Mzc5NzExMSIsIm1lc3NhZ2VfdHlwZSI6bnVsbCwidXVpZCI6IlNlcmhpaSIsImN1c3RvbV9tZXNzYWdlX3R5cGUiOiJ0ZXN0LW1lc3NhZ2UifSx7Im1lc3NhZ2UiOnsibWVzc2FnZUlkeCI6Im1lc3NhZ2U6IDIiLCJ0aW1lIjoxNTc3OTE4NDE0fSwidGltZXRva2VuIjoiMTczMTIyMjkxNzk2Mzc0MjIiLCJtZXNzYWdlX3R5cGUiOm51bGwsInV1aWQiOiJTZXJoaWkiLCJjdXN0b21fbWVzc2FnZV90eXBlIjoidGVzdC1tZXNzYWdlIn0seyJtZXNzYWdlIjp7Im1lc3NhZ2VJZHgiOiJtZXNzYWdlOiAzIiwidGltZSI6MTU3NzkxODQxNX0sInRpbWV0b2tlbiI6IjE3MzEyMjI5MTg1NTc3NTQxIiwibWVzc2FnZV90eXBlIjpudWxsLCJ1dWlkIjoiU2VyaGlpIiwiY3VzdG9tX21lc3NhZ2VfdHlwZSI6InRlc3QtbWVzc2FnZSJ9XX19" + }, + "type" : 2 + }, + { + "id" : "FFEF8F8F-BA34-49D7-A7E9-3E30AD80C199", + "type" : 4 + }, + { + "id" : "7FF57078-2D50-4C04-80FD-193DFD304E05", + "data" : { + "method" : "delete", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel-alpha?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "7FF57078-2D50-4C04-80FD-193DFD304E05", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel-alpha?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 07:15:30 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "52", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "7FF57078-2D50-4C04-80FD-193DFD304E05", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJlcnJvciI6IGZhbHNlLCAiZXJyb3JfbWVzc2FnZSI6ICIifQ==" + }, + "type" : 2 + }, + { + "id" : "7FF57078-2D50-4C04-80FD-193DFD304E05", + "type" : 4 + }, + { + "id" : "F891112D-67DC-4BB2-A03A-60B8113F5C00", + "data" : { + "method" : "delete", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel-beta?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "F891112D-67DC-4BB2-A03A-60B8113F5C00", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel-beta?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 07:15:30 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "52", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "F891112D-67DC-4BB2-A03A-60B8113F5C00", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJlcnJvciI6IGZhbHNlLCAiZXJyb3JfbWVzc2FnZSI6ICIifQ==" + }, + "type" : 2 + }, + { + "id" : "F891112D-67DC-4BB2-A03A-60B8113F5C00", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryWithActionsUsingBuilderPatternInterface.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryWithActionsUsingBuilderPatternInterface.json index 21b4ba14e..abb418a45 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryWithActionsUsingBuilderPatternInterface.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchHistoryWithActionsUsingBuilderPatternInterface.json @@ -598,7 +598,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=16&include_meta=1&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=16&include_meta=1&include_message_type=1&include_custom_message_type=0" }, "type" : 0 }, @@ -607,7 +607,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=16&include_meta=1&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history-with-actions\/sub-key\/demo\/channel\/test-channel?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=16&include_meta=1&include_message_type=1&include_custom_message_type=0", "headers" : { "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", @@ -689,4 +689,4 @@ "id" : "25FC405C-400B-40E6-8AE7-B55BEBA1CFC0", "type" : 4 } -] \ No newline at end of file +] diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMessagesForEachChannelUsingBuilderPatternInterfaceWhenLimitIsSet.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMessagesForEachChannelUsingBuilderPatternInterfaceWhenLimitIsSet.json index 7071d30ee..b2de689d3 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMessagesForEachChannelUsingBuilderPatternInterfaceWhenLimitIsSet.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMessagesForEachChannelUsingBuilderPatternInterfaceWhenLimitIsSet.json @@ -424,7 +424,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=20&include_meta=1&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=20&include_meta=1&include_message_type=1&include_custom_message_type=0" }, "type" : 0 }, @@ -433,7 +433,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=20&include_meta=1&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=20&include_meta=1&include_message_type=1&include_custom_message_type=0", "headers" : { "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", @@ -569,4 +569,4 @@ "id" : "64F5D15E-CF9C-47A0-926D-528E3B8E1EFA", "type" : 4 } -] \ No newline at end of file +] diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMoreThan25MessagesForEachChannelWithUsedBatchBuilder.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMoreThan25MessagesForEachChannelWithUsedBatchBuilder.json index 2a51ecf5a..155433d02 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMoreThan25MessagesForEachChannelWithUsedBatchBuilder.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchMoreThan25MessagesForEachChannelWithUsedBatchBuilder.json @@ -2056,7 +2056,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=100&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=100&include_custom_message_type=0&include_message_type=1" }, "type" : 0 }, @@ -2065,7 +2065,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=100&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&max=100&include_custom_message_type=0&include_message_type=1", "headers" : { "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", @@ -2155,4 +2155,4 @@ "id" : "E1E2034E-B481-419F-ACE1-5B56D0789B1F", "type" : 4 } -] \ No newline at end of file +] diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelUsingBuilderPatternInterfaceAndReceiveResultWithExpectedOperation.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelUsingBuilderPatternInterfaceAndReceiveResultWithExpectedOperation.json index 839e5f6ea..7434f0818 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelUsingBuilderPatternInterfaceAndReceiveResultWithExpectedOperation.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelUsingBuilderPatternInterfaceAndReceiveResultWithExpectedOperation.json @@ -424,7 +424,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_custom_message_type=0&include_message_type=1" }, "type" : 0 }, @@ -433,7 +433,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_custom_message_type=0&include_message_type=1", "headers" : { "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", diff --git a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelWithOutUUIDUsingBuilder.json b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelWithOutUUIDUsingBuilder.json index b197bb43c..8d2af1402 100644 --- a/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelWithOutUUIDUsingBuilder.json +++ b/Tests/Support Files/Fixtures/PNHistoryIntegrationTests.bundle/ItShouldFetchOneMessageForEachChannelWithOutUUIDUsingBuilder.json @@ -424,7 +424,7 @@ }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_message_type=1" + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_custom_message_type=0&include_message_type=1" }, "type" : 0 }, @@ -433,7 +433,7 @@ "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_message_type=1", + "url" : "https:\/\/ps.pndsn.com\/v3\/history\/sub-key\/demo\/channel\/test-channel1,test-channel2?include_uuid=0&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&include_custom_message_type=0&include_message_type=1", "headers" : { "Access-Control-Allow-Methods" : "GET, POST, DELETE, OPTIONS", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", @@ -569,4 +569,4 @@ "id" : "7E42FE27-9BC5-4FC6-B8DE-4A72B5C10804", "type" : 4 } -] \ No newline at end of file +] diff --git a/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished.json b/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished.json index 9de005ea8..b70d4c4e8 100644 --- a/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished.json +++ b/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished.json @@ -1,36 +1,37 @@ [ { - "id" : "6D9CF0BE-C72E-451C-BD56-ADC3759E4907", + "id" : "0F3A5B90-2C09-4B7C-8092-59666491AF4F", "data" : { "method" : "get", "cls" : "NSURLRequest", "cellular" : true, "cache" : 1, - "timeout" : 60, + "timeout" : 310, "cookies" : true, "headers" : { - "User-Agent" : "iPhone; CPU iPhone OS 12.4.0 Version", + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", "Accept" : "*\/*", "Connection" : "keep-alive", "Accept-Encoding" : "gzip,deflate" }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&tt=0&heartbeat=20" + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?heartbeat=20&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&tt=0" }, "type" : 0 }, { - "id" : "6D9CF0BE-C72E-451C-BD56-ADC3759E4907", + "id" : "0F3A5B90-2C09-4B7C-8092-59666491AF4F", "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&tt=0&heartbeat=20", + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?heartbeat=20&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&tt=0", "headers" : { - "Access-Control-Allow-Methods" : "GET", + "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", - "Access-Control-Allow-Origin" : "*", - "Date" : "Tue, 04 Feb 2020 13:10:11 GMT", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 08:35:15 GMT", "Content-Length" : "45", "Cache-Control" : "no-cache", "Connection" : "keep-alive" @@ -39,70 +40,71 @@ "type" : 1 }, { - "id" : "6D9CF0BE-C72E-451C-BD56-ADC3759E4907", + "id" : "0F3A5B90-2C09-4B7C-8092-59666491AF4F", "data" : { "cls" : "NSData", - "base64" : "eyJ0Ijp7InQiOiIxNTgwODIxODExNDczMDU1OSIsInIiOjEyfSwibSI6W119" + "base64" : "eyJ0Ijp7InQiOiIxNzMxMjI3NzE1NjMyMTYxMSIsInIiOjIxfSwibSI6W119" }, "type" : 2 }, { - "id" : "6D9CF0BE-C72E-451C-BD56-ADC3759E4907", + "id" : "0F3A5B90-2C09-4B7C-8092-59666491AF4F", "type" : 4 }, { - "id" : "56380FEF-3510-4D26-8D88-22A028B35117", + "id" : "AF7BAA0C-C459-4EB3-AD37-78071046194A", "data" : { "method" : "get", "cls" : "NSURLRequest", "cellular" : true, "cache" : 1, - "timeout" : 60, + "timeout" : 310, "cookies" : true, "headers" : { - "User-Agent" : "iPhone; CPU iPhone OS 12.4.0 Version", + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", "Accept" : "*\/*", "Connection" : "keep-alive", "Accept-Encoding" : "gzip,deflate" }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=15808218114730559&heartbeat=20&tr=12" + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312277156321611&heartbeat=20&tr=21" }, "type" : 0 }, { - "id" : "9060F768-F824-4970-93AC-4BF1FA1121D3", + "id" : "328E4FC5-B27D-4203-A96E-111327D62C07", "data" : { "method" : "get", "cls" : "NSURLRequest", "cellular" : true, "cache" : 1, - "timeout" : 60, + "timeout" : 10, "cookies" : true, "headers" : { - "User-Agent" : "iPhone; CPU iPhone OS 12.4.0 Version", + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", "Accept" : "*\/*", "Connection" : "keep-alive", "Accept-Encoding" : "gzip,deflate" }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel1\/0\/%7B%22test-message%22:%5B%22message%22%5D%7D?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1" + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel1\/0\/%7B%22test-message%22:%5B%22message%22%5D%7D?custom_message_type=test-message-type&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&seqn=1" }, "type" : 0 }, { - "id" : "9060F768-F824-4970-93AC-4BF1FA1121D3", + "id" : "328E4FC5-B27D-4203-A96E-111327D62C07", "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel1\/0\/%7B%22test-message%22:%5B%22message%22%5D%7D?pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=Serhii", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel1\/0\/%7B%22test-message%22:%5B%22message%22%5D%7D?custom_message_type=test-message-type&uuid=Serhii&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", "headers" : { - "Access-Control-Allow-Methods" : "GET", + "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", - "Access-Control-Allow-Origin" : "*", - "Date" : "Tue, 04 Feb 2020 13:10:14 GMT", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 08:35:19 GMT", "Content-Length" : "30", "Cache-Control" : "no-cache", "Connection" : "keep-alive" @@ -111,29 +113,31 @@ "type" : 1 }, { - "id" : "9060F768-F824-4970-93AC-4BF1FA1121D3", + "id" : "328E4FC5-B27D-4203-A96E-111327D62C07", "data" : { "cls" : "NSData", - "base64" : "WzEsIlNlbnQiLCIxNTgwODIxODE0ODc5NTIwMCJd" + "base64" : "WzEsIlNlbnQiLCIxNzMxMjI3NzE5NTQyMzYzMyJd" }, "type" : 2 }, { - "id" : "9060F768-F824-4970-93AC-4BF1FA1121D3", + "id" : "328E4FC5-B27D-4203-A96E-111327D62C07", "type" : 4 }, { - "id" : "56380FEF-3510-4D26-8D88-22A028B35117", + "id" : "AF7BAA0C-C459-4EB3-AD37-78071046194A", "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", - "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=15808218114730559&heartbeat=20&tr=12", + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312277156321611&heartbeat=20&tr=21", "headers" : { - "Access-Control-Allow-Methods" : "GET", + "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", - "Access-Control-Allow-Origin" : "*", - "Date" : "Tue, 04 Feb 2020 13:10:14 GMT", - "Content-Length" : "261", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Transfer-Encoding" : "Identity", + "Date" : "Sun, 10 Nov 2024 08:35:19 GMT", + "Content-Encoding" : "gzip", "Cache-Control" : "no-cache", "Connection" : "keep-alive" } @@ -141,46 +145,46 @@ "type" : 1 }, { - "id" : "56380FEF-3510-4D26-8D88-22A028B35117", + "id" : "AF7BAA0C-C459-4EB3-AD37-78071046194A", "data" : { "cls" : "NSData", - "base64" : "eyJ0Ijp7InQiOiIxNTgwODIxODE0ODgwNDc4NyIsInIiOjEyfSwibSI6W3siYSI6IjUiLCJmIjowLCJpIjoiU2VyaGlpIiwicyI6MTAsInAiOnsidCI6IjE1ODA4MjE4MTQ4Nzk1MjAwIiwiciI6MTJ9LCJrIjoiZGVtbyIsImMiOiJ0ZXN0LWNoYW5uZWwxIiwiZCI6eyJ0ZXN0LW1lc3NhZ2UiOlsibWVzc2FnZSJdfX1dfQ==" + "base64" : "eyJ0Ijp7InQiOiIxNzMxMjI3NzE5NTQyMzYzMyIsInIiOjIxfSwibSI6W3siYSI6IjUiLCJmIjowLCJpIjoiU2VyaGlpIiwicyI6MSwicCI6eyJ0IjoiMTczMTIyNzcxOTU0MjM2MzMiLCJyIjoyMX0sImsiOiJkZW1vIiwiYyI6InRlc3QtY2hhbm5lbDEiLCJkIjp7InRlc3QtbWVzc2FnZSI6WyJtZXNzYWdlIl19LCJjbXQiOiJ0ZXN0LW1lc3NhZ2UtdHlwZSJ9XX0=" }, "type" : 2 }, { - "id" : "56380FEF-3510-4D26-8D88-22A028B35117", + "id" : "AF7BAA0C-C459-4EB3-AD37-78071046194A", "type" : 4 }, { - "id" : "8166D76F-F897-4ABB-934A-13726D756948", + "id" : "A8EF148E-8095-4A0F-8988-05A601DB93DA", "data" : { "method" : "get", "cls" : "NSURLRequest", "cellular" : true, "cache" : 1, - "timeout" : 60, + "timeout" : 310, "cookies" : true, "headers" : { - "User-Agent" : "iPhone; CPU iPhone OS 12.4.0 Version", + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", "Accept" : "*\/*", "Connection" : "keep-alive", "Accept-Encoding" : "gzip,deflate" }, "pipeline" : false, "network" : 0, - "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=15808218148804787&heartbeat=20&tr=12" + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312277195423633&heartbeat=20&tr=21" }, "type" : 0 }, { - "id" : "8166D76F-F897-4ABB-934A-13726D756948", + "id" : "A8EF148E-8095-4A0F-8988-05A601DB93DA", "data" : { "code" : -999, "info" : { - "NSErrorFailingURLStringKey" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=15808218148804787&heartbeat=20&tr=12", + "NSErrorFailingURLStringKey" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312277195423633&heartbeat=20&tr=21", "NSLocalizedDescription" : "cancelled", - "NSErrorFailingURLKey" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=15808218148804787&heartbeat=20&tr=12" + "NSErrorFailingURLKey" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312277195423633&heartbeat=20&tr=21" }, "cls" : "NSError", "domain" : "NSURLErrorDomain" @@ -188,16 +192,16 @@ "type" : 3 }, { - "id" : "1966F67F-1E40-41C0-B669-9A9607D8514C", + "id" : "6CD98803-49C9-42F3-AF90-1165CED57135", "data" : { "method" : "get", "cls" : "NSURLRequest", "cellular" : true, "cache" : 1, - "timeout" : 60, + "timeout" : 10, "cookies" : true, "headers" : { - "User-Agent" : "iPhone; CPU iPhone OS 12.4.0 Version", + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", "Accept" : "*\/*", "Connection" : "keep-alive", "Accept-Encoding" : "gzip,deflate" @@ -209,18 +213,18 @@ "type" : 0 }, { - "id" : "1966F67F-1E40-41C0-B669-9A9607D8514C", + "id" : "6CD98803-49C9-42F3-AF90-1165CED57135", "data" : { "status" : 200, "cls" : "NSHTTPURLResponse", "url" : "https:\/\/ps.pndsn.com\/v2\/presence\/sub_key\/demo\/channel\/test-channel1\/leave?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", "headers" : { - "Access-Control-Allow-Methods" : "OPTIONS, GET, POST", + "Access-Control-Allow-Credentials" : "true", "Content-Type" : "text\/javascript; charset=\"UTF-8\"", - "Server" : "Pubnub Presence", - "Access-Control-Allow-Origin" : "*", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "OPTIONS, GET, POST", "Age" : "0", - "Date" : "Tue, 04 Feb 2020 13:10:15 GMT", + "Date" : "Sun, 10 Nov 2024 08:35:20 GMT", "Accept-Ranges" : "bytes", "Content-Length" : "74", "Cache-Control" : "no-cache", @@ -230,7 +234,7 @@ "type" : 1 }, { - "id" : "1966F67F-1E40-41C0-B669-9A9607D8514C", + "id" : "6CD98803-49C9-42F3-AF90-1165CED57135", "data" : { "cls" : "NSData", "base64" : "eyJzdGF0dXMiOiAyMDAsICJtZXNzYWdlIjogIk9LIiwgImFjdGlvbiI6ICJsZWF2ZSIsICJzZXJ2aWNlIjogIlByZXNlbmNlIn0=" @@ -238,7 +242,7 @@ "type" : 2 }, { - "id" : "1966F67F-1E40-41C0-B669-9A9607D8514C", + "id" : "6CD98803-49C9-42F3-AF90-1165CED57135", "type" : 4 } ] \ No newline at end of file diff --git a/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveSignalWhenSent.json b/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveSignalWhenSent.json new file mode 100644 index 000000000..a334cb5a4 --- /dev/null +++ b/Tests/Support Files/Fixtures/PNSubscribeIntegrationTest.bundle/ItShouldSubscribeToSingleChannelAndReceiveSignalWhenSent.json @@ -0,0 +1,248 @@ +[ + { + "id" : "9C967232-CB85-439C-8205-0F2427E24F95", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 310, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?heartbeat=20&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&tt=0" + }, + "type" : 0 + }, + { + "id" : "9C967232-CB85-439C-8205-0F2427E24F95", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?heartbeat=20&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii&tt=0", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 08:29:09 GMT", + "Content-Length" : "45", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "9C967232-CB85-439C-8205-0F2427E24F95", + "data" : { + "cls" : "NSData", + "base64" : "eyJ0Ijp7InQiOiIxNzMxMjI3MzQ5NzAzMzQxOSIsInIiOjIxfSwibSI6W119" + }, + "type" : 2 + }, + { + "id" : "9C967232-CB85-439C-8205-0F2427E24F95", + "type" : 4 + }, + { + "id" : "9AC04E8C-7541-476F-AC7C-19DA486730DD", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 310, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312273497033419&heartbeat=20&tr=21" + }, + "type" : 0 + }, + { + "id" : "13FD8804-A583-4D92-BB1E-3C25759269AC", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/signal\/demo\/demo\/0\/test-channel1\/0\/%7B%22test-message%22:%5B%22message%22%5D%7D?custom_message_type=test-message-type&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii" + }, + "type" : 0 + }, + { + "id" : "13FD8804-A583-4D92-BB1E-3C25759269AC", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/signal\/demo\/demo\/0\/test-channel1\/0\/%7B%22test-message%22:%5B%22message%22%5D%7D?custom_message_type=test-message-type&pnsdk=PubNub-ObjC-iOS\/4.x.x&uuid=Serhii", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Date" : "Sun, 10 Nov 2024 08:29:13 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "13FD8804-A583-4D92-BB1E-3C25759269AC", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNzMxMjI3MzUzNjIwOTg1MyJd" + }, + "type" : 2 + }, + { + "id" : "13FD8804-A583-4D92-BB1E-3C25759269AC", + "type" : 4 + }, + { + "id" : "9AC04E8C-7541-476F-AC7C-19DA486730DD", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312273497033419&heartbeat=20&tr=21", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "GET", + "Transfer-Encoding" : "Identity", + "Date" : "Sun, 10 Nov 2024 08:29:13 GMT", + "Content-Encoding" : "gzip", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "9AC04E8C-7541-476F-AC7C-19DA486730DD", + "data" : { + "cls" : "NSData", + "base64" : "eyJ0Ijp7InQiOiIxNzMxMjI3MzUzNjIwOTg1MyIsInIiOjIxfSwibSI6W3siYSI6IjUiLCJmIjowLCJlIjoxLCJpIjoiU2VyaGlpIiwicCI6eyJ0IjoiMTczMTIyNzM1MzYyMDk4NTMiLCJyIjoyMX0sImsiOiJkZW1vIiwiYyI6InRlc3QtY2hhbm5lbDEiLCJkIjp7InRlc3QtbWVzc2FnZSI6WyJtZXNzYWdlIl19LCJjbXQiOiJ0ZXN0LW1lc3NhZ2UtdHlwZSJ9XX0=" + }, + "type" : 2 + }, + { + "id" : "9AC04E8C-7541-476F-AC7C-19DA486730DD", + "type" : 4 + }, + { + "id" : "B337F4B1-0A13-4E89-B1FC-49F1E30EB089", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 310, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312273536209853&heartbeat=20&tr=21" + }, + "type" : 0 + }, + { + "id" : "B337F4B1-0A13-4E89-B1FC-49F1E30EB089", + "data" : { + "code" : -999, + "info" : { + "NSErrorFailingURLStringKey" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312273536209853&heartbeat=20&tr=21", + "NSLocalizedDescription" : "cancelled", + "NSErrorFailingURLKey" : "https:\/\/ps.pndsn.com\/v2\/subscribe\/demo\/test-channel1\/0?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&tt=17312273536209853&heartbeat=20&tr=21" + }, + "cls" : "NSError", + "domain" : "NSURLErrorDomain" + }, + "type" : 3 + }, + { + "id" : "4AC4E4D0-C178-4CC9-8C8B-A421528BF5AA", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 10, + "cookies" : true, + "headers" : { + "User-Agent" : "xctest\/23504 (iPhone; iOS 18.0.0; arm64) PubNub-ObjC\/5.6.1", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/v2\/presence\/sub_key\/demo\/channel\/test-channel1\/leave?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x" + }, + "type" : 0 + }, + { + "id" : "4AC4E4D0-C178-4CC9-8C8B-A421528BF5AA", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/v2\/presence\/sub_key\/demo\/channel\/test-channel1\/leave?uuid=Serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Credentials" : "true", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Expose-Headers" : "*", + "Access-Control-Allow-Methods" : "OPTIONS, GET, POST", + "Age" : "0", + "Date" : "Sun, 10 Nov 2024 08:29:28 GMT", + "Accept-Ranges" : "bytes", + "Content-Length" : "74", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "4AC4E4D0-C178-4CC9-8C8B-A421528BF5AA", + "data" : { + "cls" : "NSData", + "base64" : "eyJzdGF0dXMiOiAyMDAsICJtZXNzYWdlIjogIk9LIiwgImFjdGlvbiI6ICJsZWF2ZSIsICJzZXJ2aWNlIjogIlByZXNlbmNlIn0=" + }, + "type" : 2 + }, + { + "id" : "4AC4E4D0-C178-4CC9-8C8B-A421528BF5AA", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Tests/Helpers/PNRecordableTestCase.h b/Tests/Tests/Helpers/PNRecordableTestCase.h index d9163e032..5ba4b42d6 100644 --- a/Tests/Tests/Helpers/PNRecordableTestCase.h +++ b/Tests/Tests/Helpers/PNRecordableTestCase.h @@ -297,11 +297,43 @@ typedef void (^PNTClientDidReceiveStatusHandler)(PubNub *client, PNSubscribeStat toChannel:(NSString *)channel usingClient:(nullable PubNub *)client; +/** + * @brief Publish test messages to specified \c channel. + * + * @param messagesCount How many messages should be published to specified \c channel. + * @param channel Name of channel which will be used in test with pre-published messages. + * @param customMessageType Type which should be added as user-provided. + * @param client \b PubNub client which should be used to publish messages. Will use \c self.client + * if passed \c nil. + * + * @return List of published messages (each entry includes: message, timetoken and some include + * metadata). + */ +- (NSArray *)publishMessages:(NSUInteger)messagesCount + toChannel:(NSString *)channel + withCustomMessageType:(nullable NSString *)customMessageType + usingClient:(nullable PubNub *)client; + +/** + * @brief Publish test messages to set of specified \c channels. + * + * @param messagesCount How many messages should be published to each of specified \c channels. + * @param channels List of channel names which will be used in test with pre-published messages. + * @param client \b PubNub client which should be used to publish messages. Will use \c self.client + * if passed \c nil. + * + * @return List of published message and timetokens mapped to channel names. + */ +- (NSDictionary *> *)publishMessages:(NSUInteger)messagesCount + toChannels:(NSArray *)channels + usingClient:(nullable PubNub *)client; + /** * @brief Publish test messages to set of specified \c channels. * * @param messagesCount How many messages should be published to each of specified \c channels. * @param channels List of channel names which will be used in test with pre-published messages. + * @param customMessageType Type which should be added as user-provided. * @param client \b PubNub client which should be used to publish messages. Will use \c self.client * if passed \c nil. * @@ -309,6 +341,7 @@ typedef void (^PNTClientDidReceiveStatusHandler)(PubNub *client, PNSubscribeStat */ - (NSDictionary *> *)publishMessages:(NSUInteger)messagesCount toChannels:(NSArray *)channels + withCustomMessageType:(nullable NSString *)customMessageType usingClient:(nullable PubNub *)client; /** diff --git a/Tests/Tests/Helpers/PNRecordableTestCase.m b/Tests/Tests/Helpers/PNRecordableTestCase.m index b616f2d25..4c303d1a6 100644 --- a/Tests/Tests/Helpers/PNRecordableTestCase.m +++ b/Tests/Tests/Helpers/PNRecordableTestCase.m @@ -12,8 +12,12 @@ #pragma mark Defines #define WRITING_CASSETTES 0 -#define PUBNUB_LOGGER_ENABLED NO #define PUBNUB_DISABLE_LOGGER +#ifndef PUBNUB_DISABLE_LOGGER +#define PUBNUB_LOGGER_ENABLED YES +#else +#define PUBNUB_LOGGER_ENABLED NO +#endif #pragma mark - Types and structures @@ -491,7 +495,7 @@ - (BOOL)shouldSetupVCR { - (void)updateVCRConfigurationFromDefaultConfiguration:(YHVConfiguration *)configuration { #if WRITING_CASSETTES - NSString *cassettesPath = @"/Tests/Support Files/Fixtures"; + NSString *cassettesPath = @"/Users/sergey/Documents/Develop/Objective-C/PubNub SDK (public)/Tests/Support Files/Fixtures"; NSString *cassetteName = [NSStringFromClass([self class]) stringByAppendingPathExtension:@"bundle"]; configuration.cassettesPath = [cassettesPath stringByAppendingPathComponent:cassetteName]; #endif // WRITING_CASSETTES @@ -764,7 +768,11 @@ - (PNConfiguration *)defaultConfiguration { subscribeKey:subscribeKey userID:uuid]; configuration.authKey = [self pubNubAuthForTestCaseWithName:self.name]; - + + // TODO: REMOVE +// configuration.origin = @"ingress-tcp-pub.az1.pdx1.aws.int.ps.pn"; +// configuration.TLSEnabled = false; + return configuration; } @@ -779,7 +787,7 @@ - (PubNub *)client { - (PubNub *)createPubNubForUser:(NSString *)user { PNConfiguration *configuration = [self configurationForTestCaseWithName:self.name]; - + return [self createPubNubForUser:user withConfiguration:configuration]; } @@ -956,7 +964,15 @@ - (void)unsubscribeClient:(PubNub *)client fromChannelGroups:(NSArray *)publishMessages:(NSUInteger)messagesCount toChannel:(NSString *)channel +- (NSArray *)publishMessages:(NSUInteger)messagesCount + toChannel:(NSString *)channel + usingClient:(PubNub *)client { + return [self publishMessages:messagesCount toChannel:channel withCustomMessageType:nil usingClient:client]; +} + +- (NSArray *)publishMessages:(NSUInteger)messagesCount + toChannel:(NSString *)channel + withCustomMessageType:(NSString *)customMessageType usingClient:(PubNub *)client { NSMutableArray *messages = [NSMutableArray new]; @@ -972,7 +988,8 @@ - (void)unsubscribeClient:(PubNub *)client fromChannelGroups:(NSArray *> *)publishMessages:(NSUInteger)messagesCount + toChannels:(NSArray *)channels + withCustomMessageType:(NSString *)customMessageType + usingClient:(PubNub *)client { + + NSMutableDictionary *channelMessages = [NSMutableDictionary new]; + for (NSString *channel in channels) { channelMessages[channel] = [self publishMessages:messagesCount toChannel:channel + withCustomMessageType:customMessageType usingClient:client]; } - + return channelMessages; } diff --git a/Tests/Tests/Integration/Files/PNFilesIntegrationTests.m b/Tests/Tests/Integration/Files/PNFilesIntegrationTests.m index 680ab2d70..5f55f20b0 100644 --- a/Tests/Tests/Integration/Files/PNFilesIntegrationTests.m +++ b/Tests/Tests/Integration/Files/PNFilesIntegrationTests.m @@ -182,6 +182,52 @@ - (void)testItShouldSendFileFromDataAndReceiveFromHistory { [self waitTask:@"waitForDistribution" completionFor:1.f]; } +- (void)testItShouldSendFileFromDataWithCustomMessageTypeAndReceiveFromHistory { + NSString *fileName = [[NSUUID UUID].UUIDString stringByAppendingPathExtension:@"txt"]; + NSData *data = [[NSUUID UUID].UUIDString dataUsingEncoding:NSUTF8StringEncoding]; + NSString *excpectedMessageType = @"profile-image"; + + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNSendFileRequest *request = [PNSendFileRequest requestWithChannel:self.channel fileName:fileName data:data]; + request.customMessageType = excpectedMessageType; + [self.client sendFileWithRequest:request completion:^(PNSendFileStatus *status) { + XCTAssertFalse(status.isError); + XCTAssertTrue(status.data.fileUploaded); + XCTAssertNotNil(status.data.fileIdentifier); + XCTAssertNotNil(status.data.timetoken); + XCTAssertNotNil(status.data.fileName); + XCTAssertEqualObjects(status.data.fileName, fileName); + XCTAssertEqual(status.operation, PNSendFileOperation); + XCTAssertEqual(status.category, PNAcknowledgmentCategory); + + handler(); + }]; + }]; + + [self waitTask:@"waitForDistribution" completionFor:2.f]; + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNHistoryFetchRequest *request = [PNHistoryFetchRequest requestWithChannels:@[self.channel]]; + request.includeCustomMessageType = YES; + + [self.client fetchHistoryWithRequest:request completion:^(PNHistoryResult *result, PNErrorStatus *status) { + NSArray *messages = result.data.messages; + XCTAssertFalse(status.isError); + XCTAssertNotNil(messages); + XCTAssertEqual(messages.count, 1); + XCTAssertNotNil(messages.firstObject[@"uuid"]); + XCTAssertNotNil(messages.firstObject[@"messageType"]); + XCTAssertEqualObjects(messages.firstObject[@"messageType"], @4); + XCTAssertEqualObjects(messages.firstObject[@"customMessageType"], excpectedMessageType); + + handler(); + }]; + }]; + + [self waitTask:@"waitForDistribution" completionFor:1.f]; +} + - (void)testItShouldSendFileFromFileAndReceiveStatusWithExpectedOperationAndCategory { NSString *fileName = [[NSUUID UUID].UUIDString stringByAppendingPathExtension:@"txt"]; NSURL *fileURL = [NSURL URLWithString:[self.workingDirectory stringByAppendingPathComponent:fileName]]; diff --git a/Tests/Tests/Integration/PNHistoryIntegrationTests.m b/Tests/Tests/Integration/PNHistoryIntegrationTests.m index 224d957bf..7dc267d64 100644 --- a/Tests/Tests/Integration/PNHistoryIntegrationTests.m +++ b/Tests/Tests/Integration/PNHistoryIntegrationTests.m @@ -225,6 +225,100 @@ - (void)testItShouldFetchHistoryForChannelWithMetadataWhenFlagIsSet { [self deleteHistoryForChannel:channel usingClient:nil]; } +- (void)testItShouldFetchHistoryForChannelWithoutCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet { + NSString *channel = [self channelWithName:@"test-channel"]; + NSString *expectedMessageType = @"test-message"; + NSUInteger expectedMessagesCount = 4; + NSUInteger checkedMessageIdx = (NSUInteger)(expectedMessagesCount * 0.5f); + + [self publishMessages:expectedMessagesCount + toChannel:channel + withCustomMessageType:expectedMessageType + usingClient:nil]; + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNHistoryFetchRequest *request = [PNHistoryFetchRequest requestWithChannel:channel]; + request.includeCustomMessageType = YES; + [self.client fetchHistoryWithRequest:request completion:^(PNHistoryResult * result, PNErrorStatus * status) { + NSArray *fetchedMessages = result.data.messages; + XCTAssertNil(status); + XCTAssertNotNil(fetchedMessages); + XCTAssertNil(fetchedMessages[checkedMessageIdx][@"customMessageType"]); + XCTAssertEqual(result.operation, PNHistoryOperation); + + handler(); + }]; + }]; + + [self deleteHistoryForChannel:channel usingClient:nil]; +} + +- (void)testItShouldFetchHistoryForChannelWithCustomMessageTypeWhenIncludeCustomMessageTypeAndIncludeMessageActionsFlagIsSet { + NSString *channel = [self channelWithName:@"test-channel"]; + NSString *expectedMessageType = @"test-message"; + NSUInteger expectedMessagesCount = 4; + NSUInteger expectedActionsCount = 4; + NSUInteger checkedMessageIdx = (NSUInteger)(expectedMessagesCount * 0.5f); + + NSArray *publishedMessages = [self publishMessages:expectedMessagesCount + toChannel:channel + withCustomMessageType:expectedMessageType + usingClient:nil]; + NSArray *timetokens = [publishedMessages valueForKey:@"timetoken"]; + [self addActions:expectedActionsCount toMessages:timetokens inChannel:channel usingClient:nil]; + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNHistoryFetchRequest *request = [PNHistoryFetchRequest requestWithChannel:channel]; + request.includeCustomMessageType = YES; + request.includeMessageActions = YES; + [self.client fetchHistoryWithRequest:request completion:^(PNHistoryResult * result, PNErrorStatus * status) { + NSArray *fetchedMessages = result.data.messages; + XCTAssertNil(status); + XCTAssertNotNil(fetchedMessages); + XCTAssertNotNil(fetchedMessages[checkedMessageIdx][@"customMessageType"]); + XCTAssertEqualObjects(fetchedMessages[checkedMessageIdx][@"customMessageType"], expectedMessageType); + XCTAssertEqual(result.operation, PNHistoryWithActionsOperation); + + handler(); + }]; + }]; + + [self deleteHistoryForChannel:channel usingClient:nil]; +} + +- (void)testItShouldFetchHistoryForChannelsWithCustomMessageTypeWhenIncludeCustomMessageTypeFlagIsSet { + NSArray *channels = @[ + [self channelWithName:@"test-channel-alpha"], + [self channelWithName:@"test-channel-beta"] + ]; + NSString *expectedMessageType = @"test-message"; + NSUInteger expectedMessagesCount = 4; + NSUInteger checkedMessageIdx = (NSUInteger)(expectedMessagesCount * 0.5f); + + [self publishMessages:expectedMessagesCount + toChannels:channels + withCustomMessageType:expectedMessageType + usingClient:nil]; + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNHistoryFetchRequest *request = [PNHistoryFetchRequest requestWithChannels:channels]; + request.includeCustomMessageType = YES; + request.limit = 25; + [self.client fetchHistoryWithRequest:request completion:^(PNHistoryResult * result, PNErrorStatus * status) { + NSDictionary *> *fetchedMessages = result.data.channels; + XCTAssertNil(status); + XCTAssertNotNil(fetchedMessages); + XCTAssertEqualObjects(fetchedMessages[channels.lastObject][checkedMessageIdx][@"customMessageType"], + expectedMessageType); + XCTAssertEqual(result.operation, PNHistoryForChannelsOperation); + + handler(); + }]; + }]; + + [self deleteHistoryForChannels:channels usingClient:nil]; +} + - (void)testItShouldFetchHistoryForChannelWithEncryptedMessagesAndDecryptRandomIV { NSString *channel = [self channelWithName:@"test-channel"]; NSUInteger expectedMessagesCount = 4; diff --git a/Tests/Tests/Integration/PNSubscribeIntegrationTest.m b/Tests/Tests/Integration/PNSubscribeIntegrationTest.m index a32b452b8..f8077f038 100644 --- a/Tests/Tests/Integration/PNSubscribeIntegrationTest.m +++ b/Tests/Tests/Integration/PNSubscribeIntegrationTest.m @@ -1362,7 +1362,8 @@ - (void)testItShouldUnsubscribeFromAllChannelsAndGroupsUsingBuilderPatternInterf - (void)testItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished { NSDictionary *publishedMessage = @{ @"test-message": [self randomizedValuesWithValues:@[@"message"]] }; NSString *channel = [self channelWithName:@"test-channel1"]; - + NSString *expectedMessageType = @"test-message-type"; + [self subscribeClient:self.client toChannels:@[channel] withPresence:NO]; [self waitTask:@"waitForDistribution" completionFor:(YHVVCR.cassette.isNewCassette ? 3.f : 0.f)]; @@ -1374,6 +1375,7 @@ - (void)testItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished { if ([message.data.publisher isEqualToString:self.client.currentConfiguration.userID]) { XCTAssertEqualObjects(message.data.message, publishedMessage); + XCTAssertEqualObjects(message.data.customMessageType, expectedMessageType); XCTAssertEqualObjects(message.data.subscription, channel); XCTAssertEqualObjects(message.data.channel, channel); *remove = YES; @@ -1381,8 +1383,11 @@ - (void)testItShouldSubscribeToSingleChannelAndReceiveMessageWhenPublished { handler(); } }]; - - [self.client publish:publishedMessage toChannel:channel withCompletion:^(PNPublishStatus *status) { + + PNPublishRequest *request = [PNPublishRequest requestWithChannel:channel]; + request.message = publishedMessage; + request.customMessageType = expectedMessageType; + [self.client publishWithRequest:request completion:^(PNPublishStatus *status) { XCTAssertFalse(status.isError); }]; }]; @@ -1948,6 +1953,42 @@ - (void)testItShouldSubscribeToSingleChannelGroupWithOutCatchUpOnSecondChannelGr } +#pragma mark - Tests :: Signals + +- (void)testItShouldSubscribeToSingleChannelAndReceiveSignalWhenSent { + NSDictionary *message = @{ @"test-message": [self randomizedValuesWithValues:@[@"message"]] }; + NSString *channel = [self channelWithName:@"test-channel1"]; + NSString *expectedMessageType = @"test-message-type"; + + + [self subscribeClient:self.client toChannels:@[channel] withPresence:NO]; + [self waitTask:@"waitForDistribution" completionFor:(YHVVCR.cassette.isNewCassette ? 3.f : 0.f)]; + + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + [self addSignalHandlerForClient:self.client + withBlock:^(PubNub *client, PNSignalResult *signal, BOOL *remove) { + + if ([signal.data.publisher isEqualToString:self.client.currentConfiguration.userID]) { + XCTAssertEqualObjects(signal.data.message, message); + XCTAssertEqualObjects(signal.data.customMessageType, expectedMessageType); + XCTAssertEqualObjects(signal.data.subscription, channel); + XCTAssertEqualObjects(signal.data.channel, channel); + *remove = YES; + + handler(); + } + }]; + + PNSignalRequest *request = [PNSignalRequest requestWithChannel:channel signal:message]; + request.customMessageType = expectedMessageType; + [self.client sendSignalWithRequest:request completion:^(PNSignalStatus *status) { + XCTAssertFalse(status.isError); + }]; + }]; +} + + #pragma mark - Tests :: Messages filter expression - (void)testItShouldSubscribeToSingleChannelAndReceiveMessageWhenFilterExpressionIsSetToExactMatch { diff --git a/VERSION b/VERSION index b7c75422b..42cdd0b54 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.6.1 +5.7.0