Squirrel.Mac应用更新框架

联合创作 · 2023-09-30 23:36

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];}

 

浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报