Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone 12 iOS 16.3.1 执行一直不成功 #23

Open
wbzhan opened this issue Jun 29, 2023 · 4 comments
Open

iPhone 12 iOS 16.3.1 执行一直不成功 #23

wbzhan opened this issue Jun 29, 2023 · 4 comments

Comments

@wbzhan
Copy link

wbzhan commented Jun 29, 2023

ll_getLaunchImagePath 方法返回一直为空
DEBUG发现 [NSFileManager.defaultManager fileExistsAtPath:path] 校验一直为false
路径打印出来为 "/var/mobile/Containers/Data/Application/xxx/Library/SplashBoard/Snapshots/xxx - {DEFAULT GROUP}",
对比Demo中打印路径也基本一致,但是就是校验false

@wbzhan
Copy link
Author

wbzhan commented Jun 29, 2023

系统配置有多个target,对应多种语言

@internetWei
Copy link
Owner

可以提供一下示例demo吗?或者你新建一个项目;我在真机16.4.1上面测试并没有复现你的问题。

@wbzhan
Copy link
Author

wbzhan commented Jun 29, 2023

我跑你的Demo没问题,在我自己的App上就不行
`+ (nullable NSString *)ll_getLaunchImagePath {
static NSString *path = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *bundleIdentifier = NSBundle.mainBundle.bundleIdentifier;

    if (@available(iOS 13.0, *)) {
        NSString *libraryPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject;
        path = [NSString pathWithComponents:@[libraryPath, @"SplashBoard", @"Snapshots", [NSString stringWithFormat:@"%@ - {DEFAULT GROUP}", bundleIdentifier]]];
    } else {
        NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
        path = [NSString pathWithComponents:@[cachePath, @"Snapshots", bundleIdentifier]];
    }
    NSLog(@"path = %@",path);
    path = [NSFileManager.defaultManager fileExistsAtPath:path] ? path : nil;
});

return path;

}`;
这个方法返回path为nil

@wbzhan
Copy link
Author

wbzhan commented Jun 29, 2023

解决了,我代码早些时候添加了清理启动图的功能,一直没去掉,在debug的时候调用了
[NSFileManager.defaultManager removeItemAtPath:[NSString stringWithFormat:@"%@/Library/SplashBoard",NSHomeDirectory()] error:&clearLaunchrror]
所以导致后面再去查询系统的启动图为空;感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants