Skip to content

Commit

Permalink
feat!: Add support for live update differentials
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This _requires_ an update to LiveUpdates 0.5.0
  • Loading branch information
Steven0351 committed Feb 8, 2024
1 parent 9657c97 commit bc4f2ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/ionic-team/ionic-live-updates-releases",
"state": {
"branch": null,
"revision": "fe3474212b612bdbb0496f81db854530b39ba0d5",
"version": "0.4.0"
"revision": "1b04d7e2afe633302dd4f4c4560eb3cd8d3719f9",
"version": "0.5.0"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm", .upToNextMajor(from: "5.0.0")),
.package(url: "https://github.com/ionic-team/ionic-live-updates-releases", "0.1.2"..<"0.5.0"),
.package(url: "https://github.com/ionic-team/ionic-live-updates-releases", "0.5.0"..<"0.6.0"),
],
targets: [
.target(
Expand Down
10 changes: 8 additions & 2 deletions Sources/IonicPortals/Portal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public struct Portal {
public var liveUpdateConfig: LiveUpdate? = nil {
didSet {
guard let liveUpdateConfig = liveUpdateConfig else { return }
try? liveUpdateManager.add(liveUpdateConfig)
try? liveUpdateManager.add(
liveUpdateConfig,
existingCacheUrl: bundle.url(forResource: startDir, withExtension: nil)
)
}
}

Expand Down Expand Up @@ -79,7 +82,10 @@ public struct Portal {
self.liveUpdateManager = liveUpdateManager
self.liveUpdateConfig = liveUpdateConfig
if let liveUpdateConfig = liveUpdateConfig {
try? liveUpdateManager.add(liveUpdateConfig)
try? liveUpdateManager.add(
liveUpdateConfig,
existingCacheUrl: bundle.url(forResource: self.startDir, withExtension: nil)
)
}
self.assetMaps = assetMaps
}
Expand Down

0 comments on commit bc4f2ed

Please sign in to comment.