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]: shouldOpenURL delegate method not being called #39

Closed danielocampo2 closed 1 year ago

danielocampo2 commented 1 year ago

Platform

iOS

Platform Version

14.6

Braze SDK Version

5.9.0

Xcode Version

14.0.1

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Example:

  1. Extend BrazeDelegate in AppDelegate.swift.
  2. Set braze.delegate = self when initializing Braze instance.
  3. Implement func braze(_ braze: BrazeKit.Braze, shouldOpenURL context: BrazeKit.Braze.URLContext) -> Bool
  4. Run the app.
  5. Send notification to this user containing a deeplink to the app. (Deep Link into Application setting)
  6. Tap on the notification so the app is opened.

Expected Behavior

braze(_ braze: BrazeKit.Braze, shouldOpenURL context: BrazeKit.Braze.URLContext) is called in delegate with the deeplink information.

Actual Incorrect Behavior

braze(_ braze: BrazeKit.Braze, shouldOpenURL context: BrazeKit.Braze.URLContext) is never called.

Verbose Logs

No response

Additional Information

We are using the latest flutter plugin (braze-flutter-sdk), that needs native implementation.

This was working properly in braze-flutter-sdk 2.6.1 which used Braze iOS SDK 4.5.1.

This is our current configuration in AppDelegate.swift:

func configureBraze() {
        let brazeKey = Bundle.main.infoDictionary?["BrazeSdkKey"] as! String
        let brazeEndpoint = Bundle.main.infoDictionary?["BrazeEndpoint"] as! String
        let configuration = Braze.Configuration(
          apiKey: brazeKey,
          endpoint: brazeEndpoint
        )
        configuration.triggerMinimumTimeInterval = 0
        configuration.logger.level = .debug

        let braze = Braze(configuration: configuration)
        braze.delegate = self
        braze.enabled = true

        AppDelegate.braze = braze
}

func braze(_ braze: BrazeKit.Braze, shouldOpenURL context: BrazeKit.Braze.URLContext) -> Bool {
      let deeplink = context.url
      // Handle deeplink
      return false
}
lowip commented 1 year ago

Hi @danielocampo2,

Thank you for reporting this issue. Can you confirm the following:

danielocampo2 commented 1 year ago

Hi @lowip,

1) Yes, configureBraze() is called in application(_:didFinishLaunchingWithOptions:). 2) No, we are not using that method. Would that be useful in any way?

Thanks for your answer.

lowip commented 1 year ago
  1. Yes, configureBraze() is called in application(_:didFinishLaunchingWithOptions:).

Your integration looks good.

  1. No, we are not using that method. Would that be useful in any way?

This method overrides the braze.delegate, we'll refactor it to avoid that behavior. You shouldn't need to use it unless integrating our SDK Authentication feature.


For the next steps, could you please send to support@braze.com:

This will help us to reproduce locally the issue.

danielocampo2 commented 1 year ago

Thanks @lowip, I have already sent the requested information. Case Number: 00134624.

hokstuff commented 1 year ago

Hi @danielocampo2, are you still experiencing this issue?

ofournier-nuglif commented 1 year ago

Hi can you please look into this issue, we are waiting on it to migrate the SDK, thanks !

danielocampo2 commented 1 year ago

We are still waiting for an answer from support. They said the issue was complex so it is taking time to resolve.

We won't spent more time on this until we get an answer from them.

Anything you can do to speed up the process?

Thanks.

On Mon, Feb 20, 2023, 15:43 Olivier F @.***> wrote:

Hi can you please look into this issue, we are waiting on it to migrate the SDK, thanks !

— Reply to this email directly, view it on GitHub https://github.com/braze-inc/braze-swift-sdk/issues/39#issuecomment-1437129847, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY7UT7ZNZ667AERL52JH7DWYN7HJANCNFSM6AAAAAAUNVB75U . You are receiving this because you were mentioned.Message ID: @.***>

hokstuff commented 1 year ago

Closing this public issue based on the thread on the Support channels. For any additional follow-ups, feel free to send more info to our Support team - thanks!