Callbacks and Delegates
Delegates
fullstoryDidStartSession
gets invoked once Fullstory has been fully initialized and has started the capture.
fullstoryDidStopSession
gets invoked when Fullstory has been shutdown (by calling [FS shutdown])
fullstoryDidTerminateWithError
gets invoked when Fullstory has been terminated due to an error
Additional Information
- Objective-C
- Swift
@protocol FSDelegate <NSObject>
- (void)fullstoryDidStartSession:(NSString *)sessionUrl;
- (void)fullstoryDidTerminateWithError:(NSError *)error;
- (void)fullstoryDidStopSession;
@end
Example Invocation
// File: Appdelegate.m
// Set the FS delegate in `didFinishLaunchingWithOptions`
FS.delegate = self;
// Implement the optional methods
- (void)fullstoryDidTerminateWithError:(NSError *)error {
NSLog(@"Fullstory did terminate: %@", error);
}
- (void)fullstoryDidStartSession:(NSString *)sessionUrl {
NSLog(@"Fullstory did start session with URL %@", sessionUrl);
}
- (void)fullstoryDidStopSession {
NSLog(@"Fullstory has stopped session");
}
protocol FSDelegate: NSObject {
func fullstoryDidStartSession(_ sessionUrl: String)
func fullstoryDidStopSession()
func fullstoryDidTerminateWithError(_ error: Error)
}
@end
Example Invocation
// File: AppDelegate.swift
import UIKit
import FullStory
@main
class AppDelegate: UIResponder, UIApplicationDelegate, FSDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Set the FS delegate in `didFinishLaunchingWithOptions`
FS.delegate = self
return true
}
// Implement the optional methods
func fullstoryDidStartSession(_ sessionUrl: String) {
print("Fullstory did start session with URL " + sessionUrl)
}
func fullstoryDidStopSession() {
print("Fullstory has stopped session")
}
func fullstoryDidTerminateWithError(_ error: Error) {
print("Fullstory did terminate with error: " + error.localizedDescription)
}
}