Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InAppMessaging] Consolidate FIAM and FIAMSwift #11800

Merged
merged 27 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
799c026
Merge FIAM podspecs
ncooke3 Sep 12, 2023
921f7f3
Remove unneeded imports
ncooke3 Sep 12, 2023
2271915
Refactor FIAM SPM targets
ncooke3 Sep 12, 2023
cd80f36
Re-export module through FIAMSwift
ncooke3 Sep 12, 2023
0c97a4f
Changelog
ncooke3 Sep 12, 2023
a8a662b
Add TODO to update changelog entry if warning is enabled
ncooke3 Sep 12, 2023
7a90e33
Fix bug in FIAMSwift's sources
ncooke3 Sep 12, 2023
59bbb6e
Minimize dependency versioning in podspec
ncooke3 Sep 12, 2023
615461e
Fix path I thought I fixed
ncooke3 Sep 12, 2023
da81dc1
Undo unintentional newline
ncooke3 Sep 12, 2023
2e49f70
Fix test breakage
ncooke3 Sep 12, 2023
6457164
FIAM objc-import tests for only iOS or tvOS
ncooke3 Sep 13, 2023
7635812
Add note in deprecation warning about '@testable' imports
ncooke3 Sep 13, 2023
3ef795b
Add note in release note about '@testable' imports
ncooke3 Sep 13, 2023
fdaec5c
Add workaround for Swift header
ncooke3 Sep 13, 2023
68a69ea
Enable deprecation warning
ncooke3 Sep 13, 2023
be434bf
Selectively re-export API
ncooke3 Sep 13, 2023
ccf1bbf
Update release note to reflect plan to deprecate
ncooke3 Sep 13, 2023
9c84e4a
Update dependency version in podspec
ncooke3 Sep 13, 2023
faffc3c
Fix CI
ncooke3 Sep 13, 2023
ef83556
Add backticks for module names in warning msg
ncooke3 Sep 13, 2023
cd3118a
Allow warnings since FIAMSwift is deprecated
ncooke3 Sep 14, 2023
989d618
Add '--allow-warnings' flag in a better way
ncooke3 Sep 14, 2023
0c72c6f
Fix typo
ncooke3 Sep 14, 2023
032cdcd
Update deprecation/documentation messages
ncooke3 Oct 10, 2023
c073093
Update dependency version in podspec
ncooke3 Oct 12, 2023
df7d898
Fix formatting in FirebaseInAppMessaging.podspec
ncooke3 Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/inappmessaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: macos-12
strategy:
matrix:
podspec: [FirebaseInAppMessaging.podspec, FirebaseInAppMessagingSwift.podspec]
podspec: [FirebaseInAppMessaging.podspec, FirebaseInAppMessagingSwift.podspec --allow-warnings]
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
Expand Down
40 changes: 21 additions & 19 deletions FirebaseInAppMessaging.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ See more product details at https://firebase.google.com/products/in-app-messagin
base_dir = "FirebaseInAppMessaging/"
s.ios.source_files = [
base_dir + "Sources/*.[cmh]",
base_dir + "Sources/Analytics/**/*.[cmh]",
base_dir + "Sources/Data/**/*.[cmh]",
base_dir + "Sources/DefaultUI/**/*.[cmh]",
base_dir + "Sources/DisplayTrigger/**/*.[cmh]",
base_dir + "Sources/Flows/**/*.[cmh]",
base_dir + "Sources/Private/**/*.[cmh]",
base_dir + "Sources/Public/**/*.[cmh]",
base_dir + "Sources/RenderingObjects/**/*.[cmh]",
base_dir + "Sources/Runtime/**/*.[cmh]",
base_dir + "Sources/Util/**/*.[cmh]",
base_dir + "Sources/Analytics/**/*.[cmh]",
base_dir + "Sources/Data/**/*.[cmh]",
base_dir + "Sources/DefaultUI/**/*.[cmh]",
base_dir + "Sources/DisplayTrigger/**/*.[cmh]",
base_dir + "Sources/Flows/**/*.[cmh]",
base_dir + "Sources/Private/**/*.[cmh]",
base_dir + "Sources/Public/**/*.[cmh]",
base_dir + "Sources/RenderingObjects/**/*.[cmh]",
base_dir + "Sources/Runtime/**/*.[cmh]",
base_dir + "Sources/Util/**/*.[cmh]",
base_dir + "Swift/Source/**/*.swift",
'Interop/Analytics/Public/*.h',
'FirebaseABTesting/Sources/Private/*.h',
'FirebaseCore/Extension/*.h',
Expand All @@ -46,15 +47,16 @@ See more product details at https://firebase.google.com/products/in-app-messagin

s.tvos.source_files = [
base_dir + "Sources/*.[cmh]",
base_dir + "Sources/Analytics/**/*.[cmh]",
base_dir + "Sources/Data/**/*.[cmh]",
base_dir + "Sources/DisplayTrigger/**/*.[cmh]",
base_dir + "Sources/Flows/**/*.[cmh]",
base_dir + "Sources/Private/**/*.[cmh]",
base_dir + "Sources/Public/**/*.[cmh]",
base_dir + "Sources/RenderingObjects/**/*.[cmh]",
base_dir + "Sources/Runtime/**/*.[cmh]",
base_dir + "Sources/Util/**/*.[cmh]",
base_dir + "Sources/Analytics/**/*.[cmh]",
base_dir + "Sources/Data/**/*.[cmh]",
base_dir + "Sources/DisplayTrigger/**/*.[cmh]",
base_dir + "Sources/Flows/**/*.[cmh]",
base_dir + "Sources/Private/**/*.[cmh]",
base_dir + "Sources/Public/**/*.[cmh]",
base_dir + "Sources/RenderingObjects/**/*.[cmh]",
base_dir + "Sources/Runtime/**/*.[cmh]",
base_dir + "Sources/Util/**/*.[cmh]",
base_dir + "Swift/Source/**/*.swift",
'Interop/Analytics/Public/*.h',
'FirebaseABTesting/Sources/Private/*.h',
'FirebaseCore/Extension/*.h',
Expand Down
7 changes: 7 additions & 0 deletions FirebaseInAppMessaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Unreleased
- [deprecated] All of the public API from `FirebaseInAppMessagingSwift` can now
be accessed through the `FirebaseInAppMessaging` module. Therefore,
`FirebaseInAppMessagingSwift` has been deprecated, and will be removed in a
future release. See https://firebase.google.com/docs/ios/swift-migration for
migration instructions.

# 10.13.0
- [fixed] Fix Firebase tvOS podspec dependency for In App Messaging. (#11569)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseInAppMessaging
import SwiftUI

#if SWIFT_PACKAGE
@_exported import FirebaseInAppMessagingInternal
#endif // SWIFT_PACKAGE

// MARK: Image-only messages.

@available(iOS 13, tvOS 13, *)
Expand Down
30 changes: 30 additions & 0 deletions FirebaseInAppMessaging/Swift/Source/SPMSwiftHeaderWorkaround.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#if SWIFT_PACKAGE
@_exported import FirebaseInAppMessagingInternal

// This is a trick to force generate a `FirebaseInAppMessaging-Swift.h`
// header that re-exports `FirebaseInAppMessagingInternal` for Objective-C
// clients. It is important for the below code to reference a Remote
// Config symbol defined in Objective-C as that will import the symbol's
// module (`FirebaseInAppMessagingInternal`) in the generated header. This
// allows Objective-C clients to import Remote Config's Objective-C API
// using `@import FirebaseInAppMessaging;`. This API is not needed for Swift
// clients and is therefore unavailable in a Swift context.
@available(*, unavailable)
@objc public extension InAppMessaging {
static var __no_op: () -> Void { {} }
}
#endif // SWIFT_PACKAGE
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

import UIKit

import FirebaseInAppMessaging
#if SWIFT_PACKAGE
@_exported import FirebaseInAppMessagingInternal
#endif // SWIFT_PACKAGE

@available(iOS 13.0, tvOS 13.0, *)
@available(iOSApplicationExtension, unavailable)
Expand Down
4 changes: 2 additions & 2 deletions FirebaseInAppMessagingSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See more product details at https://firebase.google.com/products/in-app-messagin
s.prefix_header_file = false

s.source_files = [
'FirebaseInAppMessaging/Swift/Source/**/*.swift',
'FirebaseInAppMessagingSwift/Sources/**/*.swift',
]

s.test_spec 'unit' do |unit_tests|
ncooke3 marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -35,5 +35,5 @@ See more product details at https://firebase.google.com/products/in-app-messagin

s.framework = 'UIKit'

s.dependency 'FirebaseInAppMessaging', '~> 10.0-beta'
s.dependency 'FirebaseInAppMessaging', '~> 10.17-beta'
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#warning(
"All of the public API from `FirebaseInAppMessagingSwift` can now be accessed through the `FirebaseInAppMessaging` module. Therefore, the `FirebaseInAppMessagingSwift` module is deprecated and will be removed in the future. See https://firebase.google.com/docs/ios/swift-migration for migration instructions."
)

// The `@_exported` is needed to prevent breaking clients that are using
// types prefixed with the `FirebaseInAppMessaging` namespace.
@_exported import enum FirebaseInAppMessaging.InAppMessagingPreviewHelpers
16 changes: 12 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ let package = Package(
),

.target(
name: "FirebaseInAppMessaging",
name: "FirebaseInAppMessagingInternal",
dependencies: [
"FirebaseCore",
"FirebaseInstallations",
Expand Down Expand Up @@ -787,10 +787,16 @@ let package = Package(
resources: [.process("Resources")]
),

.target(
name: "FirebaseInAppMessaging",
dependencies: ["FirebaseInAppMessagingInternal"],
path: "FirebaseInAppMessaging/Swift/Source"
),

.target(
name: "FirebaseInAppMessagingSwift",
dependencies: ["FirebaseInAppMessaging"],
path: "FirebaseInAppMessaging/Swift/Source"
path: "FirebaseInAppMessagingSwift/Sources"
),

.target(
Expand Down Expand Up @@ -1156,7 +1162,8 @@ let package = Package(
"FirebaseFirestoreTarget",
"FirebaseFirestoreSwift",
"FirebaseFunctions",
"FirebaseInAppMessaging",
.target(name: "FirebaseInAppMessaging",
condition: .when(platforms: [.iOS, .tvOS])),
.target(name: "FirebaseInAppMessagingSwift",
condition: .when(platforms: [.iOS, .tvOS])),
"FirebaseInstallations",
Expand Down Expand Up @@ -1194,7 +1201,8 @@ let package = Package(
"FirebaseDynamicLinks",
"FirebaseFirestoreTarget",
"FirebaseFunctions",
"FirebaseInAppMessaging",
.target(name: "FirebaseInAppMessaging",
condition: .when(platforms: [.iOS, .tvOS])),
"FirebaseInstallations",
"FirebaseMessaging",
.target(name: "FirebasePerformance",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ public let shared = Manifest(
Pod("FirebaseFirestoreSwift", zip: true),
Pod("FirebaseFunctions", zip: true),
Pod("FirebaseInAppMessaging", isBeta: true, platforms: ["ios"]),
Pod("FirebaseInAppMessagingSwift", isBeta: true, platforms: ["ios"], zip: true),
Pod(
"FirebaseInAppMessagingSwift",
isBeta: true,
allowWarnings: true,
platforms: ["ios"],
zip: true
),
Pod("FirebaseMessaging", zip: true),
Pod("FirebasePerformance", platforms: ["ios", "tvos"], zip: true),
Pod("FirebaseStorage", zip: true),
Expand Down
4 changes: 2 additions & 2 deletions SwiftPMTests/swift-test/all-imports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import FirebaseMessaging
#if (os(iOS) && !targetEnvironment(macCatalyst)) || os(tvOS)
import FirebasePerformance

import FirebaseInAppMessaging
@testable import FirebaseInAppMessagingSwift
@testable import FirebaseInAppMessaging
import FirebaseInAppMessagingSwift
import SwiftUI
#endif
import FirebaseRemoteConfig
Expand Down