Ask or search…
K
Links
Comment on page

AdressCheck (Deprecated)

Analytics

Our SDKs by default collect information about the user and running environment to better map fraudsters and understand their behaviors. We recommend keeping this collection active as the sole purpose of this data is for fraud reduction, but if you wish, you can disable it by the parameter .setAnalyticsSettings(boolean useAnalytics).

Required permissions

In the info.plist file, add the permissions below:
Privacy - Location Always and When In Use Usage Description
Privacy - Location Always Usage Description
Privacy - Location Usage Description
Privacy - Location When In Use Usage Description

Runtime Permissions

Permission
Reason
Required?
LocationAlwaysAuthorization
To check in the background if the user lives where he/she informed
Yes

Starting the SDK

In the application:didFinishLaunchingWithOptions: method of your AppDelegate file, enter:
import AddressCheck
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//Inicializa SDK
AddressCheck.initSDK()
return true
}
}

How to use

First create an object of type AddressCheck. This object is for you to configure all your business rules for the address check:
let AddressCheck = new AddressCheck.Builder(mobileToken: mobileToken, peopleId: peopleId)
// see a table belowwe
.build();
Parameter
Required?
mobileToken: String
Usage token associated with your CAF account
Yes
peopleId: String
Identifier of the user whose address is being validated
Yes
.setAnalyticsSettings(boolean useAnalytics)
Enables/disables data collection for analytics
No, the default is true
.setNetworkSettings(int requestTimeout)
Change the default network settings
No. The default is 60 (seconds)
With this object created, and after collecting the address entered by your user, implement the delegate, and its mandatory methods, AddressCollectionDelegate to your class, create an object of type AddressCollection, passing the object created earlier, and assign the address, as in the example:
let addressCollection = AddressCollection(addressCheck: addressCheck)
addressCollection.delegate = self
let address = Address()
// see the table below
addressCollection.setAddress(address)

Address

For address submission, you must enter the following fields:
Address address = new Address()
address.locale = Locale.init(identifier: "pt-br")
address.countryName = COUNTRY_NAME
address.countryCode = COUNTRY_CODE
address.adminArea = ADMIN_AREA
address.subAdminArea = SUB_ADMIN_AREA
address.locality = LOCALITY
address.subLocality = SUB_LOCALITY
address.thoroughfare = THOROUGHFARE
address.subThoroughfare = SUB_THOROUGHFARE
address.postalCode = POSTAL_CODE
Parameter
Example
countryName
Country Name
"Brasil"
countryCode
Código do país
"BR"
adminArea
State
"Rio Grande do Sul"
subAdminArea
State Region
"Porto Alegre"
locality
City
"Porto Alegre"
subLocality
Neighborhood
"Azenha"
thoroughfare
Street/Avenue
"Av. Azenha"
subThoroughfare
Number
"200"
postalCode
ZIP CODE
"51110-100"
That's it! After that, our SDK is already evaluating your user's location in the background to verify that he actually lives at the address you entered.

Checking the Address Validation Status

To check the status of the address validation, use the following route:
Method: GET

Response

Status: 200 (OK)

Body

Field
Type
Required
Description
last_activity_ts
number
Yes
Timestamp of the last update
installations
object
No
Device(s) where this user ID was used
address_verification
object
No
Verification of address(es)
Last modified 4mo ago