Metamap button
Once you have done the setup described in the Quick Start section you are good to start a verification. In this part of the documentation we will start a verification using the Metamap SDK
Add the MetamapButton to your layout
<com.metamap.metamap_sdk.MetamapButton
android:id="@+id/metamapButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:text="YOUR CUSTOM TEXT" />
In your Activity initialize the MetamapButton
and call its setParams(...)
method with the respective params on the button
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main);
//..
val button = findViewById<MetamapButton>(R.id.metamapButton)
button.setParams(this, "YOUR_CLIENT_ID", "YOUR_FLOW_ID")
}
}
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//..
MetamapButton button = findViewById(R.id.metamapButton);
button.setParams(this, "CLIENT_ID", "YFLOW_ID");
}
}
In order to make this work you need to set your own CLIENT_ID
and FLOW_ID
. You can find them in the Metamap Dashboard, for more details please check this section.
Congratulations! On this stage you are already able to start the Metamap SDK and have your first verification.
Updated 12 months ago
Now it's time to get the callback from the SDK in order to understand whether the verification was completed or cancelled. To learn how to set up a callback please follow the SDK Callback section.