|
61 | 61 | } |
62 | 62 |
|
63 | 63 | NSDictionary *BSGParseApp(NSDictionary *report) { |
| 64 | + NSDictionary *system = report[BSGKeySystem]; |
| 65 | + |
64 | 66 | NSMutableDictionary *appState = [NSMutableDictionary dictionary]; |
65 | 67 |
|
66 | | - NSDictionary *stats = report[@"application_stats"]; |
| 68 | + NSDictionary *stats = system[@"application_stats"]; |
67 | 69 |
|
68 | 70 | NSInteger activeTimeSinceLaunch = |
69 | 71 | [stats[@"active_time_since_launch"] doubleValue] * 1000.0; |
|
73 | 75 | BSGDictSetSafeObject(appState, @(activeTimeSinceLaunch), |
74 | 76 | @"durationInForeground"); |
75 | 77 |
|
76 | | - BSGDictSetSafeObject(appState, report[BSGKeyExecutableName], BSGKeyName); |
| 78 | + BSGDictSetSafeObject(appState, system[BSGKeyExecutableName], BSGKeyName); |
77 | 79 | BSGDictSetSafeObject(appState, |
78 | 80 | @(activeTimeSinceLaunch + backgroundTimeSinceLaunch), |
79 | 81 | @"duration"); |
80 | 82 | BSGDictSetSafeObject(appState, stats[@"application_in_foreground"], |
81 | 83 | @"inForeground"); |
82 | | - BSGDictSetSafeObject(appState, report[@"CFBundleIdentifier"], BSGKeyId); |
| 84 | + BSGDictSetSafeObject(appState, system[@"CFBundleIdentifier"], BSGKeyId); |
83 | 85 | return appState; |
84 | 86 | } |
85 | 87 |
|
86 | | -NSDictionary *BSGParseAppState(NSDictionary *report) { |
| 88 | +NSDictionary *BSGParseAppState(NSDictionary *report, NSString *preferredVersion) { |
87 | 89 | NSMutableDictionary *app = [NSMutableDictionary dictionary]; |
88 | 90 |
|
| 91 | + NSString *version = preferredVersion ?: report[@"CFBundleShortVersionString"]; |
| 92 | + |
89 | 93 | BSGDictSetSafeObject(app, report[@"CFBundleVersion"], @"bundleVersion"); |
90 | 94 | BSGDictSetSafeObject(app, [Bugsnag configuration].releaseStage, |
91 | 95 | BSGKeyReleaseStage); |
92 | | - BSGDictSetSafeObject(app, report[@"CFBundleShortVersionString"], BSGKeyVersion); |
| 96 | + BSGDictSetSafeObject(app, version, BSGKeyVersion); |
93 | 97 |
|
94 | 98 | BSGDictSetSafeObject(app, [Bugsnag configuration].codeBundleId, @"codeBundleId"); |
95 | 99 |
|
|
0 commit comments