Skip to content

Commit

Permalink
Add internal fixes to the publish method for Apple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
jguz-pubnub committed Jan 10, 2025
1 parent 5779f48 commit ae7ddde
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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,6 +206,7 @@ class PubNubImpl(private val pubNubObjC: KMPPubNub) : PubNub {
message = message,
meta = meta,
shouldStore = shouldStore,
usePost = usePost,
ttl = ttl,
customMessageType = customMessageType
)
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 = usePost?.let { NSNumber(bool = it) },
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

0 comments on commit ae7ddde

Please sign in to comment.