Skip to content

Commit e52924c

Browse files
Add missing implementation for ChannelGroup entity (Apple and JS platforms) (#355)
* PubNub SDK v10.5.3 release. --------- Co-authored-by: PubNub Release Bot <[email protected]>
1 parent 3e5d15c commit e52924c

File tree

10 files changed

+51
-12
lines changed

10 files changed

+51
-12
lines changed

.pubnub.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: kotlin
2-
version: 10.5.2
2+
version: 10.5.3
33
schema: 1
44
scm: github.com/pubnub/kotlin
55
files:
6-
- build/libs/pubnub-kotlin-10.5.2-all.jar
6+
- build/libs/pubnub-kotlin-10.5.3-all.jar
77
sdks:
88
-
99
type: library
@@ -23,8 +23,8 @@ sdks:
2323
-
2424
distribution-type: library
2525
distribution-repository: maven
26-
package-name: pubnub-kotlin-10.5.2
27-
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.5.2/pubnub-kotlin-10.5.2.jar
26+
package-name: pubnub-kotlin-10.5.3
27+
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.5.3/pubnub-kotlin-10.5.3.jar
2828
supported-platforms:
2929
supported-operating-systems:
3030
Android:
@@ -121,6 +121,11 @@ sdks:
121121
license-url: https://www.apache.org/licenses/LICENSE-2.0.txt
122122
is-required: Required
123123
changelog:
124+
- date: 2025-07-03
125+
version: v10.5.3
126+
changes:
127+
- type: bug
128+
text: "Internal fixes."
124129
- date: 2025-05-15
125130
version: v10.5.2
126131
changes:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v10.5.3
2+
July 03 2025
3+
4+
#### Fixed
5+
- Internal fixes.
6+
17
## v10.5.2
28
May 15 2025
39

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your
2020
<dependency>
2121
<groupId>com.pubnub</groupId>
2222
<artifactId>pubnub-kotlin</artifactId>
23-
<version>10.5.2</version>
23+
<version>10.5.3</version>
2424
</dependency>
2525
```
2626

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true
1818
SONATYPE_HOST=DEFAULT
1919
SONATYPE_AUTOMATIC_RELEASE=false
2020
GROUP=com.pubnub
21-
VERSION_NAME=10.5.2
21+
VERSION_NAME=10.5.3
2222
POM_PACKAGING=jar
2323

2424
POM_NAME=PubNub SDK

pubnub-kotlin/pubnub-kotlin-api/src/appleMain/kotlin/com/pubnub/internal/entities/ChannelGroupImpl.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.pubnub.internal.entities
33
import cocoapods.PubNubSwift.KMPChannelGroupEntity
44
import cocoapods.PubNubSwift.KMPSubscription
55
import com.pubnub.api.v2.entities.ChannelGroup
6+
import com.pubnub.api.v2.subscriptions.ReceivePresenceEventsImpl
67
import com.pubnub.api.v2.subscriptions.Subscription
78
import com.pubnub.api.v2.subscriptions.SubscriptionOptions
89
import com.pubnub.internal.subscription.SubscriptionImpl
@@ -16,7 +17,9 @@ class ChannelGroupImpl(
1617
get() = channelGroup.name()
1718

1819
override fun subscription(options: SubscriptionOptions): Subscription {
19-
// TODO: Add support for handling SubscriptionOptions
20-
return SubscriptionImpl(objCSubscription = KMPSubscription(entity = channelGroup))
20+
val presenceOptions = options.allOptions.filterIsInstance<ReceivePresenceEventsImpl>()
21+
val objcSubscription = KMPSubscription(channelGroup, presenceOptions.isNotEmpty())
22+
23+
return SubscriptionImpl(objcSubscription)
2124
}
2225
}

pubnub-kotlin/pubnub-kotlin-api/src/appleMain/kotlin/com/pubnub/internal/entities/ChannelImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class ChannelImpl(
5858
override val name: String
5959
get() = channel.name()
6060

61-
// TODO: Add support for handling SubscriptionOptions
6261
override fun subscription(options: SubscriptionOptions): Subscription {
6362
val presenceOptions = options.allOptions.filterIsInstance<ReceivePresenceEventsImpl>()
6463
val objcSubscription = KMPSubscription(channel, presenceOptions.isNotEmpty())

pubnub-kotlin/pubnub-kotlin-api/src/jsMain/kotlin/com/pubnub/api/PubNubImpl.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ import com.pubnub.api.v2.subscriptions.ReceivePresenceEventsImpl
126126
import com.pubnub.api.v2.subscriptions.Subscription
127127
import com.pubnub.api.v2.subscriptions.SubscriptionOptions
128128
import com.pubnub.api.v2.subscriptions.SubscriptionSet
129+
import com.pubnub.internal.v2.entities.ChannelGroupImpl
129130
import com.pubnub.internal.v2.entities.ChannelImpl
130131
import com.pubnub.internal.v2.subscriptions.SubscriptionSetImpl
131132
import com.pubnub.kmp.CustomObject
@@ -1202,7 +1203,7 @@ class PubNubImpl(val jsPubNub: PubNubJs) : PubNub {
12021203
}
12031204

12041205
override fun channelGroup(name: String): ChannelGroup {
1205-
TODO("Not yet implemented")
1206+
return ChannelGroupImpl(jsPubNub.asDynamic().channelGroup(name))
12061207
}
12071208

12081209
override fun channelMetadata(id: String): ChannelMetadata {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.pubnub.internal.v2.entities
2+
3+
import com.pubnub.api.v2.entities.ChannelGroup
4+
import com.pubnub.api.v2.subscriptions.ReceivePresenceEventsImpl
5+
import com.pubnub.api.v2.subscriptions.Subscription
6+
import com.pubnub.api.v2.subscriptions.SubscriptionOptions
7+
import com.pubnub.internal.v2.subscriptions.SubscriptionImpl
8+
import com.pubnub.kmp.createJsObject
9+
10+
class ChannelGroupImpl(private val jsChannelGroup: dynamic) : ChannelGroup {
11+
override val name: String
12+
get() = jsChannelGroup.name
13+
14+
override fun subscription(options: SubscriptionOptions): Subscription { // TODO: Handle missing filter options
15+
return SubscriptionImpl(
16+
jsChannelGroup.subscription(
17+
createJsObject<PubNub.SubscriptionOptions> {
18+
if (options.allOptions.filterIsInstance<ReceivePresenceEventsImpl>().isNotEmpty()) {
19+
receivePresenceEvents = true
20+
}
21+
}
22+
)
23+
)
24+
}
25+
}

pubnub-kotlin/pubnub-kotlin-api/src/jsMain/kotlin/com/pubnub/internal/v2/entities/ChannelImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ChannelImpl(private val jsChannel: dynamic) : Channel {
5454
override val name: String
5555
get() = jsChannel.name
5656

57-
override fun subscription(options: SubscriptionOptions): Subscription { // todo use options
57+
override fun subscription(options: SubscriptionOptions): Subscription { // TODO: Handle missing filter options
5858
return SubscriptionImpl(
5959
jsChannel.subscription(
6060
createJsObject<PubNub.SubscriptionOptions> {

pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PubNubImplTest : BaseTest() {
5656
fun getVersionAndTimeStamp() {
5757
val version = PubNubImpl.SDK_VERSION
5858
val timeStamp = PubNubImpl.timestamp()
59-
assertEquals("10.5.2", version)
59+
assertEquals("10.5.3", version)
6060
assertTrue(timeStamp > 0)
6161
}
6262

0 commit comments

Comments
 (0)