AppCallbackHandler

@objc(DTAppCallbackHandler)
@objcMembers
public final class AppCallbackHandler : NSObject

Use this class if your app crashes when switching to/from external payment apps, such as TWINT, Swish, Vipps, and MobilePay. Our automatic app callback logic may interfere with other logic in your app and needs to be disabled.

Globally set AppCallbackHandler.shared.automaticCallbacks to false. Then implement the application(_:open:options:) method in your AppDelegate and call AppCallbackHandler.shared.handleURL(url) with the URL received.

Public

  • Returns the shared instance of this class.

    Declaration

    Swift

    public static let shared: AppCallbackHandler
  • Whether automatic callback handling is enabled or not. By default, automatic callback handling is enabled. Set this to false to disable automatic callbacks and implement them yourself using handleURL(_:) and handleUserActivity(_:).

    Declaration

    Swift

    public var automaticCallbacks: Bool
  • Invoke this method from your SceneDelegate’s scene(_:openURLContexts:) or AppDelegate’s application(_:open:options:) with the URL received. Returns true if the URL was handled by the SDK, false otherwise.

    Declaration

    Swift

    @discardableResult
    public func handleURL(_ url: URL) -> Bool
  • Invoke this method from your SceneDelegate’s scene(_:continue:) or AppDelegate’s application(_:continue:restorationHandler:) with the user activity received. Returns true if the activity was handled by the SDK, false otherwise.

    Declaration

    Swift

    @discardableResult
    public func handleUserActivity(_ userActivity: NSUserActivity) -> Bool