firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

[Auth]: Evaluate `Auth.auth().canHandle(_ url: URL) -> Bool` in a scene delegate context

Open ncooke3 opened this issue 1 year ago • 0 comments

This is not a breaking change. Added to milestone 12 for reassessment if not address beforehand.

Description

Auth's canHandle(_ url: URL) API doesn't fit as well in the scene delegate world as it does in the app delegate world. In the app delegate of the below scene delegate method, a boolean needs to be returned to the API returns a Bool. That doesn't make sense in the scene delegate world (see below delegate method's lack of return type).

Two approaches:

  • Add @discardableResult to the API
  • Add new API for scene delegate context (e.g. canHandle(_ urlContext: URLContext) -> Void to the API surface
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
  for urlContext in URLContexts {
      let url = urlContext.url
      _ = Auth.auth().canHandle(url)
  }
}

API Proposal

No response

Firebase Product(s)

Authentication

ncooke3 avatar Sep 16 '24 18:09 ncooke3