forked from rekabhq/background_locator
-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathSwizzledFlutterEngineGroupCache.m
More file actions
31 lines (24 loc) · 945 Bytes
/
Copy pathSwizzledFlutterEngineGroupCache.m
File metadata and controls
31 lines (24 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "SwizzledFlutterEngineGroupCache.h"
#import <objc/runtime.h>
@implementation SwizzledFlutterEngineGroupCache
+ (instancetype)sharedInstance {
// Retrieve the original class by name using reflection
Class originalClass = NSClassFromString(@"SwizzlableFlutterEngineGroupCache");
// Check if the class exists
if (originalClass && [originalClass respondsToSelector:@selector(sharedInstance)]) {
// Call the original sharedInstance method dynamically
id sharedInstance = [originalClass performSelector:@selector(sharedInstance)];
return sharedInstance;
}
// Return nil or handle failure if the class or method is not found
NSLog(@"Original class or sharedInstance method not found");
return nil;
}
- (FlutterEngineGroup *)get:(NSString *)key {
// Interface
return nil;
}
- (void)put:(NSString *)key engineGroup:(FlutterEngineGroup *)engineGroup {
// Interface
}
@end