Skip to content

Commit

Permalink
Adopt new MarketplaceKit API
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268478
rdar://122022027

Reviewed by Brent Fulgham.

MarketplaceKit renamed their requestAppInstallation API and we need to adopt the new version of it.

* Source/WebKit/WebKitSwift/MarketplaceKit/MarketplaceKitWrapper.swift:
(MarketplaceKitWrapper.requestAppInstallation(_:url:)):

Canonical link: https://commits.webkit.org/273850@main
  • Loading branch information
bnham committed Jan 31, 2024
1 parent 641bc81 commit 075fc97
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ public final class MarketplaceKitWrapper : NSObject {
@objc
@available(iOS 17.4, *)
public static func requestAppInstallation(topOrigin: URL, url: URL) {
let metadata = LinkMetadata(referrer: topOrigin, url: url)
Task { @MainActor in
do {
try await AppLibrary.current.requestAppInstallation(with: metadata)
#if canImport(MarketplaceKit, _version: "1.4.77.2")
try await AppLibrary.current.requestAppInstallationFromBrowser(for: url, referrer: topOrigin)
#else
try await AppLibrary.current.requestAppInstallation(with: LinkMetadata(referrer: topOrigin, url: url))
#endif
logger.debug("WKMarketplaceKit.requestAppInstallation with top origin \(topOrigin, privacy: .sensitive) for \(url, privacy: .sensitive) succeeded")
} catch {
logger.error("WKMarketplaceKit.requestAppInstallation with top origin \(topOrigin, privacy: .sensitive) for \(url, privacy: .sensitive) failed: \(error, privacy: .public)")
Expand Down

0 comments on commit 075fc97

Please sign in to comment.