AirServiceKitDelegate
@protocol AirServiceKitDelegate <NSObject>
AirServiceKitDelegate exposes optional methods that you can implement in your application to receive events from AirServiceKit.
AirServiceKit uses these methods to communicate with your application. For an instance of your class to function as the delegate
of AirServiceKit, it must do the following:
- Set your object as the delegate (by assigning it to
AirServiceKitViewController'sdelegate property). - Declare that your class adopts the protocol in the class definition. For example:
@interface MyClass () <AirServiceKitDelegate>
- Implement any optional methods that you want to participate in.
-
An optional
AirServiceKitDelegatemethod that can provide your application with information about the authenticated AirService customer.Note
This information is provided directly by a customer, as such the presence of all information nor its accuracy is not guaranteed.Declaration
Objective-C
- (void)AirServiceKitDidUpdateCustomer:(NSDictionary *)customer;Swift
optional func airServiceKitDidUpdateCustomer(_ customer: Any!)Parameters
customerAn
NSDictionarycontaining information such asname,email,birth_date,mobileandid. -
An optional
AirServiceKitDelegatemethod used to inform your application that the user has requested to exit theAirServiceKitViewControllerand return to your application.Depending on how your application implemented the launch of
AirServiceKitViewControlleryou should use this delegate method to reverse that process.- Example 1 If you modally presented the
AirServiceKitViewController, you should dismiss it to return.
- (IBAction)presentAirService { [self presentViewController:self.airServiceKitViewController animated:YES completion:nil]; } - (void)AirServiceKitDidTriggerHostAction { [self dismissViewControllerAnimated:YES completion:nil]; }- Example 2 If you pushed the
AirServiceKitViewControllerfrom within aUINavigationController, you should pop it to return.
- (IBAction)pushAirService { [self.navigationController pushViewController:self.airServiceKitViewController animated:YES]; [self.navigationController setNavigationBarHidden:YES animated:YES]; } - (void)AirServiceKitDidTriggerHostAction { [self.navigationController popViewControllerAnimated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES]; }See
ASHostActionTypefor supported types of return/exit buttons that will be shownDeclaration
Objective-C
- (void)AirServiceKitDidTriggerHostAction;Swift
optional func airServiceKitDidTriggerHostAction() - Example 1 If you modally presented the
View on GitHub
AirServiceKitDelegate Protocol Reference