{"category":{"version":"591f17ae21d2ff0f00cf5a3f","project":"547cd7662eaee50800ed1089","_id":"591f17af21d2ff0f00cf5a40","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-01T21:02:31.346Z","from_sync":false,"order":0,"slug":"start","title":"Get Started: Mac OS Apps"},"parentDoc":null,"project":"547cd7662eaee50800ed1089","user":"547cd6ac78fd57080023ca99","version":{"__v":1,"_id":"591f17ae21d2ff0f00cf5a3f","project":"547cd7662eaee50800ed1089","createdAt":"2017-05-19T16:05:02.775Z","releaseDate":"2017-05-19T16:05:02.775Z","categories":["591f17af21d2ff0f00cf5a40","591f17af21d2ff0f00cf5a41","591f17af21d2ff0f00cf5a42","591f17af21d2ff0f00cf5a43","591f17af21d2ff0f00cf5a44","591f17af21d2ff0f00cf5a45","591f17af21d2ff0f00cf5a46","591f17af21d2ff0f00cf5a47","591f17af21d2ff0f00cf5a48"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.1","version":"1.0.1"},"_id":"591f17b021d2ff0f00cf5a57","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-02-03T16:32:53.608Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"1. Take the steps described in [Integrate DevMateKit](doc:integrate-devmate-kit) if you haven't done it yet.\n2. Add the following code snippet to the `applicationDidFinishLaunching` method of your application delegate class:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[DevMateKit setupIssuesController:nil reportingUnhandledIssues:YES];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"DevMateKit.setupIssuesController(nil, reportingUnhandledIssues: true)\",\n      \"language\": \"swift\",\n      \"name\": \"Swift\"\n    }\n  ]\n}\n[/block]\n3. Build and run your application.\n\nTo test issue the reporting functionality, run the following command in the terminal:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<executable> [-test_crash [delay_sec]] [-test_exception [delay_sec]]\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nwhere:\n*   `<executable>` is a path to the main executable of your app (e.g., `<my_app_path>/MyApp.app/Contents/MacOS/MyApp`). You can drag and drop your application from Xcode to Terminal and add `MyApp.app/Contents/MacOS/MyApp`.\n*   `test_crash` is an argument to initiate crash.\n*   `test_exception` is an argument to initiate exception.\n*   `delay_sec` is time in seconds before an issue dialogue appear (don't specify to open an issue dialogue immediately).\n\nTo learn more, see an example on [GitHub](https://github.com/DevMate/DevMateKit/tree/master/Examples/IssuesExample).\n\n## Customization\nYou can automatically fill in 'Name' and 'Email' fields of an issue reporting dialog with the values specified by a user during activation. Also, you can add some predefined text to the problem description field. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \":::at:::property (nonatomic, retain) NSDictionary *defaultUserInfo;\\n \\nFOUNDATION_EXPORT NSString *const DMIssuesDefaultUserNameKey; // NSString\\nFOUNDATION_EXPORT NSString *const DMIssuesDefaultUserEmailKey; // NSString\\nFOUNDATION_EXPORT NSString *const DMIssuesDefaultCommentKey; // NSString\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nTo send a custom app log in an issue report to DevMate, specify URL to this log file(s).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"@property (nonatomic, retain) NSArray *logURLs;\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nTo track the relaunch of an application after crash, pass an object that implements the `reporterWillRestartApplication` method as delegate for the issue controller.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"@protocol DMIssuesControllerDelegate <NSObject>\\n@optional\\n- (void)reporterWillRestartApplication:(DMIssuesController *)controller;\\n@end\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nTo customize the UI, you need to subclass `DMIssuesWindowController` class and set it to the main controller using the `-[DMIssuesController setIssuesWindowControllerClass:]` method.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To ensure correct work of the issue reporter, implement `DMIssuesWindowController` subclass and all other resources/classes in a separate framework.\",\n  \"title\": \"NOTE\"\n}\n[/block]","excerpt":"","slug":"issues","type":"basic","title":"Issues"}
1. Take the steps described in [Integrate DevMateKit](doc:integrate-devmate-kit) if you haven't done it yet. 2. Add the following code snippet to the `applicationDidFinishLaunching` method of your application delegate class: [block:code] { "codes": [ { "code": "[DevMateKit setupIssuesController:nil reportingUnhandledIssues:YES];", "language": "objectivec" }, { "code": "DevMateKit.setupIssuesController(nil, reportingUnhandledIssues: true)", "language": "swift", "name": "Swift" } ] } [/block] 3. Build and run your application. To test issue the reporting functionality, run the following command in the terminal: [block:code] { "codes": [ { "code": "<executable> [-test_crash [delay_sec]] [-test_exception [delay_sec]]", "language": "text" } ] } [/block] where: * `<executable>` is a path to the main executable of your app (e.g., `<my_app_path>/MyApp.app/Contents/MacOS/MyApp`). You can drag and drop your application from Xcode to Terminal and add `MyApp.app/Contents/MacOS/MyApp`. * `test_crash` is an argument to initiate crash. * `test_exception` is an argument to initiate exception. * `delay_sec` is time in seconds before an issue dialogue appear (don't specify to open an issue dialogue immediately). To learn more, see an example on [GitHub](https://github.com/DevMate/DevMateKit/tree/master/Examples/IssuesExample). ## Customization You can automatically fill in 'Name' and 'Email' fields of an issue reporting dialog with the values specified by a user during activation. Also, you can add some predefined text to the problem description field. [block:code] { "codes": [ { "code": "@property (nonatomic, retain) NSDictionary *defaultUserInfo;\n \nFOUNDATION_EXPORT NSString *const DMIssuesDefaultUserNameKey; // NSString\nFOUNDATION_EXPORT NSString *const DMIssuesDefaultUserEmailKey; // NSString\nFOUNDATION_EXPORT NSString *const DMIssuesDefaultCommentKey; // NSString", "language": "objectivec" } ] } [/block] To send a custom app log in an issue report to DevMate, specify URL to this log file(s). [block:code] { "codes": [ { "code": "@property (nonatomic, retain) NSArray *logURLs;", "language": "objectivec" } ] } [/block] To track the relaunch of an application after crash, pass an object that implements the `reporterWillRestartApplication` method as delegate for the issue controller. [block:code] { "codes": [ { "code": "@protocol DMIssuesControllerDelegate <NSObject>\n@optional\n- (void)reporterWillRestartApplication:(DMIssuesController *)controller;\n@end", "language": "objectivec" } ] } [/block] To customize the UI, you need to subclass `DMIssuesWindowController` class and set it to the main controller using the `-[DMIssuesController setIssuesWindowControllerClass:]` method. [block:callout] { "type": "info", "body": "To ensure correct work of the issue reporter, implement `DMIssuesWindowController` subclass and all other resources/classes in a separate framework.", "title": "NOTE" } [/block]