apptentive / apptentive-ios

Apptentive Legacy SDK for iOS. See https://github.com/apptentive/apptentive-kit-ios for Version 6.
http://www.apptentive.com/
BSD 3-Clause "New" or "Revised" License
146 stars 103 forks source link

Crash when receiving update in a SwiftUI app #295

Closed axello closed 3 years ago

axello commented 3 years ago

We are --trying to-- implement Apptentive in a swift + SwiftUI based app. As a host viewcontroller for Apptentive we are using a UITabBarController. The app can succesfully send engage(event:) messages, but when a notification from apptentive arrives the app crashes in @main.

Is there a recommended way to use apptentive-ios with SwiftUI based applications?

Apptentive 5.3.3

CaseyApptentive commented 3 years ago

Hi @axello. Sorry that you're seeing issues. I'll look into this with my team and get back to you as soon as possible.

CaseyApptentive commented 3 years ago

Circling back @axello. Thanks again for the report. This is not a known issue and we'll need a bit more information to understand what's going on.

Could you send verbose logs from app launch until the crash?

Also, if you could share the name of the app you're working on, we could take a look at our backend to know more. If you'd rather, you can send that to me at support@apptentive.com and I'll help from there.

Thanks!

axello commented 3 years ago

Hi, I'm on holidays. I've asked a colleague of mine to pick this up.

CaseyApptentive commented 3 years ago

Thanks! Let us know if there's any way we can help get logs. If it's easier and we can repro the issue, you could also send us a dev build.

Whatever is easiest.

CaseyApptentive commented 3 years ago

Hi there. We'll still need more information, but I was able to get a sanity check from our iOS team.

Unfortunately, we don’t yet support SwiftUI with our SDKs. But we would love to know more about exactly what you're looking for so we can share it with our Product team. What type of notification are you looking to use? For example, push notification, NSNotificationCenter notification, or something else?

Also, what error message are you getting when your app crashes?

axello commented 3 years ago

We tested with our latest build and now it works without problems. Don't know what the reason was for the crashes, but you can close this ticket. Thanks.

TianleZhang commented 3 years ago

Sry, we notice the issue only happened on real device but not on simulator And when I dump the device log, I see this error

Application <app id> needs to stop using the entitlement com.apple.private.swc.alternate-assets-directory immediately, and switch to com.apple.private.swc.additional-service-details-consumer ASAP. Contact the SWC team for more info on how to adopt.

Seems something wrong with universal link, but this is completely not understandable from our side

CaseyApptentive commented 3 years ago

Hi there! Sorry for the delay.

Though we don't support SwiftUI with the current SDK, we looked into this issue. Unfortunately, that error message isn't anything that any of our iOS devs have ever seen associated with our SDK. It's hard to say why. Maybe it's specific to SwiftUI, or maybe it's something more specific about the implementation in this particular app.

We're wondering: have you used SwiftUI with Apptentive in the past? We're curious if this is something new that you've come across or if it's always been an underlying problem.

If you're intent on using our SDK in this app, we would suggest experimenting with removing all calls to the SDK (but still including it in their app) to see if the crash still occurs, and then restore the Apptentive method calls one by one to see if there's a particular one that causes the crash.

That said, the safest approach would be to use our native SDK without SwiftUI.

Let us know your thoughts. Thanks again!