Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Crash when user taps outside of in-app notification #273

Closed Cgrau closed 3 years ago

Cgrau commented 3 years ago

Report

App is crashing when [enableDismissOnOutsideTap]: unrecognized selector sent to instance So when we get an in-app notification the app crashes.

Fatal Exception: NSInvalidArgumentException

ABKInAppMessageWindowController.m - Line 231
-[ABKInAppMessageWindowController inAppMessageTappedOutside:] + 231
Info Value
Platform Name ios
Platform Version Mostly on iOS 14 ( 70% 14.3, 11% 14.2)
SDK Version 3.31.0
Integration Method cocoapods
Xcode Version Xcode 12.0
Repro rate all the time (100%)

What did you do?

We have updated the SDK to 3.31.0 and release. We had 3.20.4 before that.

What did you expect to happen?

To be able to receive in-app notifications without crashes

What happened instead?

The app crashes when the user gets an in-app notification.

Steps to reproduce

Open the app, send a new notification and crash

Are you doing any feature customizations that may relate to the issue? Can you share the code snippet?

No

chshapiro commented 3 years ago

Hey @Cgrau,

Are you setting enableDismissOnOutsideTap anywhere in your app? Do you have a full stack trace of the crash that you can provide?

Cgrau commented 3 years ago

@chshapiro thank you

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1aa65486c __exceptionPreprocess
1  libobjc.A.dylib                0x1bf5c3c50 objc_exception_throw
2  CoreFoundation                 0x1aa55b95c -[NSOrderedSet initWithSet:copyItems:]
3  UIKitCore                      0x1ad03fdec -[UIResponder doesNotRecognizeSelector:]
4  CoreFoundation                 0x1aa657438 ___forwarding___
5  CoreFoundation                 0x1aa659740 _CF_forwarding_prep_0
6  AppName                       0x1051b651c -[ABKInAppMessageWindowController inAppMessageTappedOutside:] + 231 (ABKInAppMessageWindowController.m:231)
7  UIKitCore                      0x1acb4daa8 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
8  UIKitCore                      0x1acb5740c _UIGestureRecognizerSendTargetActions
9  UIKitCore                      0x1acb54048 _UIGestureRecognizerSendActions
10 UIKitCore                      0x1acb535c0 -[UIGestureRecognizer _updateGestureForActiveEvents]
11 UIKitCore                      0x1acb476ec _UIGestureEnvironmentUpdate
12 UIKitCore                      0x1acb46a98 -[UIGestureEnvironment _updateForEvent:window:]
13 UIKitCore                      0x1ad04ef28 -[UIWindow sendEvent:]
14 UIKitCore                      0x1ad0282cc -[UIApplication sendEvent:]
15 UIKitCore                      0x1ad0b21ec __dispatchPreprocessedEventFromEventQueue
16 UIKitCore                      0x1ad0b51a4 __processEventQueue
17 UIKitCore                      0x1ad0ac650 __eventFetcherSourceCallback
18 CoreFoundation                 0x1aa5d076c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
19 CoreFoundation                 0x1aa5d0668 __CFRunLoopDoSource0
20 CoreFoundation                 0x1aa5cf960 __CFRunLoopDoSources0
21 CoreFoundation                 0x1aa5c9a8c __CFRunLoopRun
22 CoreFoundation                 0x1aa5c921c CFRunLoopRunSpecific
23 GraphicsServices               0x1c20cd784 GSEventRunModal
24 UIKitCore                      0x1ad007fe0 -[UIApplication _run]
25 UIKitCore                      0x1ad00d854 UIApplicationMain
26 AppName                       0x104b0213c main + 10 (main.m:10)
27 libdyld.dylib                  0x1aa2896b0 start
chshapiro commented 3 years ago

Hey @Cgrau,

We have not been able to repro the crash - do you do any customization on the ABKInAppMessageWindowController class? Can you also try clearing your pod cache and re-importing the Appboy-iOS-SDK pod to rule out a Cocoapods cache issue?

Thank you!

Cgrau commented 3 years ago

We found that the modal alert implementation is not properly implemented and it crashes, we found the fix. I can close this issue, thank you very much for the help.

lustig-bakkt commented 3 years ago

We found that the modal alert implementation is not properly implemented and it crashes, we found the fix. I can close this issue, thank you very much for the help.

@Cgrau what was the issue and how did you fix it? We're seeing this (https://github.com/Appboy/appboy-ios-sdk/issues/149) and I wonder if it is related.