BBaton App SDK

BBaton App SDK is a module that lets Android and iOS apps call the anonymous verification flow directly. It is initialized using the client credentials and redirect_uri issued during Preparation, then connected to your app logic through the returned verification result.

Supported PlatformsAndroid · iOS
Distribution Format.aar · .framework
Required ValuesclientId · clientSecret · redirectUri
Default Return Valueadult_flag

01 Apply on Android

On Android, download the SDK package, add the .aar file to the project, and connect the build configuration with your Activity code.

Gradle
AndroidCOPY ↗
dependencies {
    implementation files('libs/bbaton-sdk.aar')
}
Java
Android ActivityCOPY ↗
import com.bbaton.android.sdk.BbatonSdk;

public class BbatonLoginActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent bbatonIntent = new Intent(BbatonLoginActivity.this, BbatonSdk.class);
        bbatonIntent.putExtra("clientId", "client_id provided when registering with BBATON");
        bbatonIntent.putExtra("clientSecret", "client_secret provided when registering with BBATON");
        bbatonIntent.putExtra("redirectUri", "redirect_uri entered during BBATON registration");
        startActivityForResult(bbatonIntent, 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == 1 && resultCode == RESULT_OK && data != null) {
            String adultFlag = data.getStringExtra("adult_flag");
        }
    }
}

02 Apply on iOS

On iOS, add the framework file to the project, configure info.plist, and present the BBaton view from your ViewController.

Info.plist
iOSCOPY ↗
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
Swift
ViewControllerCOPY ↗
import UIKit
import BbatonIOSFramework

class ViewController: UIViewController, BbatonDelegate {
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func toBbatonLogin(_ sender: Any) {
        let storyboard = UIStoryboard(name: "Bbaton", bundle: Bundle(for: BbatonViewController.self))
        let vc = storyboard.instantiateViewController(withIdentifier: "BbatonViewController") as! BbatonViewController
        vc.clientId = "client_id provided when registering with BBATON"
        vc.clientSecret = "client_secret provided when registering with BBATON"
        vc.redirectUrl = "redirect_uri entered during BBATON registration"
        vc.delegate = self
        present(vc, animated: true, completion: nil)
    }

    func sendUserData(adult_flag: String?) {
        let adultFlag = adult_flag
    }
}

03 Required values and configuration points

The app SDK uses the values issued during Preparation as-is. Both Android and iOS pass the same credential set, and the returned result can be processed however your internal app logic requires.

Item
Description
Type
Notes
01
clientId
Required
Issued after registration
02
clientSecret
Required
Requires secure handling
03
redirectUri
Required
Must match the preregistered path
04
adult_flag
Return Value
Adult verification value
Return The default app SDK example returns adult_flag. Additional verification items can later be extended on top of the same delivery structure to fit your service policy.