Skip to content

Commit

Permalink
fix: improper way of handling customContext
Browse files Browse the repository at this point in the history
  • Loading branch information
1abhishekpandey committed Jan 20, 2023
1 parent 4bcaf61 commit fbe164e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Rudder (2.2.4)
- Rudder (2.2.5)

DEPENDENCIES:
- Rudder (from `.`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "."

SPEC CHECKSUMS:
Rudder: 5fb72ab3d09de72cab0a949aa7b1aad2f24947f9
Rudder: decdbd805872e80089665333f9752c8ed317c99d

PODFILE CHECKSUM: ee379229e6a0b60bc98226700ace2de002171547

Expand Down
7 changes: 4 additions & 3 deletions Sources/Classes/Client/Plugins/RSContextPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,19 @@ class RSContextPlugin: RSPlatformPlugin {
}

func insertDynamicOptionData(message: RSMessage, context: inout [String: Any]) {
/// First priority will given to the `option` passed along with the event
if let option = message.option {
if let externalIds = option.externalIds {
context["externalId"] = externalIds
}
if let customContexts = option.customContexts {
for key in customContexts.keys {
context[key] = [key: customContexts]
for (key, value) in customContexts {
context[key] = value
}
}
}
// TODO: Fetch `customContexts` set using setOption API.
}

}

extension RSClient {
Expand Down

0 comments on commit fbe164e

Please sign in to comment.