Appboy / appboy-ios-sdk

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

Interacting with IAM causes app to crash #295

Closed phatlaunchdeck closed 3 years ago

phatlaunchdeck commented 3 years ago

Report

Describe your environment.

Info Value
Platform Name iOS
Platform Version 14.5
SDK Version 3.33.1
Integration Method Cocoapods
Xcode Version Xcode 12.1
Computer Processor Intel-based
Repro rate All the time (100%)

What did you do?

Test a campaign and got IAM sent to device

What did you expect to happen?

Tapping on the IAM should just simply close it

What happened instead?

The app crashed

Steps to reproduce

For IAM, I believe I did not need to do anything since on the React Native docs, they say everything is already in place.

Code Snippet

Screen Shot 2021-05-11 at 22 43 40

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

No

phatlaunchdeck commented 3 years ago

Sorry I accidentally hit submit issue without finishing writing yet so I closed it but updated the post now.

chshapiro commented 3 years ago

Hey @phatlaunchdeck,

Is there a stack trace you could send us?

phatlaunchdeck commented 3 years ago

Hey @chshapiro, here you go, it's a pretty long stack trace so I can't comment it here and have put it onto another link: https://codeshare.io/5OD370

Forgive me if I should only get any specific part of it, I am not a native iOS developer so it's all pretty new to me.

chshapiro commented 3 years ago

Hey @phatlaunchdeck,

Unfortunately we haven't been able to repro this issue. Are you doing any customization for your in-app messages? Is this crash happening every time you display an in-app message or only sporadically?

phatlaunchdeck commented 3 years ago

I'm kinda positive that I did not do any customization to the IAM since the React Native doc indicates that the IAM will show up automatically. Oh one thing I forgot to mention that you need to test it with a real device to get the crash, it seems to work when I'm on simulators.

And yes, almost everytime the IAM shows up, clicking or swiping on any part of it will cause the crash to happen.

chshapiro commented 3 years ago

Hey @phatlaunchdeck,

Can you also turn on verbose logging and send us the logs from when you open the app until the crash occurs? If you're not comfortable posting them here, you can email them to support@braze.com.

phatlaunchdeck commented 3 years ago

Okay so I will turn that on, copy the stack trace as I did before and share with you via the email? Do I need to indicate any ticket number when I do that?

chshapiro commented 3 years ago

You can reference this issue. And please include the device logs as well as the stack trace in the email. Thanks!

phatlaunchdeck commented 3 years ago

Hey @chshapiro sorry to ask this, but I'm seeing a lot of logs for my device and not sure which one should I send to you guys? There are a few for today (May 13th) but as I see none is related to our app (Truckster) or saying Braze/Appboy or something.

Screen Shot 2021-05-13 at 21 31 12
chshapiro commented 3 years ago

Hey @phatlaunchdeck,

You can use these directions to get the logs follwing the steps in the Using Xcode section.

phatlaunchdeck commented 3 years ago

I actually followed that page to get a device log, but seems like it was for an older version of XCode, there is no more "small arrow at the bottom left corner" on my XCode 12. However, I was able to retrieve the logs now, took a few hours for it to show up on my end.

Device Logs: https://codeshare.io/G6jAMp Stack Trace: https://codeshare.io/5egKNK

chshapiro commented 3 years ago

Hey @phatlaunchdeck,

Our team has potentially identified the issue. Do you have any UI element (first or third party) that could compete with Braze's in-app message window? We force our In-app message window to be key and visible when presented, it's possible that another UIWindow in your code is doing the same thing, leading to the crash.

phatlaunchdeck commented 3 years ago

Hey @chshapiro, I have tried really hard to determine which library does that but all I can find in the whole node_modules is RCTLogBox and Alert, but they are core modules of React Native so those couldn't cause it right?

Screen Shot 2021-05-14 at 03 10 08
phatlaunchdeck commented 3 years ago

@chshapiro if it helps, I've just discovered that if I don't interact at all with the IAM and let it close itself after x amount of seconds, then it will not cause any crash.

chshapiro commented 3 years ago

Hey @phatlaunchdeck,

We're still unable to repro in our React Native sample app. Are you trying to show an alert at the same time that the in-app message is displayed?

phatlaunchdeck commented 3 years ago

@chshapiro I'm 100% sure that I do not do such. Last night when you asked me to look into whatever library doing "makeKeyAndVisible" I tried to remove everything from the screen that is suspicious from Modal to Toast (which is just a React Native View btw), but as soon as the Braze's IAM came in, it just crashed the app.

I even tried to bring out the IAM as soon as the app opens to avoid any possible libraries being loaded up and it still crashed the app.

Bucimis commented 3 years ago

@phatlaunchdeck we'll be in touch with your team to schedule a call

lowip commented 3 years ago

Fixed in Appboy-iOS-SDK 4.2.0.