AI-generated Key Takeaways
-
SafetyNetApi.SafeBrowsingResponse
is used to handle the response from thelookupUri
SafetyNet API call, which checks a URI for safety threats. -
Before using the response data, ensure the call was successful by using
getStatus()
andisSuccess()
. -
Potential error statuses include API unavailability, a missing API key, or unsupported threat types being requested.
-
getDetectedThreats()
provides a list of identified threats from theSafeBrowsingThreat
enum, if any were found for the given URI.
Response
for
lookupUri(String, String, int...)
.
Use getStatus()
to obtain the status and ensure isSuccess()
is true
before accessing any other fields. The other statuses are:
SAFE_BROWSING_API_NOT_AVAILABLE
: the API is not available for use;SAFE_BROWSING_MISSING_API_KEY
: an API key (generated in the developer console) was not added to the application's manifest;SAFE_BROWSING_UNSUPPORTED_THREAT_TYPES
: all the threat types specified inlookupUri(String, String, int...)
are currently not supported.
Public Constructor Summary
Public Method Summary
List<SafeBrowsingThreat> |
getDetectedThreats()
Returns threats detected from the input URI.
|
Inherited Method Summary
Public Constructors
public SafetyNetApi.SafeBrowsingResponse ()
Public Methods
public List<SafeBrowsingThreat> getDetectedThreats ()
Returns threats detected from the input URI.
Returns
List
of threat types fromSafeBrowsingThreat
for the input URI tolookupUri(String, String, int...)
.