1 | // Copyright 2018-present 650 Industries. All rights reserved.
|
2 |
|
3 | #import <EXTaskManager/EXTaskManagerAppDelegate.h>
|
4 | #import <UMCore/UMDefines.h>
|
5 | #import <EXTaskManager/EXTaskService.h>
|
6 | #import <UMCore/UMModuleRegistryProvider.h>
|
7 |
|
8 | @implementation EXTaskManagerAppDelegate
|
9 |
|
10 | UM_REGISTER_SINGLETON_MODULE(EXTaskManagerAppDelegate)
|
11 |
|
12 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions
|
13 | {
|
14 | [(EXTaskService *)[UMModuleRegistryProvider getSingletonModuleForClass:EXTaskService.class] applicationDidFinishLaunchingWithOptions:launchOptions];
|
15 |
|
16 | return NO;
|
17 | }
|
18 |
|
19 | - (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
20 | {
|
21 | [(EXTaskService *)[UMModuleRegistryProvider getSingletonModuleForClass:EXTaskService.class] runTasksWithReason:UMTaskLaunchReasonBackgroundFetch userInfo:nil completionHandler:completionHandler];
|
22 | }
|
23 |
|
24 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
|
25 | {
|
26 | [(EXTaskService *)[UMModuleRegistryProvider getSingletonModuleForClass:EXTaskService.class] runTasksWithReason:UMTaskLaunchReasonRemoteNotification userInfo:userInfo completionHandler:completionHandler];
|
27 | }
|
28 |
|
29 | @end
|