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's delegate 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 AirServiceKitDelegate method 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

    customer

    An NSDictionary containing information such as name, email, birth_date, mobile and id.

  • An optional AirServiceKitDelegate method used to inform your application that the user has requested to exit the AirServiceKitViewController and return to your application.

    Depending on how your application implemented the launch of AirServiceKitViewController you should use this delegate method to reverse that process.

    - (IBAction)presentAirService
    {
        [self presentViewController:self.airServiceKitViewController animated:YES completion:nil];
    }
    
    - (void)AirServiceKitDidTriggerHostAction
    {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
    
    - (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

    ASHostActionType for supported types of return/exit buttons that will be shown

    Declaration

    Objective-C

    - (void)AirServiceKitDidTriggerHostAction;

    Swift

    optional func airServiceKitDidTriggerHostAction()