Description
- Xcode version: 10.1 (10B61)
- Firebase SDK version: 5.18.0
- Firebase Component: Core
- Component version: 5.3.1
[REQUIRED] Step 3: Describe the problem
When trying to configure the object FirebaseApp using the initialiser configure(name:
String. options: FirebaseOptions)supplying an application name that contains an accent such as
ē` will cause an exception.
Steps to reproduce:
Running the following line will cause the exception App name should only contain Letters, Numbers, Underscores, and Dashes.
to be thrown.
FirebaseApp.configure(name: "hēllo", options: options)
Looking at the source code there is an if check looking for characters above and below a-z A-Z and 0-9.
FIRApp.m: 161
if (!((character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') || (character >= '0' && character <= '9') || character == '_' || character == '-')) { [NSException raise:kFirebaseCoreErrorDomain format:@"App name should only contain Letters, " @"Numbers, Underscores, and Dashes."]; }
Relevant Code:
let plistPath = Bundle.main.path(forResource: "MyGoogleServicePlist", ofType: "plist")
let googleService = try! PropertyListDecoder().decode(GoogleService.self, from: data)
let options = FirebaseOptions(googleAppID: googleService.appId, gcmSenderID: googleService.gcmId)
`FirebaseApp.configure(name: "hēllo", options: options)`
Due to a multi target workspace we are required to have custom names for the GoogleService-Info.plist which is why it contains a custom name in the sample above.