BTAppContextSwitcher
public class BTAppContextSwitcher : NSObject
Handles return URLs when returning from app context switch and routes the return URL to the correct app context switch client class.
Note
returnURLScheme must contain your app’s registered URL Type that starts with the app’s bundle ID.
When your app returns from app switch, the app delegate should call handleOpenURL (or handleOpen if not using SceneDelegate)
-
Singleton for shared instance of
BTAppContextSwitcherDeclaration
Swift
public static let sharedInstance: BTAppContextSwitcher
-
Determine whether the return URL can be handled.
Declaration
Swift
@discardableResult public func handleOpenURL(context: UIOpenURLContext) -> BoolReturn Value
truewhen the SDK can process the return URL -
Complete payment flow after returning from app or browser switch.
Declaration
Swift
@discardableResult public func handleOpen(_ url: URL) -> BoolParameters
urlThe URL you receive in
scene:openURLContexts:(orapplication:openURL:options:if not using SceneDelegate)Return Value
truewhen the SDK has handled the URL successfully -
Registers a class
Typethat can handle a return from app context switch with a static method.Declaration
Swift
public func register(_ client: BTAppContextSwitchClient.Type)Parameters
clientA class
Typethat implementsBTAppContextSwitchClient, the methods of which will be invoked statically on the class.
View on GitHub