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]: Not getting Bool to decide to opening of URL through WebView or external browser #136

Closed asadkazmi-mset closed 3 months ago

asadkazmi-mset commented 3 months ago

Platform

iOS

Platform Version

17.2

Braze SDK Version

7.7.0

Xcode Version

15.2

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Example:

  1. Adding this line "contentCard.openUrlInWebView" is no longer working in the new verison of braze swift sdk
  2. compile time error "Value of type 'Braze.ContentCard' has no dynamic member 'openUrlInWebView' using key path from root type 'Braze.ContentCard.Data'"

Expected Behavior

this must suggest to use of alternate variables instead of this

Actual Incorrect Behavior

It is not suggesting the alternate variable, and when I jump to SDK code there are no any webview related variable there in the Braze.ContentCard But I can see the alternate of "openWebView" in Braze.NewsFeed that is "useWebView", so there should be something for Braze.ContentCard

Verbose Logs

No response

Additional Information

This is the error when I'm trying to access the "openUrlInWebView" in the case of content card

Screenshot 2024-08-06 at 1 00 44 PM

But able to see the alternat of "openUrlInWebView" in the case of NewsFeed that is "useWebView"

Screenshot 2024-08-06 at 1 01 04 PM

Please suggest me the alternate of openURLInWebView (Bool) for content card.

Thanks.

jerielng commented 3 months ago

Hi @asadkazmi-mset, the useWebView property should live inside the ClickAction enum property of that Braze.ContentCard. So you can access it like this:

if case let .url(url, useWebView) = contentCard.clickAction {
  print(useWebView)
}
asadkazmi-mset commented 3 months ago

Thank you @jerielng

jerielng commented 3 months ago

No problem @asadkazmi-mset! I'll close out this issue now, but feel free to reach back out if you have any additional questions. Thanks!