|
1 | 1 | #import "SentryANRTrackerV1.h"
|
2 | 2 |
|
3 |
| -#import "SentryApplication.h" |
4 | 3 | #import "SentryBinaryImageCache.h"
|
5 | 4 | #import "SentryDefaultObjCRuntimeWrapper.h"
|
6 | 5 | #import "SentryDispatchFactory.h"
|
|
43 | 42 | #if SENTRY_HAS_UIKIT
|
44 | 43 | # import "SentryANRTrackerV2.h"
|
45 | 44 | # import "SentryFramesTracker.h"
|
46 |
| -# import "SentryUIApplication.h" |
47 | 45 | # import <SentryViewHierarchyProvider.h>
|
48 | 46 | # import <SentryWatchdogTerminationBreadcrumbProcessor.h>
|
49 | 47 | #endif // SENTRY_HAS_UIKIT
|
50 | 48 |
|
51 |
| -#if TARGET_OS_OSX |
52 |
| -# import "SentryNSApplication.h" |
53 |
| -#endif |
54 |
| - |
55 | 49 | #if !TARGET_OS_WATCH
|
56 | 50 | # import "SentryReachability.h"
|
57 | 51 | #endif // !TARGET_OS_WATCH
|
@@ -161,15 +155,16 @@ - (instancetype)init
|
161 | 155 | _binaryImageCache = [[SentryBinaryImageCache alloc] init];
|
162 | 156 | _dateProvider = SentryDependencies.dateProvider;
|
163 | 157 |
|
164 |
| - _notificationCenterWrapper = [NSNotificationCenter defaultCenter]; |
| 158 | + _notificationCenterWrapper = NSNotificationCenter.defaultCenter; |
165 | 159 | #if SENTRY_HAS_UIKIT
|
166 | 160 | _uiDeviceWrapper =
|
167 | 161 | [[SentryDefaultUIDeviceWrapper alloc] initWithQueueWrapper:_dispatchQueueWrapper];
|
168 |
| - _application = [[SentryUIApplication alloc] |
169 |
| - initWithNotificationCenterWrapper:_notificationCenterWrapper |
170 |
| - dispatchQueueWrapper:_dispatchQueueWrapper]; |
| 162 | + _application = UIApplication.sharedApplication; |
| 163 | + _threadsafeApplication = [[SentryThreadsafeApplication alloc] |
| 164 | + initWithInitialState:_application.unsafeApplicationState |
| 165 | + notificationCenter:_notificationCenterWrapper]; |
171 | 166 | #elif TARGET_OS_OSX
|
172 |
| - _application = [[SentryNSApplication alloc] init]; |
| 167 | + _application = NSApplication.sharedApplication; |
173 | 168 | #endif // SENTRY_HAS_UIKIT
|
174 | 169 |
|
175 | 170 | _processInfoWrapper = [[SentryNSProcessInfoWrapper alloc] init];
|
|
0 commit comments