⚡️ Custom actions
We know that the built in actions (Bug reporting, Feature requests & Rating) might be not enough for certain use cases. For these situations we offer custom actions.

Configure a custom action

The first step with custom actions is to open the visual widget configurator and select "Custom action" as action type.
Now you need to set your custom action's name. This can be any name you'd like (it's important to check for the same name within the next step).

Custom action callback

Use the BugBattleDelegate in order to notice once a custom action gets triggered. If you use multiple custom actions, we suggest to check the triggered custom action's name in order to find out which custom action got triggered.
Import the BugBattle SDK and add the BugBattleDelegate so your ViewController implements the BugBattleDelegate.
Swift
Objective-C
1
import BugBattle
Copied!
1
#import <BugBattle/BugBattle.h>
2
3
@import UIKit;
4
5
@interface YourViewController : UIViewController <BugBattleDelegate>
6
7
@end
Copied!
Implement the customActionCalled method. This method will be called, once a custom action get's triggered. Simply check for the customAction name to identify which custom action got triggered.
Swift
Objective-C
1
extension DemoViewController: BugBattleDelegate {
2
func customActionCalled(_ customAction: String) {
3
NSLog(customAction)
4
}
5
}
Copied!
1
- (void)customActionCalled:(NSString *)customAction {
2
NSLog(@"%@", customAction);
3
}
Copied!
Last but not least, let Bugbattle know that you implemented the BugBattleDelegate.
Swift
Objective-C
1
BugBattle.sharedInstance().delegate = self // Assign the current self to the Bugbattle instance.
Copied!
1
BugBattle.sharedInstance.delegate = self; // Assign the current self to the Bugbattle instance.
Copied!
The custom action name gets defined by you within the visual widget configurator.
Last modified 3mo ago