braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: InAppMessageRaw.extras not copied over to InAppMessage.extras #26

Closed DangWW closed 2 years ago

DangWW commented 2 years ago

Platform

iOS

Platform Version

iOS 16.0

Braze SDK Version

5.6.1

Xcode Version

Version 14.1 (14B47b)

Computer Processor

Intel

Repro Rate

100%

Steps To Reproduce

  1. Create a raw message:

    let rawMessage = Braze.InAppMessageRaw()
    rawMessage.extras = ["stuff": "thing"]
    rawMessage.message = "test"
    rawMessage.header = "header"
  2. Convert to regular:

    let message = try Braze.InAppMessage(rawMessage)
  3. Observe extras are empty

    (LLDB) po try Braze.InAppMessage(rawMessage).extras
    0 elements

Expected Behavior

I would expect InAppMessage.extras to be the same as InAppMessageRaw.extras.

Actual Incorrect Behavior

InAppMessage.extras is empty

Verbose Logs

No response

Additional Information

No response

lowip commented 2 years ago

Hi @DangWW,

Thank you for reporting this issue. We have identified the problem and will release a fix as part of our next update.

We'll update here once that fix is released.

lowip commented 2 years ago

@DangWW,

I also wanted to add that in the meantime, you can create the Braze.InAppMessage directly. For instance, to create a modal with the specified properties:

let message = Braze.InAppMessage.modal(
  .init(
    data: .init(
      extras: ["stuff": "thing"]
    ),
    header: "header",
    message: "test"
  )
)
lowip commented 2 years ago

Hi @DangWW,

We have released 5.6.3 which fixes that issue.

Best,

DangWW commented 1 year ago

Thank you @lowip !