7 #include "flutter/fml/logging.h"
8 #include "flutter/lib/ui/plugins/callback_cache.h"
18 auto info = flutter::DartCallbackCache::GetCallbackInformation(handle);
19 if (info ==
nullptr) {
23 new_info.
callbackName = [NSString stringWithUTF8String:info->name.c_str()];
24 new_info.
callbackClassName = [NSString stringWithUTF8String:info->class_name.c_str()];
29 + (void)setCachePath:(NSString*)path {
30 FML_DCHECK(path != nil);
31 flutter::DartCallbackCache::SetCachePath([path UTF8String]);
32 NSString* cache_path =
33 [NSString stringWithUTF8String:flutter::DartCallbackCache::GetCachePath().c_str()];
36 if (![[NSFileManager defaultManager] fileExistsAtPath:cache_path]) {
37 [[NSFileManager defaultManager] createFileAtPath:cache_path contents:nil attributes:nil];
39 NSURL* URL = [NSURL fileURLWithPath:cache_path];
40 BOOL success = [URL setResourceValue:[NSNumber numberWithBool:YES]
41 forKey:NSURLIsExcludedFromBackupKey
44 NSLog(
@"Error excluding %@ from backup %@", [URL lastPathComponent], error);