Skip to content

Commit

Permalink
Fix Analytics SwiftPM platform availability. (#9032)
Browse files Browse the repository at this point in the history
* Fix Analytics SwiftPM platform availability.

For some reason this still works in a project, but Xcode gets confused
and doesn't autocomplete the module appropriately. This should fix it
for tvOS and macOS.

Also cleaned up a few references to Analytics only being available on
iOS.

* Clearer comment about availability

* Changelog

* Review changes

* Added a missing word in CHANGELOG
  • Loading branch information
ryanwilson committed Nov 30, 2021
1 parent a2320db commit 59cb44b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/spm.yml
Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
matrix:
target: [tvOS, macOS, catalyst]
# Full set of Firebase-Package tests only run on iOS because of Analytics.
# Full set of Firebase-Package tests only run on iOS.
steps:
- uses: actions/checkout@v2
- name: Initialize xcodebuild
Expand Down
4 changes: 4 additions & 0 deletions FirebaseCore/CHANGELOG.md
@@ -1,3 +1,7 @@
# Firebase 8.10.1
- [fixed] Fixed platform availability checks in Swift Package Manager that may prevent code
completion for Analytics APIs on macOS and tvOS. (#9032)

# Firebase 8.10.0
- [added] Firebase now includes community supported Combine publishers. More details can be found
[here](https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCombineSwift/README.md). (#7295)
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Expand Up @@ -268,7 +268,7 @@ let package = Package(
.target(
name: "FirebaseAnalyticsTarget",
dependencies: [.target(name: "FirebaseAnalyticsWrapper",
condition: .when(platforms: [.iOS]))],
condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
),

Expand Down
9 changes: 4 additions & 5 deletions SwiftPackageManager.md
Expand Up @@ -15,9 +15,8 @@ Prior to version 8.0.0 (starting with version 6.31.0) support was in Beta.

## Limitations

- Analytics is only supported for iOS and cannot be used in apps that support other platforms.
- watchOS support is available for ABTesting, Auth, Crashlytics, Messaging, Realtime Database,
RemoteConfig, and Storage.
- Product availability varies by platform. See [the chart on this page](https://firebase.google.com/docs/ios/learn-more#firebase_library_support_by_platform)
for information on product availabilty for each platform.

## Installation

Expand All @@ -36,7 +35,7 @@ Search for the Firebase Apple SDK using the repo's URL:
https://github.com/firebase/firebase-ios-sdk.git
```

Next, set the **Dependency Rule** to be `Up to Next Major Version` and specify `8.0.0` as the lower bound.
Next, set the **Dependency Rule** to be `Up to Next Major Version` and specify `8.10.0` as the lower bound.

Then, select **Add Package**.

Expand Down Expand Up @@ -81,7 +80,7 @@ dependencies: [
.package(
name: "Firebase",
url: "https://github.com/firebase/firebase-ios-sdk.git",
.upToNextMajor(from: "8.0.0")
.upToNextMajor(from: "8.10.0")
),

// Any other dependencies you have...
Expand Down

0 comments on commit 59cb44b

Please sign in to comment.