Skip to content

Pataa AutoFill iOS SDK Implementation Guide

Install SDK

To use the Pataa Autofill iOS SDK, you have two options. You can manually install it by including the SDK source code in your Xcode project.

Follow the steps below for a manual install:

  1. Download and unzip the PataaAutoFillSDK

  2. Drag the PataaAutoFillSDK.xcframework inside your project under the main project file. Embed the framework.

  3. Select your project.xcodeproj file. Under General, add the PataaAutoFillSDK framework in the Frameworks, Libraries & Embedded Content section.

Integration Steps for Objective-C

Follow the steps below for Objective-C:

  1. Import PataaAutoFillSDK.h to your ViewController.h file.

  2. Import PataaAutoFillSDK.h into every class where you plan to use this SDK.

    #import<PataaAutoFillSDK/PataaAutoFillSDK.h>
    

  3. Create a UIView on your UIViewController on the storyboard/xib & assign PataaAutoFillView class & create an IBOutlet of that UIView on your ViewController class.

  4. Initialize SDK with your key in ViewDidLoad() method.

    [objectName initializeSDKWithKey:@"YOUR_API_KEY"];
    

Integration Steps for Swift

Follow the steps below for Swift:

  1. Import PataaAutoFillSDK to your ViewController.swift file.
  2. Import PataaAutoFillSDK into every class where you plan to use this SDK.
    import PataaAutoFillSDK
    
  3. Create a UIView on your UIViewController on the storyboard/xib & assign PataaAutoFillView class & create an IBOutlet of that UIView on your ViewController class

  4. Initialize SDK with your key in ViewDidLoad() method.

    pataaAutoFillView.initializeSDK(withKey: "YOUR_API_KEY")
    
    Follow the steps below for Objective-C:

To get the details of entered pataa code. Please assign the PataaAutoFillDelegate to your view controller & implement PataaAutoFillDelegate in your ViewController.h file

[objecName setDelegate:self];
After that please implement the delegate methods in your view controller inside a ViewController.m file.

- (void)didReceivedPataaDetails:(PAPataaDetail *)pataaDetails withError:(NSError *)error {
 }

In PAPataaDetails, You will get the all details your pataa & user. To get the pataa details please use the following code:
- (void)didReceivedPataaDetails:(PAPataaDetail *)pataaDetails withError:(NSError *)error {
    NSLog(@"%@", pataaDetails.pataa.pataaCode)
    NSLog(@"%@", pataaDetails.pataa.address1)
    NSLog(@"%@", pataaDetails.pataa.address2)
    NSLog(@"%@", pataaDetails.pataa.address3)
    NSLog(@"%@", pataaDetails.pataa.address4)
    NSLog(@"%@", pataaDetails.pataa.cityName)
    NSLog(@"%@", pataaDetails.pataa.stateName)
    NSLog(@"%@", pataaDetails.pataa.countryName)
}

To get the user details please use the following code:
- (void)didReceivedPataaDetails:(PAPataaDetail *)pataaDetails withError:(NSError *)error {
    NSLog(@"%@", pataaDetails.user.mobile)
    NSLog(@"%@", pataaDetails.user.countryCode)
    NSLog(@"%@", pataaDetails.user.firstName)
    NSLog(@"%@", pataaDetails.user.lastName)
}

Follow the steps below for Swift: To get the details of entered pataa code. Please assign the PataaAutoFillDelegate to your view controller.

objectName.delegate = self