Skip to content

Commit 950e706

Browse files
authored
PubNub Swift Chat SDK 0.20.0 release (#20)
feat(async-await): add async/await counterparts to existing closure-based methods feat(async-await): add `AsyncStream` counterparts for methods returning `AutoCloseable` feat(tests): add a new Test Plan testing async/await methods and streams feat(tests): introduce common classes for unit test targets to centralize shared functionality and reduce duplication feat(message): add the new way to create a thread message fix(chat): provide a default `ChatConfiguration()` value in the `ChatImpl` constructor fix(chat): provide a default value for the `limit` parameter in the Chat's `getUsers(filter:sort:limit:page:completion:)` fix(membership): fix `PubNub.MembershipSortField` extension to handle all user sort options properly
1 parent 300f918 commit 950e706

File tree

60 files changed

+5800
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5800
-330
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
matrix:
3434
environment: [iOS]
35-
timeout-minutes: 18
35+
timeout-minutes: 21
3636
steps:
3737
- name: Checkout repository
3838
uses: actions/checkout@v4

.pubnub.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
name: swift-chat-sdk
22
scm: github.com/pubnub/swift-chat-sdk
3-
version: 0.12.0
3+
version: 0.20.0
44
schema: 1
55
changelog:
6+
- date: 2025-03-25
7+
version: 0.20.0
8+
changes:
9+
- type: feature
10+
text: "Add async/await counterparts to existing closure-based methods."
11+
- type: feature
12+
text: "Add `AsyncStream` counterparts for methods returning `AutoCloseable`."
13+
- type: feature
14+
text: "Add a new Test Plan testing async/await methods and streams."
15+
- type: feature
16+
text: "Add the new way to create a thread message."
17+
- type: bug
18+
text: "Provide a default `ChatConfiguration()` value in the `ChatImpl` constructor."
19+
- type: bug
20+
text: "Provide a default value for the `limit` parameter in the Chat's `getUsers(filter:sort:limit:page:completion:)`."
21+
- type: bug
22+
text: "Fix `PubNub.MembershipSortField` extension to handle all user sort options properly."
623
- date: 2025-03-21
724
version: 0.12.0
825
changes:
@@ -133,7 +150,7 @@ sdks:
133150
- distribution-type: source
134151
distribution-repository: GitHub release
135152
package-name: PubNubSwiftChatSDK
136-
location: https://github.com/pubnub/swift-chat-sdk/archive/refs/tags/0.12.0.zip
153+
location: https://github.com/pubnub/swift-chat-sdk/archive/refs/tags/0.20.0.zip
137154
supported-platforms:
138155
supported-operating-systems:
139156
iOS:

.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ disabled_rules:
66
- type_name
77
- function_body_length
88
- function_parameter_count
9+
- type_body_length
910
included:
1011
- Sources/
12+
- Tests/
1113
opt_in_rules:
1214
- force_unwrapping
1315
- overridden_super_call

PubNubSwiftChatSDK.xcodeproj/project.pbxproj

Lines changed: 226 additions & 15 deletions
Large diffs are not rendered by default.

PubNubSwiftChatSDK.xcodeproj/xcshareddata/xcschemes/PubNubSwiftChatSDK.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<TestPlans>
3232
<TestPlanReference
33-
reference = "container:Tests/PubNubSwiftChatSDKTests.xctestplan"
33+
reference = "container:Tests/PubNubSwiftChatSDKAsyncTests.xctestplan"
3434
default = "YES">
3535
</TestPlanReference>
3636
</TestPlans>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1530"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
</BuildAction>
10+
<TestAction
11+
buildConfiguration = "Debug"
12+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
13+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
14+
shouldUseLaunchSchemeArgsEnv = "YES"
15+
shouldAutocreateTestPlan = "YES">
16+
<Testables>
17+
<TestableReference
18+
skipped = "NO">
19+
<BuildableReference
20+
BuildableIdentifier = "primary"
21+
BlueprintIdentifier = "3D46D4552D131EB2007D08DB"
22+
BuildableName = "PubNubSwiftChatSDKAsyncTests.xctest"
23+
BlueprintName = "PubNubSwiftChatSDKAsyncTests"
24+
ReferencedContainer = "container:PubNubSwiftChatSDK.xcodeproj">
25+
</BuildableReference>
26+
</TestableReference>
27+
</Testables>
28+
</TestAction>
29+
<LaunchAction
30+
buildConfiguration = "Debug"
31+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
32+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
33+
launchStyle = "0"
34+
useCustomWorkingDirectory = "NO"
35+
ignoresPersistentStateOnLaunch = "NO"
36+
debugDocumentVersioning = "YES"
37+
debugServiceExtension = "internal"
38+
allowLocationSimulation = "YES">
39+
</LaunchAction>
40+
<ProfileAction
41+
buildConfiguration = "Release"
42+
shouldUseLaunchSchemeArgsEnv = "YES"
43+
savedToolIdentifier = ""
44+
useCustomWorkingDirectory = "NO"
45+
debugDocumentVersioning = "YES">
46+
</ProfileAction>
47+
<AnalyzeAction
48+
buildConfiguration = "Debug">
49+
</AnalyzeAction>
50+
<ArchiveAction
51+
buildConfiguration = "Release"
52+
revealArchiveInOrganizer = "YES">
53+
</ArchiveAction>
54+
</Scheme>

PubNubSwiftChatSDK/PubNubSwiftChatSDK.docc/Channel.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,79 +4,112 @@
44

55
### Receiving Updates
66

7+
- ``streamUpdates()``
78
- ``streamUpdates(callback:)``
9+
- ``streamUpdatesOn(channels:)``
810
- ``streamUpdatesOn(channels:callback:)``
11+
- ``streamReadReceipts()``
912
- ``streamReadReceipts(callback:)``
13+
- ``streamMessageReports()``
1014
- ``streamMessageReports(callback:)``
15+
- ``streamPresence()``
1116
- ``streamPresence(callback:)``
1217

1318
### Update and Delete a Channel
1419

20+
- ``update(name:custom:description:status:type:)``
1521
- ``update(name:custom:description:status:type:completion:)``
22+
- ``delete(soft:)``
1623
- ``delete(soft:completion:)``
1724

1825
### Typing Indicator
1926

27+
- ``startTyping()``
2028
- ``startTyping(completion:)``
29+
- ``stopTyping()``
2130
- ``stopTyping(completion:)``
31+
- ``getTyping()``
2232
- ``getTyping(callback:)``
2333

2434
### Presence Management
2535

36+
- ``whoIsPresent()``
2637
- ``whoIsPresent(completion:)``
38+
- ``isPresent(userId:)``
2739
- ``isPresent(userId:completion:)``
40+
- ``join(custom:)``
2841
- ``join(custom:callback:completion:)``
42+
- ``leave()``
2943
- ``leave(completion:)``
44+
- ``streamPresence()``
3045
- ``streamPresence(callback:)``
3146

3247
### Memberships Management
3348

49+
- ``invite(user:)``
3450
- ``invite(user:completion:)``
51+
- ``inviteMultiple(users:)``
3552
- ``inviteMultiple(users:completion:)``
53+
- ``getMembers(limit:page:filter:sort:)``
3654
- ``getMembers(limit:page:filter:sort:completion:)``
3755

3856
### Sending a text
3957

4058
- ``InputFile``
41-
- ``sendText(text:meta:shouldStore:usePost:ttl:mentionedUsers:referencedChannels:textLinks:quotedMessage:files:completion:)``
42-
- ``sendText(text:meta:shouldStore:usePost:ttl:quotedMessage:files:usersToMention:completion:)``
59+
- ``sendText(text:meta:shouldStore:usePost:ttl:quotedMessage:files:usersToMention:customPushData:)``
60+
- ``sendText(text:meta:shouldStore:usePost:ttl:quotedMessage:files:usersToMention:customPushData:completion:)``
61+
- ``sendText(text:meta:shouldStore:usePost:ttl:mentionedUsers:referencedChannels:textLinks:quotedMessage:files:customPushData:completion:)``
4362

4463
### Creating Message Draft
4564

4665
- ``createMessageDraft(userSuggestionSource:isTypingIndicatorTriggered:userLimit:channelLimit:)``
4766

4867
### Messages Management
4968

69+
- ``connect()``
5070
- ``connect(callback:)``
71+
- ``forward(message:)``
5172
- ``forward(message:completion:)``
73+
- ``getHistory(startTimetoken:endTimetoken:count:)``
5274
- ``getHistory(startTimetoken:endTimetoken:count:completion:)``
75+
- ``getMessage(timetoken:)``
5376
- ``getMessage(timetoken:completion:)``
5477

5578
### Pinning and Unpinning a Message
5679

80+
- ``pinMessage(message:)``
5781
- ``pinMessage(message:completion:)``
82+
- ``unpinMessage()``
5883
- ``unpinMessage(completion:)``
84+
- ``getPinnedMessage()``
5985
- ``getPinnedMessage(completion:)``
6086

6187
### Push Management
6288

89+
- ``registerForPush()``
6390
- ``registerForPush(completion:)``
91+
- ``unregisterFromPush()``
6492
- ``unregisterFromPush(completion:)``
6593

6694
### Delete a File
6795

96+
- ``deleteFile(id:name:)``
6897
- ``deleteFile(id:name:completion:)``
6998

7099
### Getting Files
71100

72101
- ``GetFileItem``
102+
- ``getFiles(limit:next:)``
73103
- ``getFiles(limit:next:completion:)``
74104

75105
### User Suggestions
76106

107+
- ``getUserSuggestions(text:limit:)``
77108
- ``getUserSuggestions(text:limit:completion:)``
78109

79110
### Message Reports
80111

112+
- ``getMessageReportsHistory(startTimetoken:endTimetoken:count:)``
81113
- ``getMessageReportsHistory(startTimetoken:endTimetoken:count:completion:)``
114+
- ``streamMessageReports()``
82115
- ``streamMessageReports(callback:)``

PubNubSwiftChatSDK/PubNubSwiftChatSDK.docc/ChannelImpl.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,79 +4,112 @@
44

55
### Receiving Updates
66

7+
- ``streamUpdates()``
78
- ``streamUpdates(callback:)``
9+
- ``streamUpdatesOn(channels:)``
810
- ``streamUpdatesOn(channels:callback:)``
11+
- ``streamReadReceipts()``
912
- ``streamReadReceipts(callback:)``
13+
- ``streamMessageReports()``
1014
- ``streamMessageReports(callback:)``
15+
- ``streamPresence()``
1116
- ``streamPresence(callback:)``
1217

1318
### Update and Delete a Channel
1419

20+
- ``update(name:custom:description:status:type:)``
1521
- ``update(name:custom:description:status:type:completion:)``
22+
- ``delete(soft:)``
1623
- ``delete(soft:completion:)``
1724

1825
### Typing Indicator
1926

27+
- ``startTyping()``
2028
- ``startTyping(completion:)``
29+
- ``stopTyping()``
2130
- ``stopTyping(completion:)``
31+
- ``getTyping()``
2232
- ``getTyping(callback:)``
2333

2434
### Presence Management
2535

36+
- ``whoIsPresent()``
2637
- ``whoIsPresent(completion:)``
38+
- ``isPresent(userId:)``
2739
- ``isPresent(userId:completion:)``
40+
- ``join(custom:)``
2841
- ``join(custom:callback:completion:)``
42+
- ``leave()``
2943
- ``leave(completion:)``
44+
- ``streamPresence()``
3045
- ``streamPresence(callback:)``
3146

3247
### Memberships Management
3348

49+
- ``invite(user:)``
3450
- ``invite(user:completion:)``
51+
- ``inviteMultiple(users:)``
3552
- ``inviteMultiple(users:completion:)``
53+
- ``getMembers(limit:page:filter:sort:)``
3654
- ``getMembers(limit:page:filter:sort:completion:)``
3755

3856
### Sending a text
3957

4058
- ``InputFile``
41-
- ``sendText(text:meta:shouldStore:usePost:ttl:mentionedUsers:referencedChannels:textLinks:quotedMessage:files:completion:)``
42-
- ``sendText(text:meta:shouldStore:usePost:ttl:quotedMessage:files:usersToMention:completion:)``
59+
- ``sendText(text:meta:shouldStore:usePost:ttl:quotedMessage:files:usersToMention:customPushData:)``
60+
- ``sendText(text:meta:shouldStore:usePost:ttl:quotedMessage:files:usersToMention:customPushData:completion:)``
61+
- ``sendText(text:meta:shouldStore:usePost:ttl:mentionedUsers:referencedChannels:textLinks:quotedMessage:files:customPushData:completion:)``
4362

4463
### Creating Message Draft
4564

4665
- ``createMessageDraft(userSuggestionSource:isTypingIndicatorTriggered:userLimit:channelLimit:)``
4766

4867
### Messages Management
4968

69+
- ``connect()``
5070
- ``connect(callback:)``
71+
- ``forward(message:)``
5172
- ``forward(message:completion:)``
73+
- ``getHistory(startTimetoken:endTimetoken:count:)``
5274
- ``getHistory(startTimetoken:endTimetoken:count:completion:)``
75+
- ``getMessage(timetoken:)``
5376
- ``getMessage(timetoken:completion:)``
5477

5578
### Pinning and Unpinning a Message
5679

80+
- ``pinMessage(message:)``
5781
- ``pinMessage(message:completion:)``
82+
- ``unpinMessage()``
5883
- ``unpinMessage(completion:)``
84+
- ``getPinnedMessage()``
5985
- ``getPinnedMessage(completion:)``
6086

6187
### Push Management
6288

89+
- ``registerForPush()``
6390
- ``registerForPush(completion:)``
91+
- ``unregisterFromPush()``
6492
- ``unregisterFromPush(completion:)``
6593

6694
### Delete a File
6795

96+
- ``deleteFile(id:name:)``
6897
- ``deleteFile(id:name:completion:)``
6998

7099
### Getting Files
71100

72101
- ``GetFileItem``
102+
- ``getFiles(limit:next:)``
73103
- ``getFiles(limit:next:completion:)``
74104

75105
### User Suggestions
76106

107+
- ``getUserSuggestions(text:limit:)``
77108
- ``getUserSuggestions(text:limit:completion:)``
78109

79110
### Message Reports
80111

112+
- ``getMessageReportsHistory(startTimetoken:endTimetoken:count:)``
81113
- ``getMessageReportsHistory(startTimetoken:endTimetoken:count:completion:)``
114+
- ``streamMessageReports()``
82115
- ``streamMessageReports(callback:)``

0 commit comments

Comments
 (0)