Skip to content

Commit 84f3533

Browse files
tsunghungncooke3
andauthored
Analytics 10.17.0 (#11958)
Co-authored-by: Nick Cooke <[email protected]>
1 parent 579914e commit 84f3533

File tree

13 files changed

+73
-42
lines changed

13 files changed

+73
-42
lines changed

.github/workflows/analytics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: FirebaseAnalytics
3636
run: scripts/third_party/travis/retry.sh pod spec lint FirebaseAnalytics.podspec --platforms=${{ matrix.target }} --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/
3737
- name: FirebaseAnalyticsSwift
38-
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAnalyticsSwift.podspec --platforms=${{ matrix.target }}
38+
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAnalyticsSwift.podspec --allow-warnings --platforms=${{ matrix.target }}
3939
# The following steps are only run on `ios` due to product availability.
4040
- name: GoogleAppMeasurementOnDeviceConversion
4141
run: scripts/third_party/travis/retry.sh pod spec lint GoogleAppMeasurementOnDeviceConversion.podspec --platforms=ios --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/

.github/workflows/client_app.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ on:
1515
# Run every day at 12am (PST) - cron uses UTC times
1616
- cron: "0 8 * * *"
1717

18+
env:
19+
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
20+
1821
concurrency:
1922
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
2023
cancel-in-progress: true
2124

2225
jobs:
2326
client-app-spm:
2427
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
25-
env:
26-
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
2728
runs-on: macos-12
2829
strategy:
2930
matrix:

FirebaseAnalytics.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.authors = 'Google, Inc.'
1414

1515
s.source = {
16-
:http => 'https://dl.google.com/firebase/ios/analytics/6b84dfc0fca41852/FirebaseAnalytics-10.16.0.tar.gz'
16+
:http => 'https://dl.google.com/firebase/ios/analytics/85d9c07fe160aa17/FirebaseAnalytics-10.17.0.tar.gz'
1717
}
1818

1919
s.cocoapods_version = '>= 1.10.0'

FirebaseAnalytics/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This directory open sources select files from the Firebase Analytics SDK. Note
2+
that there is no open source infastructure to build or package them.

FirebaseAnalyticsSwift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Firebase Analytics is a free, out-of-the-box analytics solution that inspires ac
3434
'FirebaseAnalyticsSwift/Sources/*.swift',
3535
]
3636

37-
s.dependency 'FirebaseAnalytics', '~> 10.0'
37+
s.dependency 'FirebaseAnalytics', '~> 10.17'
3838

3939
s.test_spec 'swift-unit' do |swift_unit_tests|
4040
swift_unit_tests.platforms = {

FirebaseAnalyticsSwift/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 10.17.0
2+
- [deprecated] All of the public API from `FirebaseAnalyticsSwift` can now
3+
be accessed through the `FirebaseAnalytics` module. Therefore,
4+
`FirebaseAnalyticsSwift` has been deprecated, and will be removed in a
5+
future release. See https://firebase.google.com/docs/ios/swift-migration for
6+
migration instructions.
7+
18
# 9.0.0
29
- [added] **Breaking change:** `FirebaseAnalyticsSwift` has exited beta and is
310
now generally available for use.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#warning(
16+
"All of the public API from `FirebaseAnalyticsSwift` can now be accessed through the `FirebaseAnalytics` module. Therefore, the `FirebaseAnalyticsSwift` module is deprecated and will be removed in the future. See https://firebase.google.com/docs/ios/swift-migration for migration instructions."
17+
)

FirebaseAnalyticsSwift/Tests/SwiftUnit/AnalyticsAPITests.swift

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,11 @@
1919
import Foundation
2020
import SwiftUI
2121

22-
@testable import FirebaseAnalyticsSwift
22+
import FirebaseAnalyticsSwift
23+
import SwiftUI
2324
import FirebaseAnalytics
2425

2526
final class AnalyticsAPITests {
26-
@available(iOS 13.0, *)
27-
func loggedAnalyticsModifierUsage(viewModifier: LoggedAnalyticsModifier,
28-
content: LoggedAnalyticsModifier.Content) {
29-
let _: String = viewModifier.screenName
30-
let _: String = viewModifier.screenClass
31-
let _: [String: Any] = viewModifier.extraParameters
32-
let _: any View = viewModifier.body(content: content)
33-
}
34-
35-
@available(iOS 13.0, *)
36-
func viewExtensionUsage(viewModifier: LoggedAnalyticsModifier, view: any View) {
37-
let _: any View = view.analyticsScreen(
38-
name: "name",
39-
class: "class",
40-
extraParameters: ["param": 1]
41-
)
42-
}
43-
4427
func usage() {
4528
// MARK: - Analytics
4629

@@ -54,24 +37,20 @@ final class AnalyticsAPITests {
5437
Analytics.setDefaultEventParameters(["default": 100])
5538

5639
Analytics.sessionID { sessionID, error in }
57-
#if compiler(>=5.5.2) && canImport(_Concurrency)
58-
if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 7.0, *) {
59-
Task {
60-
let _: Int64? = try? await Analytics.sessionID()
61-
}
40+
if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 7.0, *) {
41+
Task {
42+
let _: Int64? = try? await Analytics.sessionID()
6243
}
63-
#endif // compiler(>=5.5.2) && canImport(_Concurrency)
44+
}
6445

6546
// MARK: - AppDelegate
6647

6748
Analytics.handleEvents(forBackgroundURLSession: "session_id", completionHandler: {})
68-
#if compiler(>=5.5.2) && canImport(_Concurrency)
69-
if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 7.0, *) {
70-
Task {
71-
await Analytics.handleEvents(forBackgroundURLSession: "session_id")
72-
}
49+
if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 7.0, *) {
50+
Task {
51+
await Analytics.handleEvents(forBackgroundURLSession: "session_id")
7352
}
74-
#endif // compiler(>=5.5.2) && canImport(_Concurrency)
53+
}
7554
Analytics.handleOpen(URL(string: "https://google.com")!)
7655
Analytics.handleUserActivity(NSUserActivity(activityType: "editing"))
7756

@@ -203,5 +182,30 @@ final class AnalyticsAPITests {
203182
AnalyticsUserPropertyAllowAdPersonalizationSignals,
204183
AnalyticsUserPropertySignUpMethod,
205184
]
185+
186+
// MARK: - Analytics + SwiftUI
187+
188+
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
189+
@available(watchOS, unavailable)
190+
struct MyView: View {
191+
let name: String
192+
let klass: String
193+
let extraParameters: [String: Any]
194+
195+
var body: some View {
196+
Text("Hello, world!")
197+
.analyticsScreen(name: name,
198+
class: klass,
199+
extraParameters: extraParameters)
200+
Text("Hello, world!")
201+
.analyticsScreen(name: name,
202+
extraParameters: extraParameters)
203+
Text("Hello, world!")
204+
.analyticsScreen(name: name,
205+
class: klass)
206+
Text("Hello, world!")
207+
.analyticsScreen(name: name)
208+
}
209+
}
206210
}
207211
}

GoogleAppMeasurement.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
s.authors = 'Google, Inc.'
1717

1818
s.source = {
19-
:http => 'https://dl.google.com/firebase/ios/analytics/39bfd299873250e2/GoogleAppMeasurement-10.16.0.tar.gz'
19+
:http => 'https://dl.google.com/firebase/ios/analytics/3ba4027e4ed57a60/GoogleAppMeasurement-10.17.0.tar.gz'
2020
}
2121

2222
s.cocoapods_version = '>= 1.10.2'

0 commit comments

Comments
 (0)