Lookback Public API

Introduction

Public interface for Lookback, the UX testing tool that records your screen and camera and uploads it to http://lookback.io for further study.



Classes

Lookback

Categories

UIView(LookbackConcealing)


Groups

Notifications

These notifications can be observed from [NSNotificationCenter defaultCenter].

Group members:

 

Settings

These settings can be set using [NSUserDefaults standardUserDefaults] to modify the behavior of Lookback. Some of these settings can be modified by the user from LookbackSettingsViewController.

Group members:

 

Compatibility macros

For compatibility with old code using Lookback under the miscapitalized or misprefixed names.


Constants

LookbackAudioEnabledSettingsKey
LookbackAutomaticallyLogViewAppearance
LookbackCameraEnabledSettingsKey
LookbackExperienceDestinationURLUserInfoKey
LookbackExperienceStartedAtUserInfoKey
LookbackRecordingAfterTimeoutOptionSettingsKey
LookbackRecordingTimeoutSettingsKey
LookbackScreenRecorderFramerateLimitKey
LookbackShowPreviewSettingsKey
LookbackStartedUploadingNotificationName

LookbackAudioEnabledSettingsKey


static NSString *const LookbackAudioEnabledSettingsKey = @"com.thirdcog.lookback.audio.enabled";  
Discussion

The BOOL NSUserDefaults key LookbackAudioEnabledSettingsKey controls whether audio will be recorded together with the front-facing camera. Does nothing if LookbackCameraEnabledSettingsKey is NO.


LookbackAutomaticallyLogViewAppearance


static NSString *const LookbackAutomaticallyLogViewAppearance = 
@"GFio.lookback.autologViews";  
Discussion

If you implement the method `+(NSString*)lookBackIdentifier` in your view controller, that view will automatically be logged under that name (and later filter on it at lookback.io). Otherwise, your view controller's class name will be used instead, with prefix ("UI") and suffix ("ViewController") removed. You can disable this behavior by setting the NSUserDefaults key `LookbackAutomaticallyLogViewAppearance` to NO, and calling `-[LookBack enteredView:]` and `-[Lookback exitedView:]` methods manually.


LookbackCameraEnabledSettingsKey


static NSString *const LookbackCameraEnabledSettingsKey = @"com.thirdcog.lookback.camera.enabled";  
Discussion

LookbackCameraEnabledSettingsKey controls whether the front-facing camera will record, in addition to recording the screen.


LookbackExperienceDestinationURLUserInfoKey


static NSString *const LookbackExperienceDestinationURLUserInfoKey = 
@"com.thirdcog.lookback.notification.startedUploading.destinationURL";  
Discussion

UserInfo key in a LookbackStartedUploadingNotificationName notification. The value is an NSURL that the user can visit on a computer to view the experience he/she just recorded.


LookbackExperienceStartedAtUserInfoKey


static NSString *const LookbackExperienceStartedAtUserInfoKey = 
@"com.thirdcog.lookback.notification.startedUploading.sessionStartedAt";  
Discussion

UserInfo key in a LookbackStartedUploadingNotificationName notification. The value is an NSDate of when the given experience was recorded (so you can correlate the upload with the recording).


LookbackRecordingAfterTimeoutOptionSettingsKey


static NSString *const LookbackRecordingAfterTimeoutOptionSettingsKey = 
@"io.lookback.recording.afterTimeoutOption";  
Discussion

The LookbackAfterTimeoutOption key LookbackRecordingAfterTimeoutOptionSettingsKey controls the behavior of Lookback when it times out after the app has become inactive. LookbackAfterTimeoutReview will let the user manually review and decide the next the app is open. LookbackAfterTimeoutUpload will proceed with uploading. LookbackAfterTimeoutUploadAndStartNewRecording will proceed with uploading and also start a new recording the next time the app is brought to the foreground.


LookbackRecordingTimeoutSettingsKey


static NSString *const LookbackRecordingTimeoutSettingsKey = 
@"io.lookback.recording.timeoutDuration";  
Discussion

The NSTimeInterval/double key LookbackRecordingTimeoutOptionSettingsKey controls the timeout option when the app becomes inactive. Using 0 will stop a recording as soon as the app becomes inactive. Using DBL_MAX will never terminate a recording when the app becomes inactive. Any value in between will timeout and end the recording after the specified duration.


LookbackScreenRecorderFramerateLimitKey


static NSString *const LookbackScreenRecorderFramerateLimitKey = 
@"com.thirdcog.lookback.screenrecorder.fpsLimit";  
Discussion

The integer NSUserDefaults key LookbackScreenRecorderFramerateLimitKey lets you set a specific framerate to limit screen recording to. Note that Lookback adapts framerate to something suitable for the current device: setting the framerate manually will override this.

Decreasing the framerate is the best way to fix performance problems with Lookback. However, instead of hard-coding a specific framerate, consider setting -[Lookback framerateMultiplier] instead, as this will let Lookback adapt the framerate to something suitable for your device.

Default value: Depends on hardware Range: 1 to 60


LookbackShowPreviewSettingsKey


static NSString *const LookbackShowPreviewSettingsKey = @"com.thirdcog.lookback.preview.enabled";  
Discussion

The BOOL NSUserDefaults key LookbackShowPreviewSettingsKey controls whether the user should be shown a preview image of their face at the bottom-right of the screen while recording, to make sure that they are holding their iPhone correctly and are well-framed.


LookbackStartedUploadingNotificationName


static NSString *const LookbackStartedUploadingNotificationName = 
@"com.thirdcog.lookback.notification.startedUploading";  
Discussion

When an experience upload starts, its URL is determined. You can then attach this URL to a bug report or similar.

@example

        // Automatically put an experience's URL on the user's pasteboard when recording ends and upload starts.
        [[NSNotificationCenter defaultCenter] addObserverForName:LookbackStartedUploadingNotificationName object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
            NSDate *when = [note userInfo][LookbackExperienceStartedAtUserInfoKey];
            if(fabs([when timeIntervalSinceNow]) < 60) { // Only if it's for an experience we just recorded
                NSURL *url = [note userInfo][LookbackExperienceDestinationURLUserInfoKey];
                [UIPasteboard generalPasteboard].URL = url;
            }
        }];

Typedefs

NS_ENUM

NS_ENUM


typedef NS_ENUM(NSInteger, LookbackTimeoutOption) { 
    LookbackTimeoutImmediately = 0, LookbackTimeoutAfter1Minutes = 
    60, LookbackTimeoutAfter3Minutes = 180, LookbackTimeoutAfter5Minutes = 
    300, LookbackTimeoutAfter15Minutes = 900, LookbackTimeoutAfter30Minutes = 
    1800, LookbackTimeoutNever = NSIntegerMax, 
};  
Discussion

Standard timeout options for LookbackRecordingTimeoutSettingsKey.


Macro Definitions

Lookback_Weak

Lookback_Weak


#define Lookback_Weak  
Discussion

If you only want to use Lookback in builds sent to testers (e g by using the CocoaPods :configurations=> feature), you need to avoid both linking with Lookback.framework and calling any Lookback code (since that would create a linker error). By making all your calls to Lookback_Weak instead of Lookback, your calls will be disabled when not linking with Lookback, and you thus avoid linker errors.

@example

        [Lookback_Weak setupWithAppToken:@"<MYAPPTOKEN>"];
        [Lookback_Weak lookback].shakeToRecord = YES;
        
        [[Lookback_Weak lookback] enteredView:@"Settings"];