Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve deprecate 'setFeedURL' #66

Merged
merged 5 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Cocoa
import FlutterMacOS

@NSApplicationMain
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
Expand Down
10 changes: 8 additions & 2 deletions packages/auto_updater_macos/macos/Classes/AutoUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extension SUAppcastItem {
public class AutoUpdater: NSObject, SPUUpdaterDelegate {
var _userDriver: SPUStandardUserDriver?
var _updater: SPUUpdater?

var feedURL: URL?
public var onEvent:((String, NSDictionary) -> Void)?

override init() {
Expand All @@ -56,10 +56,16 @@ public class AutoUpdater: NSObject, SPUUpdaterDelegate {
userDriver: _userDriver!,
delegate: self
)
_updater?.clearFeedURLFromUserDefaults()
try? _updater?.start()
}

public func feedURLString(for updater: SPUUpdater) -> String? {
return feedURL?.absoluteString
}

public func setFeedURL(_ feedURL: URL?) {
_updater?.setFeedURL(feedURL)
self.feedURL = feedURL
try? _updater?.start()
}

Expand Down
Loading