Skip to content

Application Name with accent character causes exception. #2609

Closed
@LondonAtlas

Description

@LondonAtlas
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions