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

FirebaseAuth - sharedApplication is unavailable #11537

Closed
Glasi731 opened this issue Jul 12, 2023 · 5 comments · Fixed by #11554
Closed

FirebaseAuth - sharedApplication is unavailable #11537

Glasi731 opened this issue Jul 12, 2023 · 5 comments · Fixed by #11554
Assignees
Labels
api: auth extensions For iOS extensions targets (i.e. share, messages)

Comments

@Glasi731
Copy link

Description

After updating our project to FirebaseAuth 10.12.0 we get compile errors. The project consists of an app and extensions for push notifications and widgets. Obviously [UIApplication sharedApplication] is not available in app extensions.

[...]//TOTP/FIRTOTPSecret.m:63:23 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

[...]/TOTP/FIRTOTPSecret.m:64:21 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

[...]/TOTP/FIRTOTPSecret.m:64:40 'openURL:options:completionHandler:' is unavailable: not available on iOS (App Extension)

Reproducing the issue

No response

Firebase SDK Version

10.12.0

Xcode Version

14.3

Installation Method

CocoaPods

Firebase Product(s)

Analytics, Authentication, Crashlytics, Remote Config

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
PODS:
  - Alamofire (5.7.1)
  - AMPopTip (4.10.0)
  - AppAuth (1.6.2):
    - AppAuth/Core (= 1.6.2)
    - AppAuth/ExternalUserAgent (= 1.6.2)
  - AppAuth/Core (1.6.2)
  - AppAuth/ExternalUserAgent (1.6.2):
    - AppAuth/Core
  - Cache (6.0.0)
  - Cartography (4.0.0)
  - DGCharts (5.0.0):
    - DGCharts/Core (= 5.0.0)
  - DGCharts/Core (5.0.0)
  - FeedKit (9.1.2)
  - Firebase/Analytics (10.12.0):
    - Firebase/Core
  - Firebase/AnalyticsWithoutAdIdSupport (10.12.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics/WithoutAdIdSupport (~> 10.12.0)
  - Firebase/Auth (10.12.0):
    - Firebase/CoreOnly
    - FirebaseAuth (~> 10.12.0)
  - Firebase/Core (10.12.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (~> 10.12.0)
  - Firebase/CoreOnly (10.12.0):
    - FirebaseCore (= 10.12.0)
  - Firebase/Crashlytics (10.12.0):
    - Firebase/CoreOnly
    - FirebaseCrashlytics (~> 10.12.0)
  - Firebase/RemoteConfig (10.12.0):
    - Firebase/CoreOnly
    - FirebaseRemoteConfig (~> 10.12.0)
  - FirebaseABTesting (10.12.0):
    - FirebaseCore (~> 10.0)
  - FirebaseAnalytics (10.12.0):
    - FirebaseAnalytics/AdIdSupport (= 10.12.0)
    - FirebaseCore (~> 10.0)
    - FirebaseInstallations (~> 10.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
    - GoogleUtilities/MethodSwizzler (~> 7.11)
    - GoogleUtilities/Network (~> 7.11)
    - "GoogleUtilities/NSData+zlib (~> 7.11)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - FirebaseAnalytics/AdIdSupport (10.12.0):
    - FirebaseCore (~> 10.0)
    - FirebaseInstallations (~> 10.0)
    - GoogleAppMeasurement (= 10.12.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
    - GoogleUtilities/MethodSwizzler (~> 7.11)
    - GoogleUtilities/Network (~> 7.11)
    - "GoogleUtilities/NSData+zlib (~> 7.11)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - FirebaseAnalytics/WithoutAdIdSupport (10.12.0):
    - FirebaseCore (~> 10.0)
    - FirebaseInstallations (~> 10.0)
    - GoogleAppMeasurement/WithoutAdIdSupport (= 10.12.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
    - GoogleUtilities/MethodSwizzler (~> 7.11)
    - GoogleUtilities/Network (~> 7.11)
    - "GoogleUtilities/NSData+zlib (~> 7.11)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - FirebaseAppCheckInterop (10.12.0)
  - FirebaseAuth (10.12.0):
    - FirebaseAppCheckInterop (~> 10.0)
    - FirebaseCore (~> 10.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
    - GoogleUtilities/Environment (~> 7.8)
    - GTMSessionFetcher/Core (< 4.0, >= 2.1)
  - FirebaseCore (10.12.0):
    - FirebaseCoreInternal (~> 10.0)
    - GoogleUtilities/Environment (~> 7.8)
    - GoogleUtilities/Logger (~> 7.8)
  - FirebaseCoreExtension (10.12.0):
    - FirebaseCore (~> 10.0)
  - FirebaseCoreInternal (10.12.0):
    - "GoogleUtilities/NSData+zlib (~> 7.8)"
  - FirebaseCrashlytics (10.12.0):
    - FirebaseCore (~> 10.5)
    - FirebaseInstallations (~> 10.0)
    - FirebaseSessions (~> 10.5)
    - GoogleDataTransport (~> 9.2)
    - GoogleUtilities/Environment (~> 7.8)
    - nanopb (< 2.30910.0, >= 2.30908.0)
    - PromisesObjC (~> 2.1)
  - FirebaseInstallations (10.12.0):
    - FirebaseCore (~> 10.0)
    - GoogleUtilities/Environment (~> 7.8)
    - GoogleUtilities/UserDefaults (~> 7.8)
    - PromisesObjC (~> 2.1)
  - FirebaseRemoteConfig (10.12.0):
    - FirebaseABTesting (~> 10.0)
    - FirebaseCore (~> 10.0)
    - FirebaseInstallations (~> 10.0)
    - GoogleUtilities/Environment (~> 7.8)
    - "GoogleUtilities/NSData+zlib (~> 7.8)"
  - FirebaseSessions (10.12.0):
    - FirebaseCore (~> 10.5)
    - FirebaseCoreExtension (~> 10.0)
    - FirebaseInstallations (~> 10.0)
    - GoogleDataTransport (~> 9.2)
    - GoogleUtilities/Environment (~> 7.10)
    - nanopb (< 2.30910.0, >= 2.30908.0)
    - PromisesSwift (~> 2.1)
  - Google-Maps-iOS-Utils (4.1.0):
    - Google-Maps-iOS-Utils/Clustering (= 4.1.0)
    - Google-Maps-iOS-Utils/Geometry (= 4.1.0)
    - Google-Maps-iOS-Utils/GeometryUtils (= 4.1.0)
    - Google-Maps-iOS-Utils/Heatmap (= 4.1.0)
    - Google-Maps-iOS-Utils/QuadTree (= 4.1.0)
    - GoogleMaps
  - Google-Maps-iOS-Utils/Clustering (4.1.0):
    - Google-Maps-iOS-Utils/QuadTree
    - GoogleMaps
  - Google-Maps-iOS-Utils/Geometry (4.1.0):
    - GoogleMaps
  - Google-Maps-iOS-Utils/GeometryUtils (4.1.0):
    - GoogleMaps
  - Google-Maps-iOS-Utils/Heatmap (4.1.0):
    - Google-Maps-iOS-Utils/QuadTree
    - GoogleMaps
  - Google-Maps-iOS-Utils/QuadTree (4.1.0):
    - GoogleMaps
  - Google-Mobile-Ads-SDK (10.7.0):
    - GoogleAppMeasurement (< 11.0, >= 7.0)
    - GoogleUserMessagingPlatform (>= 1.1)
  - GoogleAppMeasurement (10.12.0):
    - GoogleAppMeasurement/AdIdSupport (= 10.12.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
    - GoogleUtilities/MethodSwizzler (~> 7.11)
    - GoogleUtilities/Network (~> 7.11)
    - "GoogleUtilities/NSData+zlib (~> 7.11)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - GoogleAppMeasurement/AdIdSupport (10.12.0):
    - GoogleAppMeasurement/WithoutAdIdSupport (= 10.12.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
    - GoogleUtilities/MethodSwizzler (~> 7.11)
    - GoogleUtilities/Network (~> 7.11)
    - "GoogleUtilities/NSData+zlib (~> 7.11)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - GoogleAppMeasurement/WithoutAdIdSupport (10.12.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
    - GoogleUtilities/MethodSwizzler (~> 7.11)
    - GoogleUtilities/Network (~> 7.11)
    - "GoogleUtilities/NSData+zlib (~> 7.11)"
    - nanopb (< 2.30910.0, >= 2.30908.0)
  - GoogleDataTransport (9.2.3):
    - GoogleUtilities/Environment (~> 7.7)
    - nanopb (< 2.30910.0, >= 2.30908.0)
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleMaps (8.0.0):
    - GoogleMaps/Maps (= 8.0.0)
  - GoogleMaps/Base (8.0.0)
  - GoogleMaps/Maps (8.0.0):
    - GoogleMaps/Base
  - GoogleSignIn (7.0.0):
    - AppAuth (~> 1.5)
    - GTMAppAuth (< 3.0, >= 1.3)
    - GTMSessionFetcher/Core (< 4.0, >= 1.1)
  - GoogleUserMessagingPlatform (2.0.1)
  - GoogleUtilities/AppDelegateSwizzler (7.11.1):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (7.11.1):
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleUtilities/Logger (7.11.1):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (7.11.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (7.11.1):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (7.11.1)"
  - GoogleUtilities/Reachability (7.11.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (7.11.1):
    - GoogleUtilities/Logger
  - GTMAppAuth (2.0.0):
    - AppAuth/Core (~> 1.6)
    - GTMSessionFetcher/Core (< 4.0, >= 1.5)
  - GTMSessionFetcher/Core (3.1.1)
  - Kingfisher (7.8.1)
  - MarkdownView (1.9.1)
  - nanopb (2.30909.0):
    - nanopb/decode (= 2.30909.0)
    - nanopb/encode (= 2.30909.0)
  - nanopb/decode (2.30909.0)
  - nanopb/encode (2.30909.0)
  - Pageboy (4.0.2)
  - Periphery (2.15.0)
  - PromisesObjC (2.2.0)
  - PromisesSwift (2.2.0):
    - PromisesObjC (= 2.2.0)
  - RangeSeekSlider (1.8.0)
  - ReachabilitySwift (5.0.0)
  - RxAlamofire (6.1.1):
    - RxAlamofire/Core (= 6.1.1)
  - RxAlamofire/Core (6.1.1):
    - Alamofire (~> 5.4)
    - RxSwift (~> 6.0)
  - RxBlocking (6.5.0):
    - RxSwift (= 6.5.0)
  - RxCocoa (6.5.0):
    - RxRelay (= 6.5.0)
    - RxSwift (= 6.5.0)
  - RxGesture (4.0.4):
    - RxCocoa (~> 6.0)
    - RxSwift (~> 6.0)
  - RxRelay (6.5.0):
    - RxSwift (= 6.5.0)
  - RxSwift (6.5.0)
  - RxTest (6.5.0):
    - RxSwift (= 6.5.0)
  - SemanticVersioning (3.0.0)
  - SwiftLint (0.52.4)
  - SwiftMessages (9.0.6):
    - SwiftMessages/App (= 9.0.6)
  - SwiftMessages/App (9.0.6)
  - Tabman (3.0.1):
    - Pageboy (~> 4.0.2)

DEPENDENCIES:
  - Alamofire (~> 5)
  - AMPopTip
  - Cache
  - Cartography
  - DGCharts (~> 5)
  - FeedKit (~> 9.1)
  - Firebase/Analytics (~> 10)
  - Firebase/AnalyticsWithoutAdIdSupport (~> 10)
  - Firebase/Auth (~> 10)
  - Firebase/Crashlytics (~> 10)
  - Firebase/RemoteConfig (~> 10)
  - Google-Maps-iOS-Utils (~> 4)
  - Google-Mobile-Ads-SDK (~> 10)
  - GoogleMaps (~> 8)
  - GoogleSignIn (~> 7)
  - Kingfisher (~> 7.0)
  - MarkdownView
  - Periphery
  - RangeSeekSlider
  - ReachabilitySwift
  - RxAlamofire (~> 6)
  - RxBlocking (~> 6)
  - RxCocoa (~> 6)
  - RxGesture
  - RxSwift (~> 6)
  - RxTest (~> 6)
  - SemanticVersioning
  - SwiftLint
  - SwiftMessages
  - Tabman (~> 3)

SPEC REPOS:
  trunk:
    - Alamofire
    - AMPopTip
    - AppAuth
    - Cache
    - Cartography
    - DGCharts
    - FeedKit
    - Firebase
    - FirebaseABTesting
    - FirebaseAnalytics
    - FirebaseAppCheckInterop
    - FirebaseAuth
    - FirebaseCore
    - FirebaseCoreExtension
    - FirebaseCoreInternal
    - FirebaseCrashlytics
    - FirebaseInstallations
    - FirebaseRemoteConfig
    - FirebaseSessions
    - Google-Maps-iOS-Utils
    - Google-Mobile-Ads-SDK
    - GoogleAppMeasurement
    - GoogleDataTransport
    - GoogleMaps
    - GoogleSignIn
    - GoogleUserMessagingPlatform
    - GoogleUtilities
    - GTMAppAuth
    - GTMSessionFetcher
    - Kingfisher
    - MarkdownView
    - nanopb
    - Pageboy
    - Periphery
    - PromisesObjC
    - PromisesSwift
    - RangeSeekSlider
    - ReachabilitySwift
    - RxAlamofire
    - RxBlocking
    - RxCocoa
    - RxGesture
    - RxRelay
    - RxSwift
    - RxTest
    - SemanticVersioning
    - SwiftLint
    - SwiftMessages
    - Tabman

SPEC CHECKSUMS:
  Alamofire: 0123a34370cb170936ae79a8df46cc62b2edeb88
  AMPopTip: 4630471652faf06872f72a39bfcb6f5b68a7e208
  AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
  Cache: 4ca7e00363fca5455f26534e5607634c820ffc2d
  Cartography: c5626d29056b20f1e95c017326ee4df57cc39ad8
  DGCharts: 6e0cf2644e8f81ad13f04caa8bc18502870a1c54
  FeedKit: 71653273ab08e618cd6fd1301ca08fc02dca6a9e
  Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
  FirebaseABTesting: 09c328e6a86d562b4e1146c8a9073deadc566b77
  FirebaseAnalytics: 0270389efbe3022b54ec4588862dabec3477ee98
  FirebaseAppCheckInterop: f95a4feb9089867aff1a4bdc2ce309137e07736a
  FirebaseAuth: a66c1e14ec58f41d154a4b41ce1a23ea00ad4805
  FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
  FirebaseCoreExtension: 0ce5ac36042001cfa233ce7bfa28e5c313cf80f4
  FirebaseCoreInternal: 950500ad8a08963657f6d8c67b579740c06d6aa1
  FirebaseCrashlytics: c4d111b7430c49744c74bcc6346ea00868661ac8
  FirebaseInstallations: 7b99ef103f013624444c614397038219c45f8e63
  FirebaseRemoteConfig: bc7f260e6596956fafbb532443c19bd3c30f5258
  FirebaseSessions: a4ee211eeb31a2224cd8d9d4e30a0fccde9aa00c
  Google-Maps-iOS-Utils: 3343332b18dfd5be8f1f44edd7d481ace3da4d9a
  Google-Mobile-Ads-SDK: 2b62c695321edc7827857ac19eaeab89b57f6862
  GoogleAppMeasurement: 2d800fab85e7848b1e66a6f8ce5bca06c5aad892
  GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
  GoogleMaps: 0dce473ab18742d0f327887853630927cbee9127
  GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842
  GoogleUserMessagingPlatform: 5f8b30daf181805317b6b985bb51c1ff3beca054
  GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
  GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae
  GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72
  Kingfisher: 63f677311d36a3473f6b978584f8a3845d023dc5
  MarkdownView: 22249778219cc22901f1454e8355298dd0bda7f0
  nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
  Pageboy: 34ff11e8d1041b81769d5bcde9b19a0cb7218bd9
  Periphery: 058ba2804ebb88aff53eed58720fd4362fe5216a
  PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
  PromisesSwift: cf9eb58666a43bbe007302226e510b16c1e10959
  RangeSeekSlider: 650b11fa1edcb92e1e0ede797669d98622570fb5
  ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
  RxAlamofire: beb75a1c452d0de225651db4903f5d29d034a620
  RxBlocking: 04b5fd28bb5ea49f7d64b80db8bbfe50d9cc1c7d
  RxCocoa: 94f817b71c07517321eb4f9ad299112ca8af743b
  RxGesture: f3efb47ed2d26a8082f7b660d4a59970e275a7f8
  RxRelay: 1de1523e604c72b6c68feadedd1af3b1b4d0ecbd
  RxSwift: 5710a9e6b17f3c3d6e40d6e559b9fa1e813b2ef8
  RxTest: eb2d23adefc5a5ebf5779c7792fa3edfe6ebcc17
  SemanticVersioning: aeb58f8229d968c22f8cd5a7593055e930c1dff5
  SwiftLint: 1cc5cd61ba9bacb2194e340aeb47a2a37fda00b3
  SwiftMessages: f0c7ef4705a570ad6c5e208b611f4333e660ed92
  Tabman: a5880789298f81d3f2cdd6510b54ae637cfd8e09

PODFILE CHECKSUM: 54d2f440ef6671a3b951ba90ed4720900c784848

COCOAPODS: 1.12.1

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@paulb777
Copy link
Member

@Glasi731 Thanks for the report. We'll investigate.

The sharedApplication code should be wrapped like https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseAuth/Sources/Auth/FIRAuth.m#L567

We are also missing regression tests for app extension builds.

@paulb777 paulb777 added the extensions For iOS extensions targets (i.e. share, messages) label Jul 12, 2023
@paulb777 paulb777 added this to the 10.13.0 - M135 milestone Jul 12, 2023
@Xiaoshouzi-gh
Copy link
Contributor

cc @renkelvin cc @pragatimodi

@paulb777
Copy link
Member

Fixed by #11605

@dehypnosis
Copy link

dehypnosis commented Aug 17, 2023

@firebase firebase locked and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: auth extensions For iOS extensions targets (i.e. share, messages)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants