Skip to content

Commit

Permalink
Add internal fixes to the publish method for Apple platforms (#327)
Browse files Browse the repository at this point in the history
* PubNub SDK v10.3.4 release
  • Loading branch information
jguz-pubnub authored Jan 13, 2025
1 parent 5779f48 commit 11f1678
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
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.3.3
version: 10.3.4
schema: 1
scm: github.com/pubnub/kotlin
files:
- build/libs/pubnub-kotlin-10.3.3-all.jar
- build/libs/pubnub-kotlin-10.3.4-all.jar
sdks:
-
type: library
Expand All @@ -23,8 +23,8 @@ sdks:
-
distribution-type: library
distribution-repository: maven
package-name: pubnub-kotlin-10.3.3
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.3/pubnub-kotlin-10.3.3.jar
package-name: pubnub-kotlin-10.3.4
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.4/pubnub-kotlin-10.3.4.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-01-13
version: v10.3.4
changes:
- type: bug
text: "Internal fixes."
- date: 2025-01-07
version: v10.3.3
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.3.4
January 13 2025

#### Fixed
- Internal fixes.

## v10.3.3
January 07 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.3.3</version>
<version>10.3.4</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.3.3
VERSION_NAME=10.3.4
POM_PACKAGING=jar

POM_NAME=PubNub SDK
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dokka = "1.9.20"
kotlinx_datetime = "0.6.1"
kotlinx_coroutines = "1.9.0"
pubnub_js = "8.4.1"
pubnub_swift = "8.2.3"
pubnub_swift = "8.2.4"

[libraries]
retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class PubNubImpl(private val pubNubObjC: KMPPubNub) : PubNub {
pubNubObjC.removeAllListeners()
}

// TODO: replicate and usePost parameters are not present in Swift SDK
// TODO: replicate is not present in Swift SDK
override fun publish(
channel: String,
message: Any,
Expand All @@ -206,19 +206,20 @@ class PubNubImpl(private val pubNubObjC: KMPPubNub) : PubNub {
message = message,
meta = meta,
shouldStore = shouldStore,
usePost = usePost,
ttl = ttl,
customMessageType = customMessageType
)
}

// TODO: usePost parameter is not present in Swift SDK
override fun fire(channel: String, message: Any, meta: Any?, usePost: Boolean): Publish {
return PublishImpl(
pubnub = pubNubObjC,
channel = channel,
message = message,
meta = meta,
shouldStore = false,
usePost = usePost,
ttl = 0,
customMessageType = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class PublishImpl(
private val message: Any,
private val meta: Any?,
private val shouldStore: Boolean?,
private val usePost: Boolean,
private val ttl: Int?,
private val customMessageType: String?
) : Publish {
Expand All @@ -32,6 +33,7 @@ class PublishImpl(
message = message,
meta = meta,
shouldStore = shouldStore?.let { NSNumber(bool = it) },
usePost = NSNumber(bool = usePost),
ttl = ttl?.let { NSNumber(it) },
customMessageType = customMessageType,
onSuccess = callback.onSuccessHandler { PNPublishResult(it.toLong()) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ private fun MembershipInclude.toMembershipIncludeOptions(): PubNubJs.MembershipI
}

private fun MemberInclude.toMemberIncludeOptions(): PubNubJs.IncludeOptions {
return createJsObject<PubNubJs.IncludeOptions> {
return createJsObject<PubNubJs.IncludeOptions> {
this.totalCount = this@toMemberIncludeOptions.includeTotalCount
this.customFields = this@toMemberIncludeOptions.includeCustom
this.UUIDFields = this@toMemberIncludeOptions.includeUser
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.3.3", version)
assertEquals("10.3.4", version)
assertTrue(timeStamp > 0)
}

Expand Down

0 comments on commit 11f1678

Please sign in to comment.