Skip to content

Commit

Permalink
Solve deprecate 'setFeedURL' (#66)
Browse files Browse the repository at this point in the history
* Remove deprecate setFeedURL

* start

* Make changes to use on local

* Add feedURL

* Bring back original repo name
  • Loading branch information
drunisa007 authored Oct 27, 2024
1 parent f84ddb5 commit dd556f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit dd556f8

Please sign in to comment.