Skip to content
Dmytro edited this page Apr 13, 2021 · 7 revisions

1. Add the following method to your application delegate class implementation:

- (IBAction)showFeedbackDialog:(id)sender {
    [DevMateKit showFeedbackDialog:nil inMode:DMFeedbackDefaultMode];
}

For Swift projects:

@IBAction func showFeedbackDialog(sender: AnyObject?)  {
    DevMateKit.showFeedbackDialog(nil, inMode: DMFeedbackMode.DefaultMode)
}

2. Connect action method you just added with corresponding menu item or button inside your XIB files.

3. Build and run your application. Send a feedback message as you defined in previous step. If everything was done correctly, your message will be displayed in Feedback Management section of DevMate.

Customization

Set customer's name and email as you send feedback. For example, if your application requests for customer's name and email during registration, you can use this info for issue report and that will help to identify customer more quickly. Also, you can add some predefined text into the message window.

@property (nonatomic, retain) NSDictionary *defaultUserInfo;
 
FOUNDATION_EXPORT NSString *const DMFeedbackDefaultUserNameKey; // NSString object
FOUNDATION_EXPORT NSString *const DMFeedbackDefaultUserEmailKey; // NSString object
FOUNDATION_EXPORT NSString *const DMFeedbackDefaultCommentKey; // NSString object

If you use your custom app log, it can be sent to DevMate within feedback message by specifying URL to this log file(s).

@property (nonatomic, retain) NSArray *logURLs;

Also you can select the feedback window behavior to:

  • independent (by default)
  • child
  • modal
  • sheet
  • floating

by setting the desired DMFeedbackMode during the method call.

In addition, you can set up some action after the feedback message was sent like in example below.

- (IBAction)showFeedbackDialog:(id)sender {
    DMFeedbackController *controller = [DMFeedbackController sharedController];
    [controller showFeedbackWindowInMode:DMFeedbackDefaultMode completionHandler:^(BOOL success) {
        NSLog(@"Did finish feedback with success: %@", success ? @"TRUE" : @"FALSE");
    }];
}

For Swift projects:

@IBAction func showFeedbackDialog(sender: AnyObject?) {
    let controller = DMFeedbackController.sharedController()
    controller.showFeedbackWindowInMode(DMFeedbackMode.DefaultMode) { (success) -> Void in
        let message = success ? "TRUE" : "FALSE"
        print("Did finish feedback with success: \(message)")
    }
}

After sending a feedback user will get a console message 'Did finish feedback with success: TRUE' if feedback was successfully sent and 'Did finish feedback with success: FALSE' otherwise.

Clone this wiki locally