BlockedNumbersApi class

Android number blocking API.

Only available when the app is the default dialer or has system/carrier privileges. Check availability with isAvailable before use. All other methods throw PlatformException with code "security_error" if unavailable.

Phone numbers are matched against both original and E.164 formats automatically. E.164 is the international normalized format (e.g., "+15551234567" for "(555) 123-4567").

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

block(String number) Future<void>
Blocks a phone number.
blockAll(List<String> numbers) Future<void>
Blocks multiple phone numbers.
getAll() Future<List<Phone>>
Gets all blocked phone numbers.
isAvailable() Future<bool>
Checks if the blocking API is available. Never throws - always returns true or false.
isBlocked(String number) Future<bool>
Checks if a phone number is blocked.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openDefaultAppSettings() Future<void>
Opens the Android default app settings where the user can set the default phone app.
toString() String
A string representation of this object.
inherited
unblock(String number) Future<void>
Unblocks a phone number.
unblockAll(List<String> numbers) Future<void>
Unblocks multiple phone numbers.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

instance → const BlockedNumbersApi