WS1Filter

By default, Workspace ONE Intelligence SDK reports Network Insights data for all URLs that are accessed by your app and strips each URL of any query parameters. For example, http://foo.com?name=critter becomes http://foo.com. This is done to ensure personal information is not transmitted to Workspace ONE Intelligence.

It is also possible to customise filter blacklists that will completely discard matching URLs. Network Insights data that pertains to any URL that matches the blacklist will not be reported to Workspace ONE Intelligence.

Use the [WS1Filter filterWithString:] to modify the default filtering behavior:

// Add filters at initialization
WS1Config *config = [WS1Config defaultConfig];
config.urlFilters = @[[WS1Filter filterWithString:@"sensitiveURL"],
                      [WS1Filter filterWithString:@"additionalURL"]];
[WS1Intelligence enableWithAppID:@"MYAPPID" config:config];

// Add filters later on
[WS1Intelligence addFilter:[WS1Filter filterWithString:@"anotherURL"]];
// Add filters at initialization
let config : WS1Config = WS1Config.default()
config.urlFilters = [WS1Filter(string: "sensitiveURL"), WS1Filter(string: "additionalURL")]
WS1Intelligence.enable(withAppID: appID, config: config)

// Add filters later on
WS1Intelligence.add(filter: WS1Filter)

Note

  • Filters match URLs via case sensitive substring matching

Creating a Filter

+ filterWithString:
Convenience method to create a blacklisting filter.
+ (WS1Filter *)filterWithString:(NSString *)matchToken;
class func filter(withString: matchToken)
matchToken An NSString of the url to filter
A WS1Filter object for matchToken.
+ filterWithString:andFilterType:
Convenience method to create a filter with the specified filter type.
+ (WS1Filter *)filterWithString:(NSString *)matchToken
                  andFilterType:(WS1FilterType)filterType
class func filter(withString: matchToken andFilterType:filterType)
matchToken An NSString of the url to filter
filterType Indicates filter type
A WS1Filter object for matchToken.
- initWithString:
Initialize a filter that blacklists all URLs that match the specified token.
- (id)initWithString:(NSString *)matchToken;
init?(string matchToken: String)
matchToken An NSString of the url to filter
A WS1Filter object of type WS1FilterTypeBlacklist
- initWithString:andFilterType:
Initialize a filter that with the behavior specified by the filter type.
- (id)initWithString:(NSString *)matchToken
       andFilterType:(WS1FilterType)filterType;
init?(string matchToken: String,
  filterType filterType: WS1FilterType)
matchToken An NSString of the url to filter
filterType Indicates filter type
A WS1Filter object with the indicated filter type.

Other Methods

+ doesMatch:
Returns YES if the filter matches the provided URL string
- (BOOL)doesMatch:(NSString *)url;

url Specifies the url to be matched
Returns YES when the filter matches the provided URL string

Constants

WS1FilterType
The filter type of WS1Filter
typedef enum : NSInteger {
   WS1FilterTypeBlacklist,
   WS1FilterTypePreserveQuery,
   WS1FilterTypePreserveFragment,
   WS1FilterTypePreserveParameters,
   WS1FilterTypePreserveAll
} WS1FilterType;
enum WS1FilterType : Int {
    case Blacklist
    case PreserveQuery
    case PreserveFragment
    case PreserveParameters
    case PreserveAll
}
WS1FilterTypeBlacklist Blacklist certain endpoints. Request with a URL that match this string are not reported
WS1FilterTypePreserveQuery Prevent URL query string from being stripped out
WS1FilterTypePreserveFragment Prevent URL fragment identifier from being stripped out
WS1FilterTypePreserveParameters Prevent URL parameter string from being stripped out
WS1FilterTypePreserveAll Prevent URL query, fragment, and parameters sections from being stripped out