ContentChecker

@objc
public class ContentChecker : NSObject, InitializationStateProvider

Class to detect security threats within content and protect your app users, especially where user-generated content is handled.

Check if URLs, IP addresses or messages called or used within your application are safe. Implement checks which help protect your app users from malicious websites, phishing attempts, malware, adware, and other web sources that pose a threat to your data.

If your application calls IP address or URLs which are not destined for your application server, use checkIP(_:completionHandler:) or checkURL(_:completionHandler:) to determine if the resource server is safe before making a request to that address or URL.

If your application processes user-generated content, scan the messages using checkMessage(body:sender:completionHandler:) to detect phishing attempts or unsafe links embedded in content. This enables you to catch potential threats before displaying or sending user-generated content. You could choose to block the message or highlight the content may contain unsafe links.

  • Check whether a url is safe to make an HTTP request.

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    final public class func checkURL(_ url: String, completionHandler: @escaping ContentCheckerCompletionHandler) throws -> Int64

    Parameters

    url

    A string containing the URL

    completionHandler

    The completion handler to call when the check has the ContentCheckerResult.

    Return Value

    An Int64 value representing a request ID for the URL being scanned

  • Check whether an IP address is safe to make a socket or HTTP request.

    This function checks whether or not the IP address is safe to make a socket or HTTP request.

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    final public class func checkIP(_ ip: String, completionHandler: @escaping ContentCheckerCompletionHandler) throws -> Int64

    Parameters

    ip

    A string containing the IP address.

    completionHandler

    The completion handler to call when the check has the ContentCheckerResult.

    Return Value

    An Int64 value representing a request ID for the IP being scanned

  • Check whether a message is safe to send or display to a user.

    Check whether a user-generated message is free from malicious websites links or phishing attempts and is safe to send or show to a user.

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    final public class func checkMessage(body: String, sender: String, completionHandler: @escaping ContentCheckerCompletionHandler) throws -> Int64

    Parameters

    body

    A string containing the body of the message.

    sender

    A string containing the number, email address or another identifier for the sender.

    completionHandler

    The completion handler to call when the check has the ContentCheckerResult.

    Return Value

    An Int64 value representing a request ID for the message being scanned