Digital PCT32 defect CXTDT-544924 - Insert missing OpenUrlOptionsModel handling.
This commit is contained in:
parent
f6f272f727
commit
c4b6122d4c
@ -54,9 +54,9 @@ open class ActionOpenUrlHandler: MVMCoreJSONActionHandlerProtocol {
|
||||
|
||||
/// Opens the url using UIApplication open(url:). Throws URLError.failedToOpen if it fails.
|
||||
@MainActor
|
||||
public static func open(url: URL) async throws {
|
||||
public static func open(url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:]) async throws {
|
||||
try await withCheckedThrowingContinuation { continuation in
|
||||
UIApplication.shared.open(url, options: [:]) { successful in
|
||||
UIApplication.shared.open(url, options: options) { successful in
|
||||
if successful {
|
||||
continuation.resume()
|
||||
} else {
|
||||
@ -76,12 +76,13 @@ open class ActionOpenUrlHandler: MVMCoreJSONActionHandlerProtocol {
|
||||
// Try loading the app url first, otherwise fall back to browser url.
|
||||
if let appURL = model.appURL {
|
||||
do {
|
||||
try await ActionOpenUrlHandler.open(url: appURL)
|
||||
try await ActionOpenUrlHandler.open(url: appURL, options: model.appURLOptions?.options ?? [:])
|
||||
return
|
||||
} catch {
|
||||
// Log error and continue
|
||||
MVMCoreLoggingHandler.shared()?.handleDebugMessage("Failed to open app url: \(appURL)")
|
||||
if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: MVMCoreActionHandler.getErrorLocation(with: delegateObject?.actionDelegate, actionType: model.actionType)) {
|
||||
let isUsingUniversalLinksOnly = model.appURLOptions?.options[.universalLinksOnly] as? Bool ?? false
|
||||
if !isUsingUniversalLinksOnly , let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: MVMCoreActionHandler.getErrorLocation(with: delegateObject?.actionDelegate, actionType: model.actionType)) {
|
||||
MVMCoreLoggingHandler.shared()?.addError(toLog: errorObject)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user