Skip to content

Commit 07febdd

Browse files
authored
Merge pull request #140 from getsentry/feature/more-app-info
Add bundle id, name, version, build to app context
2 parents 2ca4b7a + db14683 commit 07febdd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Sources/Contexts.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,23 @@ private struct AppContext: Context {
247247
var buildType: String? {
248248
return info?["buildType"] as? String
249249
}
250+
251+
var bundleID: String? {
252+
return info?["bundleID"] as? String
253+
}
254+
255+
var bundleName: String? {
256+
return info?["bundleName"] as? String
257+
}
258+
259+
var bundleVersion: String? {
260+
return info?["bundleVersion"] as? String
261+
}
262+
263+
var bundleShortVersion: String? {
264+
return info?["bundleShortVersion"] as? String
265+
}
266+
250267
}
251268

252269
extension AppContext: EventSerializable {
@@ -259,6 +276,10 @@ extension AppContext: EventSerializable {
259276
attributes.append(("device_app_hash", deviceAppHash))
260277
attributes.append(("app_id", appID))
261278
attributes.append(("build_type", buildType))
279+
attributes.append(("app_identifier", bundleID))
280+
attributes.append(("app_name", bundleName))
281+
attributes.append(("app_build", bundleVersion))
282+
attributes.append(("app_version", bundleShortVersion))
262283

263284
return convertAttributes(attributes)
264285
}

0 commit comments

Comments
 (0)