objective-c - Sparkle checkForUpdatesInBackground 在网络服务器上没有请求
问题描述
在我的命令行应用程序中,调用 时[[SUUpdater sharedUpdater] checkForUpdatesInBackground]
,Sparkle 项目不会在我的网络服务器上放置 HTTPS 请求。我想要一个checkForUpdatesInBackground
成功的电话,所以我知道我的设置是正确的。我正在通过 HTTPS 使用 Nginx 网络服务器,并查看该服务器的日志以确保正在请求 appcast.xml 文件。
我试过调试Sparkle框架,调用后发现checkForUpdatesInBackground
,框架确实调用dispatch_async
了here。这给出了以下堆栈跟踪。
2018-12-20 06:46:46.037297-0800 MyApplication[28705:224144] Stack trace : (
0 ??? 0x00000001005a7b0e 0x0 + 4300897038
1 MyApplication 0x0000000100001af0 main + 0
2 Sparkle 0x000000010036a5f9 -[SUAppcast fetchAppcastFromURL:inBackground:completionBlock:] + 1625
3 Sparkle 0x0000000100372fff -[SUBasicUpdateDriver checkForUpdatesAtURL:host:] + 1423
4 Sparkle 0x00000001003aabe5 -[SUUpdater checkForUpdatesWithDriver:] + 773
5 Sparkle 0x00000001003aa41e -[SUUpdater checkForUpdatesInBackground] + 494
6 MyApplication 0x0000000100001b9f main + 175
7 libdyld.dylib 0x00007fff5ddd1085 start + 1
)
我的信息列表:
{
"SUAllowsAutomaticUpdates" = NO;
CFBundleIconFile = "myicon.icns";
CFBundleExecutable = MyApplication;
"SUAutomaticallyUpdate" = NO;
"SUScheduledCheckInterval" = 3600;
"SUEnableAutomaticChecks" = NO;
SUPublicEDKey = "0xe+xaH4VBOMIADOqOqBAZug/hnrCqBKUyCffx+8Qvw=";
SUFeedURL = "https://test.myurl.com/appcast.xml";
CFBundleVersion = "1.0.0.0";
"CFBundleShortVersionString" = "7.0";
CFBundleIdentifier = "nl.apps.myapp";
}
我的代码:
int main(int argc, const char * argv[]) {
@autoreleasepool {
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
}
}
为了等待请求结束,Sparkle 确实停止了我的应用程序的终止。在我的网络服务器上,我没有看到正在请求 appcast.xml,Sparkle 也没有显示包含任何更新信息的窗口。
解决方案
就我而言,就像Rengers指出的那样,Sparkle 不起作用,因为它是一个命令行工具。这意味着不存在 Sparkle 依赖的主循环。Sparkle 使用dispatch_async将它的一些操作放在主事件队列上,例如在源代码中。
为了克服这个问题,我将我的命令行工具变成了 GUI,现在一切正常。
推荐阅读
- java - 如何解压X9.62坐标
- mxml - Royale-Apache 错误:“此标记无法解析为 ActionScript 类。它将被忽略。”
- vb.net - gmail 发送错误“原始”RFC822 有效负载消息字符串或通过 /upload/* URL 上传消息
- python - 无法从“matplotlib”导入名称“_png”
- visual-studio-2019 - “MarkdownEditorPackage”未正确加载
- python - 在 matplotlib 3D 绘图中使用图像作为背景
- django-rest-framework - 在使用 Rest-Framework 构建 Django 应用程序时在 URL 中获取 WhiteSpace
- ios - Swift 错误:调用函数写入文本时,“类型‘()’不能符合‘视图’;只有结构/枚举/类类型可以符合协议”
- reactjs - 如何将resourceTimeline与react fullcalendar一起使用?
- window - NSIS - 自定义页面、自定义大小、自定义确定和取消按钮,带有自定义字段