|
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"
|
|
44 | 43 | #if SENTRY_HAS_UIKIT
|
45 | 44 | # import "SentryANRTrackerV2.h"
|
46 | 45 | # import "SentryFramesTracker.h"
|
47 |
| -# import "SentryUIApplication.h" |
48 | 46 | # import <SentryViewHierarchyProvider.h>
|
49 | 47 | # import <SentryWatchdogTerminationBreadcrumbProcessor.h>
|
50 | 48 | #endif // SENTRY_HAS_UIKIT
|
|
53 | 51 | # import "SentryUIDeviceWrapper.h"
|
54 | 52 | #endif // TARGET_OS_IOS
|
55 | 53 |
|
56 |
| -#if TARGET_OS_OSX |
57 |
| -# import "SentryNSApplication.h" |
58 |
| -#endif |
59 |
| - |
60 | 54 | #if !TARGET_OS_WATCH
|
61 | 55 | # import "SentryReachability.h"
|
62 | 56 | #endif // !TARGET_OS_WATCH
|
@@ -166,14 +160,15 @@ - (instancetype)init
|
166 | 160 | _binaryImageCache = [[SentryBinaryImageCache alloc] init];
|
167 | 161 | _dateProvider = SentryDependencies.dateProvider;
|
168 | 162 |
|
169 |
| - _notificationCenterWrapper = [NSNotificationCenter defaultCenter]; |
| 163 | + _notificationCenterWrapper = NSNotificationCenter.defaultCenter; |
170 | 164 | #if SENTRY_HAS_UIKIT
|
171 | 165 | _uiDeviceWrapper = [[SentryUIDeviceWrapper alloc] init];
|
172 |
| - _application = [[SentryUIApplication alloc] |
173 |
| - initWithNotificationCenterWrapper:_notificationCenterWrapper |
174 |
| - dispatchQueueWrapper:_dispatchQueueWrapper]; |
| 166 | + _application = UIApplication.sharedApplication; |
| 167 | + _threadsafeApplication = [[SentryThreadsafeApplication alloc] |
| 168 | + initWithInitialState:_application.unsafeApplicationState |
| 169 | + notificationCenter:_notificationCenterWrapper]; |
175 | 170 | #elif TARGET_OS_OSX
|
176 |
| - _application = [[SentryNSApplication alloc] init]; |
| 171 | + _application = NSApplication.sharedApplication; |
177 | 172 | #endif // SENTRY_HAS_UIKIT
|
178 | 173 |
|
179 | 174 | _processInfoWrapper = [[SentryNSProcessInfoWrapper alloc] init];
|
|
0 commit comments