SplytWidgetDelegate
@objc
public protocol SplytWidgetDelegate
The SplytWidget requires that you implement this delegate interface. It is used by the SplytWidget to communicate with your application.
-
This method is called when the SDK requires an access token. This token is used by Widget to authenticate the user against your CWIS api. Call the completion method with the access token.
Declaration
Swift
@objc func splytWidget(_ widget: UIViewController, requestAccessToken completion: @escaping (String) -> Void)Parameters
widgetThe SplytWidget view controller instance.
completionA handler that you should call once you have generated an access token.
-
This method is called if the user has an issue with a booking. You may wish to shut the widget and raise an issue within your application.
Declaration
Swift
@objc func splytWidget(_ widget: UIViewController, raiseIssueWithBooking booking: SWBooking)Parameters
widgetThe SplytWidget view controller instance.
bookingA booking record for which the user is raising an issue.
-
This method is called if no payment methods are supplied for the user. You may wish to close the widget, and direct your user to an area within your application where they can create a new payment method.
Declaration
Swift
@objc func splytWidgetAddPaymentMethod(_ widget: UIViewController)Parameters
widgetThe SplytWidget view controller instance.
SplytWidgetDelegate Protocol Reference