Closed PatrickDotStar closed 2 years ago
@PatrickDotStar thanks for the info. We have not been able to repro on our end.
1) Are you doing any custom deep link handling in the SDK or button click handling on IAMs? 2) Were you using the same click action and deep-link/url to test across all IAM types? 3) Does changing the click action/deep-link/url combo of the buttons changed the observed behavior?
@Bucimis Thanks for your reply.
1: No we don't do anything special. We only implemented the before(inAppMessageDisplayed inAppMessage: ABKInAppMessage) -> ABKInAppMessageDisplayChoice
delegate method to avoid showing any InAppMessages on the lock screen but even if the messages are presented right after app start we encounter this issue.
2+3: I configured the buttons that one just closes the message and the second to open a DeepLink. The DeepLink, which then presents a new view, also seems to fixes the issue. But when just closing the message with either regular or the close button, it freezes the app again.
@PatrickDotStar thanks for the update 1) Does upgrading to our latest release 4.4.2 fix the issue? There are some refinements to key window logic there. 2) Just to double confirm, the issue only appears with buttons that close the IAM, and only on the modal native type. 3) Would be able to send verbose logs (https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/initial_sdk_setup/other_sdk_customizations/#verbose-logging) illustrating the issue to support@braze.com (over email is better for privacy reasons)? It's helpful even if logs don't show anything going wrong specifically.
Hey @Bucimis
Hey @PatrickDotStar, thanks for the precisions. We still haven't been able to reproduce the issue on our side.
The ABKInAppMessageWindow
is not supposed to linger for ~5-10s before being removed from memory. This is true whatever the type of in-app message being presented.
Our assumption is that something is holding a strong reference to the ABKInAppMessageWindow
instance upon dismissal.
To verify it, could you Inspect the Debug Memory Graph during those 5-10s. This might help us pinpoint the object preventing the ABKInAppMessageWindow
to resign.
Could you also try applying this tentative fix in ABKInAppMessageWindowController.m
(Cocoapods should allow you to unlock the file):
// In the method -[ABKInAppMessageWindowController hideInAppMessageWindow]
self.inAppMessageWindow.rootViewController = nil;
+ if (@available(iOS 13.0, *)) {
+ self.inAppMessageWindow.windowScene = nil
+ }
self.inAppMessageWindow = nil;
Thanks,
Hey @lowip
I attached 2 screenshot of the ABKInAppMessageWindow
memory graph ~5 seconds after I dismissed it.
Your proposed solution seems to fix the freezing of the app however I then get a EXC_BAD_ACCESS
crash when pushing/presenting a new view when one button for example contains a DeepLink. I tried with 3 different DeepLinks but all of them caused the same crash. Removing your fix again also fixes the crashing. I removed my workaround before applying your fix.
@PatrickDotStar
Thanks for the quick reply, we'll look into that more closely. The memory graphs look clean, meaning that we don't have an Appboy object retaining the window. I'm not immediately seeing what could retain it.
A few additional questions:
Best,
We are seeing the same issue and we've not yet implemented UISceneDelegate either. No SwiftUI entry point. Deployment target is iOS 13.0.
Hi @PatrickDotStar and @antoniostrijdom,
We have released iOS SDK version 4.4.3 that addresses this issue. Thanks for bringing it to our attention!
Platform
iOS
Platform Version
iOS 15.2
Braze SDK Version
4.3.4
Xcode Version
13.2.1 (13C100)
Integration Method
Cocoapods
Computer Processor
Apple (M1)
Repro Rate
100%
Steps To Reproduce
When presenting a modal InAppMessage and dismissing it with either the close button or one of the two configurable buttons, the
ABKInAppMessageWindow
stays in die view hierarchy and therefore blocks further user interaction. After ~5-10 seconds theABKInAppMessageWindow
is either completely removed or moved down in the UIWindowScene hierarchy. This issue, for us, is only reproducible with the modal InAppMessage typ. Full-Screen and Simple Survey for example work fine.Here are some screenshots of the
UIWindow
view hierarchy and you can see that for "Modal dismissed" theABKInAppMessageWindow
is still on top of the view hierarchy and therefore blocks further user interaction. After ~5-10 seconds later after the modal has been dismissed, theABKInAppMessageWindow
is no longer in the view hierarchy and therefore the app is no longer blocked by this window.As a current workaround I implemented these 2 delegate methods of
ABKInAppMessageUIDelegate
to make ourUIWindow
key and visible again.Expected Behavior
ABKInAppMessageWindow
is properly handled after being dismissed for modal InAppMessages.Actual Incorrect Behavior
ABKInAppMessageWindow
stays on top of UIWindowScene view hierarchy and therefore blocks further user interaction.Verbose Logs
No response
Additional Information
No response