Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: kotlin
version: 10.5.2
version: 10.5.3
schema: 1
scm: github.com/pubnub/kotlin
files:
- build/libs/pubnub-kotlin-10.5.2-all.jar
- build/libs/pubnub-kotlin-10.5.3-all.jar
sdks:
-
type: library
Expand All @@ -23,8 +23,8 @@ sdks:
-
distribution-type: library
distribution-repository: maven
package-name: pubnub-kotlin-10.5.2
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.5.2/pubnub-kotlin-10.5.2.jar
package-name: pubnub-kotlin-10.5.3
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.5.3/pubnub-kotlin-10.5.3.jar
supported-platforms:
supported-operating-systems:
Android:
Expand Down Expand Up @@ -121,6 +121,11 @@ sdks:
license-url: https://www.apache.org/licenses/LICENSE-2.0.txt
is-required: Required
changelog:
- date: 2025-07-03
version: v10.5.3
changes:
- type: bug
text: "Internal fixes."
- date: 2025-05-15
version: v10.5.2
changes:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v10.5.3
July 03 2025

#### Fixed
- Internal fixes.

## v10.5.2
May 15 2025

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your
<dependency>
<groupId>com.pubnub</groupId>
<artifactId>pubnub-kotlin</artifactId>
<version>10.5.2</version>
<version>10.5.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true
SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=false
GROUP=com.pubnub
VERSION_NAME=10.5.2
VERSION_NAME=10.5.3
POM_PACKAGING=jar

POM_NAME=PubNub SDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.pubnub.internal.entities
import cocoapods.PubNubSwift.KMPChannelGroupEntity
import cocoapods.PubNubSwift.KMPSubscription
import com.pubnub.api.v2.entities.ChannelGroup
import com.pubnub.api.v2.subscriptions.ReceivePresenceEventsImpl
import com.pubnub.api.v2.subscriptions.Subscription
import com.pubnub.api.v2.subscriptions.SubscriptionOptions
import com.pubnub.internal.subscription.SubscriptionImpl
Expand All @@ -16,7 +17,9 @@ class ChannelGroupImpl(
get() = channelGroup.name()

override fun subscription(options: SubscriptionOptions): Subscription {
// TODO: Add support for handling SubscriptionOptions
return SubscriptionImpl(objCSubscription = KMPSubscription(entity = channelGroup))
val presenceOptions = options.allOptions.filterIsInstance<ReceivePresenceEventsImpl>()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there are tests for a channel/channel group entity in this repository:

https://github.com/pubnub/kotlin/blob/master/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/SubscribeIntegrationTests.kt

However, by default, they are only executed on the jvm target. We would need to replicate the same effort here as was done in the KMP chat project

val objcSubscription = KMPSubscription(channelGroup, presenceOptions.isNotEmpty())

return SubscriptionImpl(objcSubscription)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class ChannelImpl(
override val name: String
get() = channel.name()

// TODO: Add support for handling SubscriptionOptions
override fun subscription(options: SubscriptionOptions): Subscription {
val presenceOptions = options.allOptions.filterIsInstance<ReceivePresenceEventsImpl>()
val objcSubscription = KMPSubscription(channel, presenceOptions.isNotEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import com.pubnub.api.v2.subscriptions.ReceivePresenceEventsImpl
import com.pubnub.api.v2.subscriptions.Subscription
import com.pubnub.api.v2.subscriptions.SubscriptionOptions
import com.pubnub.api.v2.subscriptions.SubscriptionSet
import com.pubnub.internal.v2.entities.ChannelGroupImpl
import com.pubnub.internal.v2.entities.ChannelImpl
import com.pubnub.internal.v2.subscriptions.SubscriptionSetImpl
import com.pubnub.kmp.CustomObject
Expand Down Expand Up @@ -1202,7 +1203,7 @@ class PubNubImpl(val jsPubNub: PubNubJs) : PubNub {
}

override fun channelGroup(name: String): ChannelGroup {
TODO("Not yet implemented")
return ChannelGroupImpl(jsPubNub.asDynamic().channelGroup(name))
}

override fun channelMetadata(id: String): ChannelMetadata {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.pubnub.internal.v2.entities

import com.pubnub.api.v2.entities.ChannelGroup
import com.pubnub.api.v2.subscriptions.ReceivePresenceEventsImpl
import com.pubnub.api.v2.subscriptions.Subscription
import com.pubnub.api.v2.subscriptions.SubscriptionOptions
import com.pubnub.internal.v2.subscriptions.SubscriptionImpl
import com.pubnub.kmp.createJsObject

class ChannelGroupImpl(private val jsChannelGroup: dynamic) : ChannelGroup {
override val name: String
get() = jsChannelGroup.name

override fun subscription(options: SubscriptionOptions): Subscription { // TODO: Handle missing filter options
return SubscriptionImpl(
jsChannelGroup.subscription(
createJsObject<PubNub.SubscriptionOptions> {
if (options.allOptions.filterIsInstance<ReceivePresenceEventsImpl>().isNotEmpty()) {
receivePresenceEvents = true
}
}
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ChannelImpl(private val jsChannel: dynamic) : Channel {
override val name: String
get() = jsChannel.name

override fun subscription(options: SubscriptionOptions): Subscription { // todo use options
override fun subscription(options: SubscriptionOptions): Subscription { // TODO: Handle missing filter options
return SubscriptionImpl(
jsChannel.subscription(
createJsObject<PubNub.SubscriptionOptions> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PubNubImplTest : BaseTest() {
fun getVersionAndTimeStamp() {
val version = PubNubImpl.SDK_VERSION
val timeStamp = PubNubImpl.timestamp()
assertEquals("10.5.2", version)
assertEquals("10.5.3", version)
assertTrue(timeStamp > 0)
}

Expand Down
Loading