mixpanel / mixpanel-swift

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

[2.7.0] Build failed with Mac Catalyst #353

Closed AlexG-MK closed 4 years ago

AlexG-MK commented 4 years ago

App doesn't build for Mac Catalyst target with errors:

/mixpanel-swift-2.7.0/Mixpanel/PushNotifications.swift:145:27: error: 'shared' is unavailable in application extensions for Mac Catalyst: Use view controller based solutions where appropriate instead.
            UIApplication.shared.open(url, options: [:], completionHandler: { success in
                          ^~~~~~
UIKit.UIApplication:6:20: note: 'shared' has been explicitly marked unavailable here
    open class var shared: UIApplication { get }

/mixpanel-swift-2.7.0/Mixpanel/PushNotifications.swift:145:34: error: 'open(_:options:completionHandler:)' is unavailable in application extensions for Mac Catalyst
            UIApplication.shared.open(url, options: [:], completionHandler: { success in
                                 ^~~~
UIKit.UIApplication:42:15: note: 'open(_:options:completionHandler:)' has been explicitly marked unavailable here
    open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil)

Issue related to APPLICATION_EXTENSION_API_ONLY build setting.