addEntry

open fun addEntry(@NonNull pattern: String): Boolean

Adds an entry to the URL allow list for URL matching. Patterns must be defined with the following syntax:


<pattern> := '*' | <scheme>'://'<host>/<path> | <scheme>'://'<host> | <scheme>':/'<path> | <scheme>':///'<path>  | <scheme>':'<path>
<scheme> := <any char combination ' ', '*' are treated as wild cards>
<host> := '*' | '*.'<any char combination except ' ', '/' and '*'> | <any char combination except ' ', '/', and '*'>
<path> := <any char combination except ' ', '*' are treated as wild cards>
Examples: '*' will match any URI '*://www.urbanairship.com' will match any schema from www.urbanairship.com 'https://*.urbanairship.com' will match any https URL from urbanairship.com and any of its subdomains. 'file:///android_asset/*' will match any file in the android assets directory. 'http://urbanairship.com/foo/*.html' will match any url from urbanairship.com that ends in .html and the path starts with /foo/.

Note: International domains should add entries for both the ASCII and the unicode versions of the domain.

Return

true if the pattern was added successfully, false if the pattern was unable to be added because it was either null or did not match the url-pattern syntax.

Parameters

pattern

The URL pattern to add as a URL allow list matcher.


open fun addEntry(@NonNull pattern: String, scope: Int): Boolean

Adds an entry to the URL allow list for URL matching. Patterns must be defined with the following syntax:


<pattern> := '*' | <scheme>'://'<host>/<path> | <scheme>'://'<host> | <scheme>':/'<path> | <scheme>':///'<path>
<scheme> := <any char combination, '*' are treated as wild cards>
<host> := '*' | '*.'<any char combination except '/' and '*'> | <any char combination except '/' and '*'>
<path> := <any char combination, '*' are treated as wild cards>
Examples: '*' will match any URI '*://www.urbanairship.com' will match any schema from www.urbanairship.com 'https://*.urbanairship.com' will match any https URL from urbanairship.com and any of its subdomains. 'file:///android_asset/*' will match any file in the android assets directory. 'http://urbanairship.com/foo/*.html' will match any url from urbanairship.com that ends in .html and the path starts with /foo/.

Note: International domains should add entries for both the ASCII and the unicode versions of the domain.

Return

true if the pattern was added successfully, false if the pattern was unable to be added because it was either null or did not match the url-pattern syntax.

Parameters

pattern

The URL pattern to add as a URL allow list matcher.

scope

The scope that entry applies to.