Squirrel 是 OS X 框架,专注于制作应用更新,安全透明的更新到网站中。
你的请求可以包括认证信息,自定义头部或者请求主体。
配置:
#import <Squirrel/Squirrel.h>- (void)applicationDidFinishLaunching:(NSNotification *)notification { NSURLComponents *components = [[NSURLComponents alloc] init]; components.scheme = @"http"; components.host = @"mycompany.com"; components.path = @"/myapp/latest"; NSString *bundleVersion = NSBundle.mainBundle.sqrl_bundleVersion; components.query = [[NSString stringWithFormat:@"version=%@", bundleVersion] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet] self.updater = [[SQRLUpdater alloc] initWithUpdateRequest:[NSURLRequest requestWithURL:components.URL]]; // Check for updates every 4 hours. [self.updater startAutomaticChecksWithInterval:60 * 60 * 4];}