AddressCheck (Deprecated)
SDK size
A maximum of about 500 KB, which can decrease because of these elements.
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 only purpose of this data is for fraud reduction, but if you wish, you can disable it by .setAnalyticsSettings(boolean useAnalytics)
parameter.
Runtime Permissions
Permission | Reason | Required |
---|---|---|
| To check in the background if the user lives where he/she informed | Yes |
Some cell phone manufacturers, such as Xiaomi and Oppo, block apps from running in the background unless the user explicitly allows this setting, known as AUTOSTART. For more information, see here.
Starting the SDK
Inside the onCreate
method in your Application
class, insert:
For instructions on how to create your own implementation of the
Application
class, check the official Android documentation
Instantiating the SDK
First create an object of type AddressCheck. This object is for you to configure all your business rules for the address check:
Builder method
Parameter | Required |
---|---|
Usage token associated with your CAF account. | Yes |
Identifier of the user whose address is being validated. | Yes. |
Enables/disables data collection for analytics. | No, the default is |
Sets the timeout interval for SDK requests. | No. The default is 60 (seconds) |
With this object created, and after collecting the address entered by the user, create an AddressCollection
object passing the AddressCheck
object created earlier and assign the address, see example:
Address
The Address userAddress
object, first parameter of the setAddress()
method, is from the android.location.Address
class. In it, you must pass the following fields:
Method | Example |
---|---|
Country Name. | "Brasil" |
Country code. | "BR" |
State. | "Rio Grande do Sul" |
State Region. | "Porto Alegre" |
City. | "Porto Alegre" |
Neighborhood. | "Azenha" |
Street/Avenue. | "Av. Azenha" |
Number. | "200" |
Postal 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.
Linking and unlinking the user
In addition to the common flow mentioned above, we also offer methods to bind and unbind a device from an address verification. For example, if a user who already has his address registered logs into his account, in your app, call the method below passing the userId
returned by our address verification start method.
With this, the respective device again collects location information to verify the address, if it has not already been verified.
Analogously, there is a method that unlinks the device to an address validation, which can be used in case of an application logout:
Checking the Address Validation Status
To check the status of the address validation, use the following route:
Resource: https://api.mobile.combateafraude.com/address/{peopleId}
Method: GET
Response
Status: 200 (OK)
Body
Field | Type | Required? | Description |
|
| Yes | Timestamp of the last update. |
|
| No | Device(s) where this user ID was used. |
|
| No | Verification of address(es). |
Last updated