Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oob section #12421

Merged
merged 42 commits into from
May 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2964dfe
Add PhoneAuth details in Settings view
pragatimodi Jan 29, 2024
c594c19
undo SwiftApplication.plist changes
pragatimodi Jan 29, 2024
354a6ef
undo SwiftApplication.plist changes
pragatimodi Jan 29, 2024
3ab2ac8
undo SwiftApplication.plist changes
pragatimodi Jan 29, 2024
ae27388
clang formatting
pragatimodi Jan 29, 2024
e057b17
game center auth login
pragatimodi Feb 6, 2024
b38a988
lint
pragatimodi Feb 6, 2024
c4d8943
correct method name
pragatimodi Feb 6, 2024
121c656
add game center icon
pragatimodi Feb 6, 2024
e6b298f
add game center account linking
pragatimodi Feb 6, 2024
46e2b62
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
pragatimodi Feb 6, 2024
417168b
lint
pragatimodi Feb 6, 2024
660551c
add app-section
pragatimodi Feb 23, 2024
c704b1a
undo accidental changes
pragatimodi Feb 23, 2024
22272f2
lint fixes
pragatimodi Feb 23, 2024
dd5d5a9
add game center to AuthMenu
pragatimodi Feb 23, 2024
cd79c97
add verifyClient() method
pragatimodi Feb 24, 2024
7bf243d
fix .plist line deletion
pragatimodi Mar 12, 2024
9b5639c
fix unit test
pragatimodi Mar 12, 2024
4f8fbb4
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi Mar 18, 2024
0471e5d
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi Mar 18, 2024
72d213d
Merge branch 'settings-phoneauth' of https://github.com/firebase/fire…
pragatimodi Mar 18, 2024
50d308a
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi Apr 3, 2024
ffcee37
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
pragatimodi Apr 3, 2024
db885d7
style.sh changes
pragatimodi Apr 3, 2024
19b6c57
remove authMenu test
pragatimodi Apr 4, 2024
b55b1f1
style
pragatimodi Apr 4, 2024
7235386
comment out AuthMenu UI test
pragatimodi Apr 4, 2024
1c331eb
cleanup
pragatimodi Apr 4, 2024
8171aca
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
pragatimodi Apr 4, 2024
bd47b2a
oob section changes
pragatimodi Apr 9, 2024
23e7899
lint
pragatimodi Apr 9, 2024
22358a2
undo whitespace changes
pragatimodi Apr 9, 2024
fb323ae
fix bracket
pragatimodi Apr 10, 2024
f5d8b4f
lint
pragatimodi Apr 10, 2024
da89955
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi May 6, 2024
53f4dde
oob-section changes
pragatimodi May 6, 2024
e70c435
lint
pragatimodi May 6, 2024
ae791c9
lint
pragatimodi May 6, 2024
20c6668
apply suggestions from code review
pragatimodi May 6, 2024
63e01b9
debugged
pragatimodi May 6, 2024
fcd9055
lint
pragatimodi May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// For Sign in with Facebook
import FBSDKLoginKit
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,9 +14,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
@testable import FirebaseAuth
// For Sign in with Facebook
import FBSDKLoginKit
@testable import FirebaseAuth
// [START auth_import]
import FirebaseCore
import GameKit
Expand Down Expand Up @@ -167,7 +166,7 @@ class AuthViewController: UIViewController, DataSourceProviderDelegate {

case .verifyPasswordResetCode:
verifyPasswordResetCode()
}
}
}

// MARK: - Firebase 🔥
Expand Down Expand Up @@ -730,55 +729,60 @@ class AuthViewController: UIViewController, DataSourceProviderDelegate {
let saveHandler: (UIAlertAction) -> Void = { _ in
let text = editController.textFields?.first?.text ?? ""
completion?(text)
pragatimodi marked this conversation as resolved.
Show resolved Hide resolved
// completion?()
// completion?()
}

let cancelHandler: (UIAlertAction) -> Void = { _ in
completion?("")
// completion?()
// completion?()
}

editController.addAction(UIAlertAction(title: "Save", style: .default, handler: saveHandler))
editController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: cancelHandler))

// Assuming `self` is a view controller
// Assuming `self` is a view controller
present(editController, animated: true, completion: nil)
}

private func showQRCodePromptWithTextInput(with message: String, url: String, completion: ((String) -> Void)? = nil) {
// Create a UIAlertController
let alertController = UIAlertController(title: "QR Code Prompt", message: message, preferredStyle: .alert)
private func showQRCodePromptWithTextInput(with message: String, url: String,
completion: ((String) -> Void)? = nil) {
// Create a UIAlertController
let alertController = UIAlertController(
title: "QR Code Prompt",
message: message,
preferredStyle: .alert
)

// Add a text field for input
alertController.addTextField { (textField) in
// Add a text field for input
alertController.addTextField { textField in
textField.placeholder = "Enter text"
}

// Create a UIImage from the URL
// Create a UIImage from the URL
guard let image = generateQRCode(from: url) else {
print("Failed to generate QR code")
return
}

// Create an image view to display the QR code
// Create an image view to display the QR code
let imageView = UIImageView(image: image)
imageView.contentMode = .scaleAspectFit
imageView.translatesAutoresizingMaskIntoConstraints = false

// Add the image view to the alert controller
// Add the image view to the alert controller
alertController.view.addSubview(imageView)

// Add constraints to position the image view
// Add constraints to position the image view
NSLayoutConstraint.activate([
imageView.topAnchor.constraint(equalTo: alertController.view.topAnchor, constant: 20),
imageView.centerXAnchor.constraint(equalTo: alertController.view.centerXAnchor),
imageView.widthAnchor.constraint(equalToConstant: 200),
imageView.heightAnchor.constraint(equalToConstant: 200)
imageView.heightAnchor.constraint(equalToConstant: 200),
])

// Add actions
// Add actions
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let submitAction = UIAlertAction(title: "Submit", style: .default) { (_) in
let submitAction = UIAlertAction(title: "Submit", style: .default) { _ in
if let text = alertController.textFields?.first?.text {
pragatimodi marked this conversation as resolved.
Show resolved Hide resolved
completion?(text)
}
Expand All @@ -787,11 +791,15 @@ class AuthViewController: UIViewController, DataSourceProviderDelegate {
alertController.addAction(cancelAction)
alertController.addAction(submitAction)

// Present the alert controller
UIApplication.shared.windows.first?.rootViewController?.present(alertController, animated: true, completion: nil)
// Present the alert controller
UIApplication.shared.windows.first?.rootViewController?.present(
alertController,
animated: true,
completion: nil
)
}

// Function to generate QR code from a string
// Function to generate QR code from a string
private func generateQRCode(from string: String) -> UIImage? {
let data = string.data(using: String.Encoding.ascii)

Expand Down
Loading