Privacy

All system text boxes that are marked as secure are hidden from the recorded video automatically. In addition we support a way to mark your custom sensitive views so they will be treated similarly.

Protected view

Marking view as protected in code

You can protect any view that you want by importing Bugsee.h header and implement the following code:

Objective-C

    self.myView.bugseeProtectedView = YES;

Swift

    self.myView.bugseeProtectedView = YES

Marking view as protected in storyboard

Story Board Protect View

  • Open storyboard or xib file with interface
  • Select view that you need to protect
  • Choose the Identity inspector tab on right panel(3rd tab)
  • Add a User Defined Runtime Attribute called bugseeProtectedView as shown in the picture.

Protected web page elements

You can also prevent any web page element, shown in WebView, from being recorded by adding class="bugsee-hide" to it.

<input type="text" class="bugsee-hide">

Elements with type="password" are not recorded by default. If you want such web page element to be recorded, add class="bugsee-show" to it.

<input type="password" class="bugsee-show">

Going dark

In some rare cases you might want to conceal the whole screen and stop recording events completely. The following API's will come in handy, no data is being gathered between the calls to pause and resume.

Objective-C

    // To stop video recording use
    [Bugsee pause];

    // And to continue
    [Bugsee resume];

Swift

    // To stop video recording use   
    Bugsee.pause()

    // And to continue
    Bugsee.resume()

Network traffic

Bugsee captures network activity from the application and stores headers and in some cases body of the request and response. In order to allow you to hide user identifiable and other sensetive data from these network logs, we provide two methods for hooking your own filters, via a delegate or a block that we will call for every event about to be recorded.

Regardles of the method you chose, the principle is similar, for every event to be recorded, Bugsee will call your method and provide you with BugseeNetworkEvent object. It is your method's responsibility to clean up all user identifiable data from that structure and call decisionBlock() to pass it back to Bugsee.

Using delegate

Your class should implement BugseeDelegate protocol and it must set itself as the delegate for Bugsee.

Objective-C

-(void)bugseeFilterNetworkEvent:(BugseeNetworkEvent *)event completionHandler:(BugseeNetworkFilterDecisionBlock)decisionBlock{
    NSError * error;
    // Below is an example code that will remove access_token from all URLs going through the filter.
    NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:@"access_token=[0-9a-z\\-]*&" options:NSRegularExpressionCaseInsensitive error:&error];
    event.url = [regex stringByReplacingMatchesInString:event.url
                                                options:0
                                                  range:NSMakeRange(0, event.url.length)
                                           withTemplate:@""];

    // Send the event further, call with nil if you want to omit this event altogether.
    decisionBlock(event);
}

// ..somewhere within the class
Bugsee.delegate = self;

Swift

private func bugseeFilterNetworkEvent(event: BugseeNetworkEvent, completionHandler decisionBlock: BugseeNetworkFilterDecisionBlock){
    do {
        let regex = try NSRegularExpression.init(pattern: "&access_token=[0-9a-z\\-]*", options: NSRegularExpressionOptions.CaseInsensitive)
        let range = NSMakeRange(0 , event.url.characters.count)
        event.url = regex.stringByReplacingMatchesInString(event.url, options: .ReportProgress, range: range, withTemplate: "")
    } catch { print("Somethings went wrong!") }

    // Send the event further, call with nil if you want to omit this event altogether.
    decisionBlock(event)
}

Using filter with block

Alternatively you can set up a filter by registering a block to be executed for every event.

Objective-C

[Bugsee setNetworkEventFilter:^(BugseeNetworkEvent *event, BugseeNetworkFilterDecisionBlock decisionBlock) {

    // modify BugseeNetworkEvent as you wish here


    // Send the event further, call with nil if you want to omit this event altogether.
    decisionBlock(event);
}

// unregister a block before deallocating a class in which it was registered
[Bugsee removeNetworkEventFilter];

Swift

Bugsee.setNetworkEventFilter { (event, decisionBlock) in

    // modify BugseeNetworkEvent as you wish

    // Send the event further, call with nil if you want to omit this event altogether.
    decisionBlock(event)
}

// always call removeNetworkEventFilter method if you deallocate class where setNetworkEventFilter: was called
Bugsee.removeNetworkEventFilter()

Network Events

The delegate or hook is going to be called several times for each network request, depending on its lifecycle. Usually for successful requests its going to be called twice, once with the request event (request headers and body) and once after completion and will contain headers and body of the response.

Property Description Type Read only Notes
bugseeNetworkEventType Type of network event NSString YES Can be one of BugseeNetworkEventBegin, BugseeNetworkEventComplete, BugseeNetworkEventCancel or BugseeNetworkEventError
method HTTP Request Method NSString YES 'GET', 'POST', etc...
url Network event URL NSString NO
redirectedFromURL URL of Network event that we were redirected from NSString NO
body Body NSData NO Raw body of the request or response where available.
headers HTTP Headers NSDictionary NO Key-value store of HTTP headers associated with the event.