Skip to content
Closed
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
21 changes: 9 additions & 12 deletions abtesting/ABTestingExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,18 @@
TargetAttributes = {
10B92C9B202E3603008DBD68 = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1010;
ProvisioningStyle = Automatic;
TestTargetID = 8DFFBF991F9E6C5200C3483E;
};
8DFFBF991F9E6C5200C3483E = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0930;
LastSwiftMigration = 1010;
ProvisioningStyle = Automatic;
};
8DFFBFAD1F9E6C5200C3483E = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0930;
LastSwiftMigration = 1010;
ProvisioningStyle = Automatic;
TestTargetID = 8DFFBF991F9E6C5200C3483E;
};
Expand Down Expand Up @@ -336,7 +337,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.firebase.ABTestingExample.ABTestingExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = ABTestingExample;
};
Expand All @@ -361,7 +362,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.firebase.ABTestingExample.ABTestingExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = ABTestingExample;
};
Expand Down Expand Up @@ -487,8 +488,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks $(PODS_CONFIGURATION_BUILD_DIR)/GoogleToolboxForMac $(PODS_CONFIGURATION_BUILD_DIR)/nanopb $(PODS_CONFIGURATION_BUILD_DIR)/Protobuf";
PRODUCT_BUNDLE_IDENTIFIER = com.firebase.ABTestingExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -501,8 +501,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks $(PODS_CONFIGURATION_BUILD_DIR)/GoogleToolboxForMac $(PODS_CONFIGURATION_BUILD_DIR)/nanopb $(PODS_CONFIGURATION_BUILD_DIR)/Protobuf";
PRODUCT_BUNDLE_IDENTIFIER = com.firebase.ABTestingExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -515,8 +514,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.firebase.ABTestingExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ABTestingExample.app/ABTestingExample";
};
name = Debug;
Expand All @@ -530,8 +528,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.firebase.ABTestingExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ABTestingExample.app/ABTestingExample";
};
name = Release;
Expand Down
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 InstanceID: \(error)")
} else if let result = result {
print("InstanceID 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