firebase / firebase/firebase-ios-sdk

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

Open
#16,135 0 comments 0 reactions 0 assignees View on GitHub
api: auth
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 14h
Merged PRs (30d)
72

Description

### 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

```shell

```

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

_No response_

### If using CocoaPods, the project's Podfile.lock

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.