远程清除iDevice中的应用程序

时间:2013-06-12 09:50:14

标签: iphone ios ipad ipod

如何从iDevice [iPod Touch,iPhone或iPad]远程清除数据/应用程序?

可能的解决方案如下。

  1. 在iPod上配置“查找我的iPod”
  2. 进行服务器调用并检查设备是否被报告为被盗?如果是,则调用exit(0)函数并清除数据和应用程序。
  3. 我使用第二种解决方案来清除应用中的数据。我使用了以下两种方法。

    -(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上有Application Logo。 这是消除我的应用程序的正确方法吗? 苹果会拒绝我的应用吗? 为什么appLogo仍然存在,因为我完全删除了app文件夹?

1 个答案:

答案 0 :(得分:0)

Apple不允许您使用exit(0)。您可以擦除用户数据,但是您必须确保在此之后仍然可以使用该应用程序(即,将应用程序恢复到首次启动状态)。

对于报告被盗部分:您必须为此创建自己的Web UI或类似内容,因为Apple目前不允许您从第三方应用程序中访问该类型的iCloud信息。