【发布时间】:2013-06-12 09:50:13
【问题描述】:
如何远程清除 iDevice [iPod Touch、iPhone 或 iPad] 中的数据/应用程序?
可能的解决方案如下。
- 在您的 iPod 上配置“查找我的 iPod”
- 调用服务器并检查设备是否被报告为被盗?如果是,则调用 exit(0) 函数并清除数据和应用程序。
我使用第二种解决方案来清除应用程序中的数据。为此,我使用了以下两种方法。
-(NSString *)getDatabasePath {
NSArray *subDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[self applicationAppSupportDirectory] error:nil];
NSString *path = [[[self applicationAppSupportDirectory] stringByAppendingPathComponent:[subDir lastObject]]
stringByAppendingPathComponent:@"xyz.sqlite"];
return path ;
}
-(void)deleteDatabase {
NSFileManager *manager = [NSFileManager defaultManager] ;
NSError *error = nil ;
NSString *databasePath = [self getDatabasePath];
if ([manager fileExistsAtPath:databasePath]) {
[manager removeItemAtPath:databasePath error:&error] ;
}
debug(@"%@",error);
if (error) {
[Utility showAlertViewWithTitle:@"Error" andMessage:error.localizedDescription];
}
}
-(void)deleteApplication {
exit(0);
NSString *appPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] ;
NSLog(@"%@",appPath);
}
我删除了应用程序文件夹,但我的 iDevice 上仍然有应用程序徽标。 这是清除我的应用程序的正确方法吗? 苹果会为此拒绝我的应用程序吗? 为什么 appLogo 仍然存在,因为我完全删除了 app 文件夹?
【问题讨论】:
-
您不能以编程方式删除应用程序,顺便问一下,您为什么要这样做??
-
由于我的应用程序包含敏感数据,如果他的设备被盗,客户希望将其删除。
-
@milanpanchal:iOS 已经通过 iCloud 和“查找 iPhone”应用提供了对整个设备的远程擦除功能。
-
@Marcelo Cantos - 我已经在我的问题中指定了那个东西。但为此,用户必须启用该功能。