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]: Migrating new SDK - missing methods and variables #10

Closed yDvash closed 2 years ago

yDvash commented 2 years ago

Platform

iOS

Platform Version

iOS 14

Braze SDK Version

Latest

Xcode Version

13.3

Computer Processor

Apple (M1)

Repro Rate

100

Steps To Reproduce

We are migrating the new BrazeKit SDK instead of the old AppBoy SDK, But I found there some methods and variables that aren't available, for example:

Appboy.disableSDK() Appboy.requestEnableSDKOnNextAppRun()

Are you intent to add them in future release? or they are no longer needed? and we can deprecate them safely?

Plus, we used to fetch urlString from the old content card (ABK...) and with the new Braze.ContentCard - the variable are missing...

Expected Behavior

.

Actual Incorrect Behavior

.

Verbose Logs

No response

Additional Information

No response

lowip commented 2 years ago

Hi @YardenDvash, thanks for opening this issue.

We are still in the process of writing our migration guide, you can track our Upcoming Feature Roadmap here.


To answer your questions:

But I found there some methods and variables that aren't available, for example:

Appboy.disableSDK() Appboy.requestEnableSDKOnNextAppRun()

In the Swift SDK, you can use the enabled property on the braze instance:

// Disable the SDK, stays disabled even accross app launches
braze.enabled = false

// Re-enable the SDK at any time
braze.enabled = true

Alternatively, if storing your braze instance as an Optional:

// Destroy the braze instance
AppDelegate.braze = nil

// Re-create a new braze instance at any time
AppDeleage.braze = Braze(configuration: /* ... */)

Plus, we used to fetch urlString from the old content card (ABK...) and with the new Braze.ContentCard - the variable are missing...

You can access the url via the card's clickAction property:

// Get the click action:
let clickAction = card.data.clickAction

// The `data` key path can be omitted
let clickAction = card.clickAction

// Extract the url from the click action
if case .uri(let uri, let useWebView) = clickAction {
  print("Content Card uri:", uri)
}

In the next release of the SDK, you will be able to simply write:

if let url = card.clickAction.uri {
  // Do something with the url
}

I'm closing the issue as you should have everything needed here. If that's not the case, feel free to re-open the issue with additional details.

Thanks,