Home screen
Shake enables you to customize home screen according to your preferences and needs.
Setting up custom actions
By default, Home screen shows Submit new ticket button and New chat button at the top of the screen. If you want, you can extend or customize these buttons using the custom actions.
There are several types of actions you can set on the home screen:
- Custom action - tap on the custom action executes a custom function
- Submit new ticket action - tap on the submit new ticket action start a new ticket screen
- Start a new chat action - tap on the new chat action starts a chat screen
note
Start a new chat action won't be visible if your app user is not registered.
Here's an example how you can set custom actions on the home screen:
- Objective-C
- Swift
AppDelegate.m
- (void)setShakeHomeActions {SHKHomeAction *customAction = [[SHKHomeAction alloc] initWithTitle:@"Visit our roadmap"subtitle:@"Feel free to send us suggestion"icon:[UIImage imageNamed:@"customImage"]handler:^{// Open URL/// Watch for retain cycles, weakly reference the variables in this closure}];SHKHomeSubmitAction *submitAction = [[SHKHomeSubmitAction alloc] initWithTitle:@"Submit a new ticket"subtitle:@"Tap on the button to submit us a new ticket"icon:[UIImage imageNamed:@"newTicket"]];SHKHomeChatAction *chatAction = [[SHKHomeChatAction alloc] initWithTitle:@"Start a new chat"subtitle:@"Tap on the button to start a live chat"icon:[UIImage imageNamed:@"newChat"]];SHKShake.configuration.homeActions = @[customAction, submitAction, chatAction];}
AppDelegate.swift
func setShakeHomeAction() {let customAction = SHKHomeAction(title: "Visit our roadmap", subtitle: "Feel free to send us suggestion", icon: UIImage(named: "customImage")) {// Open URL/// Watch for retain cycles, weakly reference the variables in this closure}let submitAction = SHKHomeSubmitAction(title: "Submit a new ticket", subtitle: "Tap on the button to submit us a new ticket", icon: UIImage(named: "newTicket"))let chatAction = SHKHomeChatAction(title: "Start a new chat", subtitle: "Tap on the button to start a live chat", icon: UIImage(named: "newChat"))Shake.configuration.homeActions = [customAction, submitAction, chatAction]}
Changing the home screen subtitle
If you want to change subtitle message on the home screen, you can do it using the following method:
- Objective-C
- Swift
AppDelegate.m
SHKShake.configuration.homeSubtitle = @"Feel free to submit your bug reports, suggestions and questions to us.";
AppDelegate.swift
Shake.configuration.homeSubtitle = "Feel free to submit your bug reports, suggestions and questions to us."