gpt4 book ai didi

ios - iOS 10.3 中的备用图标 : avoid notification dialog for icon change

转载 作者:技术小花猫 更新时间:2023-10-29 11:05:42 25 4
gpt4 key购买 nike

我正在使用这个新功能,当对事件应用程序进行更改时,会显示一个通知对话框,说明图标已被修改。如何禁用此对话框?

最佳答案

如果你不介意使用私有(private)方法,你可以试试下面的代码。

- (void)lc_setAlternateIconName:(NSString*)iconName
{
//anti apple private method call analyse
if ([[UIApplication sharedApplication] respondsToSelector:@selector(supportsAlternateIcons)] &&
[[UIApplication sharedApplication] supportsAlternateIcons])
{
NSMutableString *selectorString = [[NSMutableString alloc] initWithCapacity:40];
[selectorString appendString:@"_setAlternate"];
[selectorString appendString:@"IconName:"];
[selectorString appendString:@"completionHandler:"];

SEL selector = NSSelectorFromString(selectorString);
IMP imp = [[UIApplication sharedApplication] methodForSelector:selector];
void (*func)(id, SEL, id, id) = (void *)imp;
if (func)
{
func([UIApplication sharedApplication], selector, iconName, ^(NSError * _Nullable error) {});
}
}
}

关于ios - iOS 10.3 中的备用图标 : avoid notification dialog for icon change,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43356570/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com