Custom headers
It's possible to send adicional headers in every request made from the SDK. In order to achieve this the developer should use this constructor instead:
BiometridOn.getInstance().init(
POLYGON_API_URL
POLYGON_API_KEY,
POLYGON_API_SECRET,
POLYGON_API_FLOW_ID,
CONTEXT).setCustomHeaders(Map<String, String> custom_headers);
Name:
Description:
POLYGON_API_KEY
Key credential provided
POLYGON_API_SECRET
Secret credential provided
POLYGON_API_FLOW_ID
ID credential provided
POLYGON_API_URL
URL credential provided
allow_pusher
Option to use Pusher or not
custom_headers
Map of custom headers <KEY, VALUE>
Implementation example
public class Example extends Application implements OnInitializationCallback {
private final static String BIOMETRID_SERVER_URL = "";
private final static String BIOMETRID_CREDENTIAL_KEY = "";
private final static String BIOMETRID_CREDENTIAL_SECRET = "";
private final static String BIOMETRID_CREDENTIAL_FLOW_ID = "";
@Override
public void onCreate() {
super.onCreate();
Map<String, String> headers = new HashMap<>();
headers.put("KEY", "VALUE");
BiometridLibrary.getInstance().init(
POLYGON_API_URL,
POLYGON_API_KEY,
POLYGON_API_SECRET,
POLYGON_API_FLOW_ID,
getApplicationContext()).setCustomHeaders(headers);
}
@Override
public void onInitCallback(@NonNull Boolean aBoolean, @Nullable Errors errors) {
}
}
Last updated