Skip to main content

Requirements

Before you begin integrating the Hiya SDK you need to make sure your project conforms to these requirements:

Hiya SDK Integration Requirements

  • Artifactory username and password (Provided by Hiya)
  • hiya_services.json (Provided by Hiya) placed in your app's res/raw directory

See Build Integration for how to use the Artifactory credentials and hiya_service.json

Android Requirements

  • Android minSdk 23
  • Android targetSdkVersion 33

Android Permissions

The Hiya SDK is optimized to use the call screening role with a couple other permissions. However that role was added in Android 10 and we provide support as far back as Android 6. If you are only support apps on Android 10+ then you can simply follow the permission requirements for Android 10+ below. If you want to support as far back as Android 6 then Hiya recommends checking the OS version at runtime to determine which options to use. Users on Android 10+ will get the ideal experience where an unwanted call is blocked before it rings, and users on lower versions will get the best possible experience available at that API level, which does allow the call to ring about one time before blocking.

Note: both sets of permissions include READ_PHONE_STATE and ANSWER_PHONE_STATE. These both need to be included in your AndroidManifest.xml and in the set of permissions requested at runtime. However these permissions get combined when presented to users so these 2 permissions together appear as 1 to users.

Android 10+ (API level 29)

This is the optimal user experience, blocking unwanted calls before they ring. Your app will need to get the role and permissions listed below before blocking and showing caller id will function.

ROLE_CALL_SCREENING:

Required to load identity and block unwanted calls before they start ringing.

READ_PHONE_STATE:

Required to respond to call events using the BroadcastReceiver. This permission is mandatory and must be granted before calling startCallerIntelligence().

ANSWER_PHONE_CALLS:

Required to auto-block the phone calls for the users. If any of the auto-block features are enabled, the users must grant this permission.

READ_CONTACTS:

Required to show contact information if the phone number is from one of the contacts. To provide better user experiences, we recommend providing this permission such that HiyaServices will not perform an API lookup when the number is in the user’s contact list and thus avoid showing a different identity from that of the default dialer.

AndroidManifest.xml

Adding permissions in the app AndroidManifest.xml

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS"/>

Android 9 and below (API levels 23-28)

Because the call screener role is not available until api level 29 we need to use a slightly larger set of permissions to support call identity and blocking on api levels 23-28:

READ_CALL_LOG:

In order to get the phone number from the Broadcast event, the users must grant this permission.

SYSTEM_ALERT_WINDOW:

Required to show the caller id overlay over other apps as a phone call starts ringing while your app is not in the foreground.

Note: This permission can not be directly requested, instead you must launch an Intent for result that takes users to settings:

Intent(
Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:${requireContext().packageName}")
)

READ_PHONE_STATE:

Required to respond to call events using the BroadcastReceiver. This permission is mandatory and must be granted before calling startCallerIntelligence().

ANSWER_PHONE_CALLS:

Required to auto-block the phone calls for the users. If any of the auto-block features are enabled, the users must grant this permission.

READ_CONTACTS:

Required to show contact information if the phone number is from one of the contacts. To provide better user experiences, we recommend providing this permission such that HiyaServices will not perform an API lookup when the number is in the user’s contact list and thus avoid showing a different identity from that of the default dialer.

AndroidManifest.xml

Adding permissions in the app AndroidManifest.xml

<uses-permission android:name="android.permission.READ_CALL_LOG"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS"/>