2020-11-27 19:04

Support for mac catalyst

This PR adds support for mac catalyst (UIKit for Mac) (#408). The main changes are: - Enabled the Mac checkbox on iOS framework targets (AppAuth_iOS and AppAuthCore) to make them compatible with mac catalyst. - Added a new external user agent implementation for Catalyst (OIDExternalUserAgentCatalyst) which basically does the same thing as OIDExternalUserAgentIOS for iOS13. I could've added the support for Catalyst in that existing class, but it would have added too much complexity to the code. - In the 'Compile Sources' build phase, I restricted OIDExternalUserAgentCatalyst to macOS and OIDExternalUserAgentIOS, OIDExternalUserAgentIOSCustomBrowser to iOS only as these two classes don't compile on macOS Catalyst.

At that point the frameworks are able to build.

Then I needed to find a way to tell Cocoapods which user agents classes are for iOS and macOS. But the thing is that there is no new platform like 'iosmac' or 'maccatalyst' to specify in the podspec. So I did like Apple mentions and enclosed the code using TARGET_OS_MACCATALYST.

I also tested using Carthage but it doesn't work. It seems that carthage bootstrap doesn't compile the frameworks correctly for Catalyst. Support for Catalyst is in their roadmap.


  • 点赞
  • 回答
  • 收藏
  • 复制链接分享