Inherits from NSObject
Declared in UAWhitelist.h

Overview

Class for whitelisting and verifying webview URLs.

Whitelist entries are written as URL patterns with optional wildcard matching:

<scheme> := ‘*’ | ‘http’ | ‘https’

<host> := ‘*’ | ‘*.’<any char except ‘/’ and ‘*’> | <any char except ‘/’ and ‘*’>

<path> := ‘/’ <any chars, including *>

<pattern> := ‘*’ | <scheme>://<host><path> | <scheme>://<host> | file://<path>

Wildcards in the scheme pattern will match either http or https schemes. The wildcard in a host pattern “*.mydomain.com” will match anything within the mydomain.com domain. Wildcards in the path pattern will match any characters, including subdirectories.

Note that NSURL does not support internationalized domains containing non-ASCII characters. All whitelist entries for internationalized domains must be in ASCII IDNA format as specified in https://tools.ietf.org/html/rfc3490

Class Methods

whitelistWithConfig:

Create a default whitelist with entries specified in a config object.

+ (instancetype)whitelistWithConfig:(UAConfig *)config

Parameters

config

An instance of UAConfig.

Return Value

An instance of UAWhitelist

Discussion

Note: The entry “*.urbanairship.com” is added by default.

Declared In

UAWhitelist.h

Instance Methods

addEntry:

Add an entry to the whitelist.

- (BOOL)addEntry:(NSString *)patternString

Parameters

patternString

A whitelist pattern string.

Return Value

YES if the whitelist pattern was validated and added, NO otherwise.

Declared In

UAWhitelist.h

isWhitelisted:

Determines whether a given URL is whitelisted.

- (BOOL)isWhitelisted:(NSURL *)url

Parameters

url

The URL under consideration.

Return Value

YES if the the URL is whitelisted, NO otherwise.

Declared In

UAWhitelist.h