Lookback Public API
IntroductionPublic interface for Lookback, the UX testing tool that records your screen and camera and uploads it to http://lookback.io for further study. ClassesCategoriesGroupsNotificationsThese notifications can be observed from [NSNotificationCenter defaultCenter]. Group members:
SettingsThese 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 macrosFor compatibility with old code using Lookback under the miscapitalized or misprefixed names. Constants
LookbackAudioEnabledSettingsKeystatic NSString *const LookbackAudioEnabledSettingsKey = @"com.thirdcog.lookback.audio.enabled"; DiscussionThe BOOL NSUserDefaults key LookbackAudioEnabledSettingsKey controls whether audio will be recorded together with the front-facing camera. Does nothing if LookbackCameraEnabledSettingsKey is NO. LookbackAutomaticallyLogViewAppearancestatic NSString *const LookbackAutomaticallyLogViewAppearance = @"GFio.lookback.autologViews"; DiscussionIf 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. LookbackCameraEnabledSettingsKeystatic NSString *const LookbackCameraEnabledSettingsKey = @"com.thirdcog.lookback.camera.enabled"; DiscussionLookbackCameraEnabledSettingsKey controls whether the front-facing camera will record, in addition to recording the screen. LookbackExperienceDestinationURLUserInfoKeystatic NSString *const LookbackExperienceDestinationURLUserInfoKey = @"com.thirdcog.lookback.notification.startedUploading.destinationURL"; DiscussionUserInfo 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. LookbackExperienceStartedAtUserInfoKeystatic NSString *const LookbackExperienceStartedAtUserInfoKey = @"com.thirdcog.lookback.notification.startedUploading.sessionStartedAt"; DiscussionUserInfo 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). LookbackRecordingAfterTimeoutOptionSettingsKeystatic NSString *const LookbackRecordingAfterTimeoutOptionSettingsKey = @"io.lookback.recording.afterTimeoutOption"; DiscussionThe 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. LookbackRecordingTimeoutSettingsKeystatic NSString *const LookbackRecordingTimeoutSettingsKey = @"io.lookback.recording.timeoutDuration"; DiscussionThe 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. LookbackScreenRecorderFramerateLimitKeystatic NSString *const LookbackScreenRecorderFramerateLimitKey = @"com.thirdcog.lookback.screenrecorder.fpsLimit"; DiscussionThe 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 LookbackShowPreviewSettingsKeystatic NSString *const LookbackShowPreviewSettingsKey = @"com.thirdcog.lookback.preview.enabled"; DiscussionThe 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. LookbackStartedUploadingNotificationNamestatic NSString *const LookbackStartedUploadingNotificationName = @"com.thirdcog.lookback.notification.startedUploading"; DiscussionWhen 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; } }]; TypedefsNS_ENUMtypedef NS_ENUM(NSInteger, LookbackTimeoutOption) { LookbackTimeoutImmediately = 0, LookbackTimeoutAfter1Minutes = 60, LookbackTimeoutAfter3Minutes = 180, LookbackTimeoutAfter5Minutes = 300, LookbackTimeoutAfter15Minutes = 900, LookbackTimeoutAfter30Minutes = 1800, LookbackTimeoutNever = NSIntegerMax, }; DiscussionStandard timeout options for LookbackRecordingTimeoutSettingsKey. Macro DefinitionsLookback_Weak#define Lookback_Weak DiscussionIf 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"]; |