Smile Identity

Consent Screen

The SDK has prebuilt screens to request consent from a user before running a job which may return personal identifiable information. This gives the user control and also ensures compliance
The screen is instantiated as a dialog on top of your app so it is important to take this into consideration if you have any navigation that is expected and whether to show it from a fragment or from an activity
  1. 1.
    The below snippet will show the consent dialog
Intent intent = new Intent(<CONTEXT>, ConsentActivity.class);
intent.putExtra(ConsentActivity.TAG, <TAG>);
intent.putExtra(ConsentActivity.PARTNER_LOGO, BitmapFactory.decodeResource(getResources(), R.drawable.<COMPANY_LOGO>));
intent.putExtra(ConsentActivity.PARTNER_NAME, <COMPANY_NAME>);
intent.putExtra(ConsentActivity.PRIVACY_LINK, <PRIVACY_URL>);
startActivityForResult(intent, USER_CONSENT_REQUEST_CODE);
  • TAG <STRING>This is important that it matches the same tag which may have been or will be used to capture the selfie and or id card document as it will determine if the job will be submitted or not when consent is required for the id type
  • COMPANY_LOGO <BITMAP> This is a bitmap typically the app icon, so the user is familiar with what they will finally see which the SDK will present on the consent screen
  • COMPANY_NAME <STRING>This is the company name that will be presented on the consent screen
  • PRIVACY_URL <STRING> This is a link to a valid web page that contains your company's privacy policy the user can click this and view the privacy policy.
  • CONTEXT Android context to show the app over, typically the current activity.
This will return a result in onActivityResult which will have a tag and a result code for RESULT_OK when the user agrees and otherwise when the user disagrees