Record videos into a liveblog

Login manager and authentication

To add this functionality you need to add the TickarooWriteSDK pod in the podfile. You can do it by inserting te following line where applicable:

pod 'TickarooWriteSDK'

To enable the Write mode you need to conform to the TickarooSDKLoginManager protocol and set the login manager of the TickarooSDK. Please set the login manager after you initialize the TickarooSDK.

Objective-C

[TickarooSDK setLoginManager:yourLoginManager];

Swift

TickarooSDK.loginManager = yourLoginManager

Your TickarooSDKLoginManager needs to implement the following method:

- (void)requestLogin:(void (^)(NSString* username, NSString* userId, NSString* accessToken))callback;

This method will be called by TickarooSDK when login is needed. When called, you need to authenticate the user and call the provided callback with the user credentials (username, userId and accessToken).

TickarooSDKLoginManager example

Objective-C

- (void)requestLogin:(void (^)(NSString *, NSString *, NSString *))completion {
    // Get a valid user
    
    ...
    
    completion(user.username, user.userId, user.accessToken);
}

Swift

func requestLogin(_ completion: ((String?, String?, String?) -> Void)!) {    
    // Get a valid user
    
    ...
        
    completion(user.username, user.userId, user.accessToken)
}

The credentials will be saved in TickarooSDK automatically and will be requested again if they are not valid anymore or if you logout the user.

You can logout the user anytime by calling the +(void)logout; function.

Display videoclips screen.

To initialize and display a videoclips screen you need to create a VideoClipRef (TApiTickerWriteVideoClipRef), assign the id of your ticker to the localId property. Then, similar to the Liveblog screen you need to retrive a view controller from the SDK and present it. The videoclips ref needs to be presented modally (not navigate to it in a navigation controller).

Here is an example:

Objective-C

- (void)showVideoClips:(NSString *)tickerId {
    TApiTickerWriteVideoClipRef *ref = TApiTickerWriteVideoClipRef.new;
    ref.localId = tickerId;
    
    [TickarooSDK requestViewControllerForRef:ref callback:^(UIViewController<TickarooSDKController> *vc) {
        [self presentViewController:vc animated:YES completion:nil];
    }];
}

Swift

@objc private func showVideo(with id: String) {
    let ref = TApiTickerWriteVideoRef()
    ref.localId = id
    TickarooSDK.requestViewController(for: ref) { [weak self] vc in
        vc.map {
            self?.present($0, animated: true, completion: nil)
        }
    }
}