mixpanel / mixpanel-swift

Official iOS (Swift) Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
434 stars 234 forks source link

Mixpanel - Airship integration crash when Airship SDK is not initialized #482

Closed gfoldv closed 2 years ago

gfoldv commented 3 years ago

When the Mixpanel SDK gets initialized it tries to fetch the Airship Channel ID if the integration is enabled. However if the Airship SDK is not initialized at that moment - user has not given consent according for GDPR for example - then the Airship SDK will crash with "TakeOff must be called before accessing Airship." error message. https://github.com/urbanairship/ios-library/blob/main/Airship/AirshipCore/Source/Airship.swift

Even though it seems it is an Airship SDK issue, maybe Mixpanel SDK can give an option to disable this automation and provide the way to manually trigger it (for the time when the app developer has already initialized the Airship SDK)

zihejia commented 2 years ago

hi @gfoldv , we will deprecate the automation in the next release. https://github.com/mixpanel/mixpanel-swift/pull/489

zihejia commented 2 years ago

hi @gfoldv , we have removed the code since v2.10.4 I'm closing this one now.