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]: braze:shouldOpenURL not being called when app is closed #106

Closed miquelalvarado closed 3 months ago

miquelalvarado commented 9 months ago

Platform

iOS

Platform Version

iOS 17.2

Braze SDK Version

7.5.0

Xcode Version

Xcode 15

Computer Processor

Apple (M1)

Repro Rate

100% of the time

Steps To Reproduce

Example:

  1. App is closed and waiting to be run.
  2. Send a push notification from Braze with a Deeplink on it.
  3. Tap on the received push notification.

Expected Behavior

App is opened, Braze is able to handle the push notification and deeplink to the section

Actual Incorrect Behavior

Home view is opened, no deeplink is processed

Verbose Logs

No response

Additional Information

When the application is in background it calls the delegate method as expected but when the app is completely closed it doesn't call it. One thing worth to say is that we delay the initialisation of the SDK but even so, we are capturing any push notification received before Braze is initialised and forward it once it is ready. Attaching a screenshot so that you see the process:

image (1)

As you can see in the screenshot we retain any userInfo and/or response received and once both braze and its delegate are ready and set, we call the required methods. As a result we received a true indicating that the payload has been handled by Braze so we would expect BrazeDelegate's method shouldOpenURL to be called but it doesn't.

jacksonemiller commented 9 months ago

Hi, thanks for bringing this to our attention and for taking the time to make this thread. I would like to ask if you could please file a support issue via support@braze.com as I think we'll be needing much more information in order to provide you adequate support here. Having additional info on code surrounding your SDK integration as well as push and deeplink set-ups - as examples - would be very helpful for us.

Currently, we do not officially support this kind of delayed SDK initialization, so we can't guarantee the issue with this particular use case can be solved, but the additional info would help us out a lot.

Thank you!

lzhuor commented 3 months ago

Encountering the same issue.

miquelalvarado commented 3 months ago

Hi @lzhuor, in our case it was fixed after adding configuration.forwardUniversalLinks = true.

Hope it helps!

P.D: If it fixes the issue for you let me know and I'll close the issue, otherwise feel free to add any complementary information to the issue :)

jerielng commented 3 months ago

Thanks for sharing the solution for your use case, @miquelalvarado! I'll close out this issue since the original report has a resolution, but @lzhuor, if you are still facing this even with the configuration mentioned above, please write in to support@braze.com, referencing this GitHub issue so that our support team can diagnose it further. Thank you!