一个简单的框架,可将您的应用反馈数据发送到 Atlassian Jira 实例。
获取 OCJiraFeedback 的支持方式是使用 CocoaPods。
将 OCJiraFeedback 添加到您的 Podfile
platform :ios, '7.0'
pod 'OCJiraFeedback'
将 OCJiraFeedback 添加到您的应用
#import <OCJiraFeedback/OCJiraFeedback.h>
为了配置与 Jira 实例的连接,在 main bundle 中添加和编辑一个 Instance.plist 文件。从这里获取模板版本
issueType 的有效值有 'Improvement', 'Bug' 或 'Task'。
您可以可选地导入 'OCJiraConfiguration' 头文件,并将这些值作为字典设置。
#import <OCJiraFeedback/OCJiraConfiguration.h>
OCJiraConfiguration.sharedConfiguration.configuration = @{
@"host" : @"hostname.example.com",
@"username" : @"jira_username",
@"password" : @"1234",
@"projectKey" : @"TEST",
@"issueType" : @"Bug"
}
收集摘要和描述字段
例如,从一个控制器内部实现的动作中获取,该控制器有两个 textfield 的出口:'summary' 和 'description'。
- (IBAction)sendFeedbackAction:(id)sender
{
NSString *summary = self.summaryField.text;
NSString *description = self.description.text;
[OCJiraFeedback feedbackWithSummary:summary
description:description
completion:^(NSError *error) {
if (error) {
// Handle error if exists
};
}];
// or with a creenshot of your current view
[OCJiraFeedback feedbackWithSummary:summary
description:description
view:self.view
completion:^(NSError *error) {
if (error) {
// Handle error if exists
}
}];
}