Skip to content

Commit

Permalink
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
Browse files Browse the repository at this point in the history
…s-sdk into app-section
  • Loading branch information
pragatimodi committed Apr 4, 2024
2 parents b55b1f1 + 1c331eb commit 8171aca
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scale" : "1x"
},
{
"filename" : "game-center icon.png",
"filename" : "gamecontroller.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -241,34 +241,27 @@ class AccountLinkingViewController: UIViewController, DataSourceProviderDelegate
// Step 1: Ensure Game Center Authentication
guard GKLocalPlayer.local.isAuthenticated else {
print("Error: Player not authenticated with Game Center.")
// TODO: Handle the 'not authenticated' scenario (e.g., prompt the user)
return
}

// Step 2: Get Game Center Credential for Linking
GameCenterAuthProvider.getCredential { credential, error in
if let error = error {
print("Error getting Game Center credential: \(error.localizedDescription)")
// TODO: Handle the credential error
return
}

guard let credential = credential else {
print("Error: Missing Game Center credential")
// TODO: Handle the missing credential case
return
}

// Step 3: Link Credential with Current Firebase User
Auth.auth().currentUser?.link(with: credential) { authResult, error in
if let error = error {
print("Error linking Game Center to Firebase: \(error.localizedDescription)")
// TODO: Handle the linking error
return
}

// Linking successful
print("Successfully linked Game Center to Firebase")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class AuthenticationExampleUITests: XCTestCase {
}

// TODO: Modify this test after code refactoring, current AuthMenu items aren't necessarily sign in methods
// func testAuthOptions() {
// // There are 16 sign in methods, each with its own cell
// XCTAssertEqual(app.tables.cells.count, 16)
// }
// func testAuthOptions() {
// // There are 16 sign in methods, each with its own cell
// XCTAssertEqual(app.tables.cells.count, 16)
// }

func testAuthAnonymously() {
app.staticTexts["Anonymous Authentication"].tap()
Expand Down

0 comments on commit 8171aca

Please sign in to comment.