|
1 | 1 | #import "SentryANRTrackerV1.h"
|
2 | 2 |
|
3 |
| -#import "SentryApplication.h" |
4 | 3 | #import "SentryDispatchFactory.h"
|
5 | 4 | #import "SentryDisplayLinkWrapper.h"
|
6 | 5 | #import "SentryExtraContextProvider.h"
|
|
38 | 37 | #if SENTRY_HAS_UIKIT
|
39 | 38 | # import "SentryANRTrackerV2.h"
|
40 | 39 | # import "SentryFramesTracker.h"
|
41 |
| -# import "SentryUIApplication.h" |
42 | 40 | # import <SentryViewHierarchyProvider.h>
|
43 | 41 | # import <SentryWatchdogTerminationBreadcrumbProcessor.h>
|
44 | 42 | #endif // SENTRY_HAS_UIKIT
|
45 | 43 |
|
46 |
| -#if TARGET_OS_OSX |
47 |
| -# import "SentryNSApplication.h" |
48 |
| -#endif |
49 |
| - |
50 | 44 | #if !TARGET_OS_WATCH
|
51 | 45 | # import "SentryReachability.h"
|
52 | 46 | #endif // !TARGET_OS_WATCH
|
@@ -156,15 +150,16 @@ - (instancetype)init
|
156 | 150 | _binaryImageCache = [[SentryBinaryImageCache alloc] init];
|
157 | 151 | _dateProvider = SentryDependencies.dateProvider;
|
158 | 152 |
|
159 |
| - _notificationCenterWrapper = [NSNotificationCenter defaultCenter]; |
| 153 | + _notificationCenterWrapper = NSNotificationCenter.defaultCenter; |
160 | 154 | #if SENTRY_HAS_UIKIT
|
161 | 155 | _uiDeviceWrapper =
|
162 | 156 | [[SentryDefaultUIDeviceWrapper alloc] initWithQueueWrapper:_dispatchQueueWrapper];
|
163 |
| - _application = [[SentryUIApplication alloc] |
164 |
| - initWithNotificationCenterWrapper:_notificationCenterWrapper |
165 |
| - dispatchQueueWrapper:_dispatchQueueWrapper]; |
| 157 | + _application = UIApplication.sharedApplication; |
| 158 | + _threadsafeApplication = [[SentryThreadsafeApplication alloc] |
| 159 | + initWithInitialState:_application.unsafeApplicationState |
| 160 | + notificationCenter:_notificationCenterWrapper]; |
166 | 161 | #elif TARGET_OS_OSX
|
167 |
| - _application = [[SentryNSApplication alloc] init]; |
| 162 | + _application = NSApplication.sharedApplication; |
168 | 163 | #endif // SENTRY_HAS_UIKIT
|
169 | 164 |
|
170 | 165 | _processInfoWrapper = NSProcessInfo.processInfo;
|
|
0 commit comments