Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
127 changes: 115 additions & 12 deletions abtesting/ABTestingExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion abtesting/ABTestingExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
Expand Down
13 changes: 9 additions & 4 deletions abtesting/ABTestingExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ class ViewController: UIViewController, UITableViewDataSource {
}

@objc func printInstanceIDToken() {
let instanceID = InstanceID.instanceID().token() ?? "null"
print("InstanceID token: \(instanceID)")
InstanceID.instanceID().instanceID { (result, error) in
if let error = error {
print("Error fetching remote instange ID: \(error)")
} else if let result = result {
print("Remote instance ID token: \(result.token)")
}
}
}

deinit {
Expand All @@ -104,7 +109,7 @@ class ViewController: UIViewController, UITableViewDataSource {
navigationController?.navigationBar.barTintColor = ViewController.lightColors.primary
navigationController?.navigationBar.barStyle = .`default`
navigationController?.navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.black
NSAttributedString.Key.foregroundColor: UIColor.black
]
tableView.separatorColor = .gray
tableView.backgroundColor = UIColor(red: 0.94, green: 0.94, blue: 0.94, alpha: 1)
Expand All @@ -113,7 +118,7 @@ class ViewController: UIViewController, UITableViewDataSource {
navigationController?.navigationBar.barTintColor = ViewController.darkColors.primary
navigationController?.navigationBar.barStyle = .black
navigationController?.navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.white
NSAttributedString.Key.foregroundColor: UIColor.white
]
tableView.separatorColor = .lightGray
tableView.backgroundColor = ViewController.darkColors.secondary
Expand Down
235 changes: 211 additions & 24 deletions admob/AdMobExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admob/AdMobExampleSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Use Firebase library to configure APIs
FirebaseApp.configure()
return true
Expand Down
165 changes: 158 additions & 7 deletions analytics/AnalyticsExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion analytics/AnalyticsExampleSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

// [START tracker_swift]
FirebaseApp.configure()
Expand Down
285 changes: 280 additions & 5 deletions authentication/AuthenticationExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions authentication/AuthenticationExampleSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// [START firebase_configure]
// Use Firebase library to configure APIs
FirebaseApp.configure()
Expand All @@ -59,13 +59,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {

// [START new_delegate]
@available(iOS 9.0, *)
func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any])
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any])
-> Bool {
// [END new_delegate]
return self.application(application,
open: url,
// [START new_options]
sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String,
sourceApplication:options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: [:])
}
// [END new_options]
Expand All @@ -89,7 +89,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
}
// [END old_options]

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return userActivity.webpageURL.flatMap(handlePasswordlessSignIn)!
}

Expand All @@ -100,7 +100,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
// [END is_signin_link]
UserDefaults.standard.set(link, forKey: "Link")
(window?.rootViewController as? UINavigationController)?.popToRootViewController(animated: false)
window?.rootViewController?.childViewControllers[0].performSegue(withIdentifier: "passwordless", sender: nil)
window?.rootViewController?.children[0].performSegue(withIdentifier: "passwordless", sender: nil)
return true
}
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,15 @@ class MainViewController: UITableViewController, GIDSignInUIDelegate {
return "Unlink"
}

override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle {
override func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle {
if indexPath.section == kSectionProviders {
return .delete
}
return .none
}

// Swipe to delete
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
let providerID = Auth.auth().currentUser?.providerData[indexPath.row].providerID
showSpinner({
Expand Down
Loading