Skip to content

Commit

Permalink
fix: appReady ios when no update
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 17, 2023
1 parent e33f884 commit 38759ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,15 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
self.notifyListeners("majorAvailable", data: ["version": res.version])
}
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
self.notifyListeners("appReady", data: ["bundle": current.toJSON()])
self.endBackGroundTask()
return
}
let sessionKey = res.sessionKey ?? ""
guard let downloadUrl = URL(string: res.url) else {
print("\(self.implementation.TAG) Error no url or wrong format")
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
self.notifyListeners("appReady", data: ["bundle": current.toJSON()])
self.endBackGroundTask()
return
}
Expand All @@ -547,12 +549,14 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
print("\(self.implementation.TAG) Error downloading file")
self.notifyListeners("downloadFailed", data: ["version": latestVersionName])
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
self.notifyListeners("appReady", data: ["bundle": current.toJSON()])
self.endBackGroundTask()
return
}
if next.isErrorStatus() {
print("\(self.implementation.TAG) Latest version is in error state. Aborting update.")
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
self.notifyListeners("appReady", data: ["bundle": current.toJSON()])
self.endBackGroundTask()
return
}
Expand Down

0 comments on commit 38759ab

Please sign in to comment.