Skip to content

Commit 75d059d

Browse files
committed
Device ID in Rollbar config; also show in settings
1 parent dd12ea8 commit 75d059d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Tree Tracker/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
99
let config = RollbarConfig()
1010
config.destination.accessToken = Secrets.rollbarAuthToken
1111
config.destination.environment = Constants.Http.protectEarthEnvironmentName
12+
config.person.id = UIDevice.current.identifierForVendor?.uuidString ?? "unknown"
1213

1314
Rollbar.initWithConfiguration(config)
1415
Rollbar.infoMessage("App startup")

Tree Tracker/Screens/Settings/SettingsController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SettingsController: UITableViewController {
2424

2525
// MARK: - Datasource
2626
override func numberOfSections(in tableView: UITableView) -> Int {
27-
return 2
27+
return 3
2828
}
2929

3030
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
@@ -33,6 +33,8 @@ class SettingsController: UITableViewController {
3333
return "Entities"
3434
case 1:
3535
return "API"
36+
case 2:
37+
return "Device ID"
3638
default:
3739
return "Error"
3840
}
@@ -44,6 +46,8 @@ class SettingsController: UITableViewController {
4446
return entityTypes.count
4547
case 1:
4648
return apiProperties.count
49+
case 2:
50+
return 1
4751
default:
4852
return 0
4953
}
@@ -58,6 +62,9 @@ class SettingsController: UITableViewController {
5862
case 1:
5963
cell.textLabel?.text = apiProperties[indexPath.item]
6064
cell.selectionStyle = .none
65+
case 2:
66+
cell.textLabel?.text = UIDevice.current.identifierForVendor?.uuidString ?? "unknown"
67+
cell.selectionStyle = .none
6168
default:
6269
break
6370
}

0 commit comments

Comments
 (0)