How To: User Reporting
Users can report callers as Spam, Fraud, Not Spam, and other categories as well as optionally including a comment.
First load the list of report categories via HiyaRepo.getReportCategories(String). Then collect information from your users about the phone number they want to provide feedback on. Have your users select a ReportCategory from the list and optionally enter a comment about the number. Then submit the feedback by calling HiyaRepo.sendFeedback(String, ReportCategory, String?)
// Load the report categories in the user's language
val hiyaRepo = HiyaService.getHiyaRepo(context)
val reportCategories = hiyaRepo.getReportCategories("en-US")
// Later, after providing UI for users to pick a category and optionally add a comment
val phoneNumber = "5555555555" // The phone number users are providing feedback on
val reportCategory: ReportCategory = userChosenReportCategory
val comment: String? = userProvidedComment
hiyaRepo.sendFeedback(phoneNumber, reportCategory, comment)