google / google/GoogleSignIn-iOS

Invalid `GIDConfiguration` object reports unsupported URL error, rather than something more descriptive

Abierto
#48 1 comentario 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Objective-C
Estrellas
750
Forks
282
Merge medio
2 d 15 h
PR fusionados (30 d)
9

Descripción

## Background

I'm loading the `clientID` key from an `.xcconfig` file into an `AuthManager`, which is responsible for creating the `GIDConfiguration` object.

```swift
// AuthManager.swift
var config = GIDConfiguration(clientID: "asdf")

init() {
// Fetches the API token from an .xcconfig thru the Info.plist
if let clientID = Bundle.main.object(forInfoDictionaryKey: "GID_CLIENT_ID") as? String {
config = GIDConfiguration(clientID: clientID)
}
}
```
However, if no code is provided, I receive a runtime crash with the following error:
```
Your app is missing support for the following URL schemes: asdf'
terminating with uncaught exception of type NSException
```

## Suggestion

I'd hope that for new users this would have a more detailed explanation, such as "Invalid GIDconfiguration object; key was invalid". "Missing URL scheme support' to me would imply an issue with the `AppDelegate` rather than a config object.

I recognize this is totally minor (especially given a lot of other API design issues I've experienced in v6 with SwiftUI) but I figured I might as well report it :)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.