You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the repository specially called out Apple platforms (This is Amplitude's latest version of the iOS SDK, covering iOS/tvOS/macOS/watchOS.), Swift as a language is growing beyond those specific usages. With a few modifications, this library can be adapted to run on other Swift native environments (like Linux and Windows).
Motivations
I had a PR that started this work, but recent changes has made it difficult to stay on top keeping it merge-ready. When library developers aren't trained to think about multiple platform support, it's easy to make decisions that directly make that support hard to achieve.
Here are some of the areas identified that would need to be addressed to make this library compatible with non-apple platforms:
Isolate OSLog usage by checking for #if canImport(os.log)
Preferably use a cross-platform solution like swift-log
Add conditional imports for FoundationNetworking where required. (#if canImport(FoundationNetworking))
On non-apple platforms, networking classes like URL, URLRequest, URLSession are part of the FoundationNetworking package.
Hi @richardpiazza, thanks for supporting and contributing to Amplitude. Swift is close to GA and I will pass this to our team to see if we can support non Apple platforms in GA version.
Summary
Although the repository specially called out Apple platforms (This is Amplitude's latest version of the iOS SDK, covering iOS/tvOS/macOS/watchOS.), Swift as a language is growing beyond those specific usages. With a few modifications, this library can be adapted to run on other Swift native environments (like Linux and Windows).
Motivations
I had a PR that started this work, but recent changes has made it difficult to stay on top keeping it merge-ready. When library developers aren't trained to think about multiple platform support, it's easy to make decisions that directly make that support hard to achieve.
Here are some of the areas identified that would need to be addressed to make this library compatible with non-apple platforms:
Isolate OSLog usage by checking for
#if canImport(os.log)
Add conditional imports for
FoundationNetworking
where required. (#if canImport(FoundationNetworking)
)URL
,URLRequest
,URLSession
are part of theFoundationNetworking
package.Setup a CSQLite map for linux systems
Beware of
DispatchQueue.main
This may not exist or function differently on other platforms. In a server-side environment, using this queue often does nothing.
The text was updated successfully, but these errors were encountered: