Skip to content

Remove deprecated pre-iOS 13.5 GameCenter code path and fix force-unwrap #16135

@crleonard

Description

@crleonard

Description

GameCenterAuthProvider.swift contains a WarningWorkaround protocol and
pre135Credential() method added to suppress deprecation warnings for
GKLocalPlayer.playerID and generateIdentityVerificationSignature, which
were needed for iOS < 13.5 before fetchItems was available.

The file includes a TODO explicitly calling this out:
// TODO: Delete this when minimum iOS version passes 13.5.

The SDK minimum is now iOS 15 (Package.swift), so this condition has been met.

Additionally, the async getCredential() overload force-unwraps error! with
a TODO noting it should be replaced with a safe fallback — this is a latent crash
if the completion is ever called with both credential and error as nil.

Reproducing the issue

N/A — this is dead code removal. The force-unwrap crash would require a nil
credential and nil error from GKLocalPlayer.fetchItems, which the API contract
doesn't guarantee against in all future OS versions.

Firebase SDK Version

12.13.0

Xcode Version

26.4.1

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

All

Relevant Log Output

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

No response

If using CocoaPods, the project's Podfile.lock

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions