Callbacks
Execute a block of a code when a certain action is executed by Shake
Shake open callback
If you want to perform an action when Shake interface is opened, you can do it like shown below:
- Objective-C
- Swift
AppDelegate.m
SHKShake.configuration.shakeOpenListener = ^() {NSLog(@"Shake open event");};
AppDelegate.swift
Shake.configuration.shakeOpenListener = {print("Shake opened event")}
Shake dismiss callback
If you want to perform an action when Shake interface is closed, you can do it like shown below:
- Objective-C
- Swift
AppDelegate.m
SHKShake.configuration.shakeDismissListener = ^() {NSLog(@"Shake dismiss event");};
AppDelegate.swift
Shake.configuration.shakeDismissListener = {print("Shake dismiss event")}
Shake submit callback
To detect when user pressed a submit button on the New ticket screen, add a submit listener like in the example below.
This listener provides type and fields parameters:
- type: NSString - "crash" or "feedback" depending on the type of the ticket
- fields: NSDictionary - key value pairs of submitted form fields
- Objective-C
- Swift
AppDelegate.m
SHKShake.configuration.shakeSubmitListener = ^(NSString* type, NSDictionary* fields) {NSLog(@"Shake submit event");};
AppDelegate.swift
Shake.configuration.shakeSubmitListener = { type, fields inprint("Shake submit event")}