Skip to content

Commit

Permalink
Uses GULAppEnvironmentUtil.isAppExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcomi committed Mar 27, 2024
1 parent 5406e3e commit a3f29f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions FirebaseStorage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Firebase Storage provides robust, secure file uploads and downloads from Firebas
s.dependency 'FirebaseCore', '~> 10.0'
s.dependency 'FirebaseCoreExtension', '~> 10.0'
s.dependency 'GTMSessionFetcher/Core', '>= 2.1', '< 4.0'
s.dependency 'GoogleUtilities/Environment', '~> 7.12'

s.test_spec 'ObjCIntegration' do |objc_tests|
objc_tests.scheme = { :code_coverage => true }
Expand Down
8 changes: 7 additions & 1 deletion FirebaseStorage/Sources/StorageUploadTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

import Foundation

#if SWIFT_PACKAGE
@_implementationOnly import GoogleUtilities_Environment
#else
@_implementationOnly import GoogleUtilities
#endif // SWIFT_PACKAGE

#if COCOAPODS
import GTMSessionFetcher
#else
Expand Down Expand Up @@ -88,7 +94,7 @@ import Foundation
uploadFetcher.uploadFileURL = fileURL
uploadFetcher.comment = "File UploadTask"

if Bundle.main.bundlePath.hasSuffix(".appex") {
if GULAppEnvironmentUtil.isAppExtension() {
uploadFetcher.useBackgroundSession = false
}
}
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ let package = Package(
"FirebaseCore",
"FirebaseCoreExtension",
.product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
.product(name: "GULEnvironment", package: "GoogleUtilities"),
],
path: "FirebaseStorage/Sources"
),
Expand Down

0 comments on commit a3f29f9

Please sign in to comment.