SCFeedback 1.0.1

SCFeedback 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2018 年 1 月

Aevit 维护。



  • 作者:
  • Aevit

适用于 iOS 的 In-App 反馈(Instabug 的简化版)

  • 内嵌录制视频
  • 截图并使用标记或马赛克绘制

演示

演示视频

或下载视频(1.7MB)

要求

  • iOS 7.0 或更高版本
  • Xcode 8.0 或更高版本

使用方法

简单使用

  • microphonephotoLibrary 权限添加到 info.plist
<dict>
...
	
	<key>NSMicrophoneUsageDescription</key>
	<string>需要您的同意,才能访问麦克风</string>
	
	<key>NSPhotoLibraryUsageDescription</key>
	<string>需要您的同意,才能访问相册</string>
	
...
</dict>
  • 导入头文件,然后设置块以发送反馈内容(图像/视频/文本)
#import <SCFeedback/SCFeedbackManager.h>

[[SCFeedbackManager sharedManager] setupSendInfoBlock:^(UIViewController *editInfoController, NSArray<SCFbMediaInfo *> *dataArray, NSString *text) {
	// Hey, do something here, such as to compress the images and upload the data
}];

您可以根据需要添加上面的代码,例如在 AppDelegate.m 或您自定义的文件中。

SCFbMediaInfo 是一个 ClassCluster,您可以通过以下方式获取图像或视频 URL

// SCFbMediaInfo *info = dataArray[0];

UIImage *image = [info image];

NSURL *fileUrl = [info videoFileUrl];
  • 摇动设备使用

自定义

您可以使用文件 SCFeedbackManager.h 中的属性和 API 进行一些自定义 —— 只需滚动到文件底部,您会发现更多 :)

显示编辑信息控制器

您可以不添加任何内容,直接显示编辑信息控制器

[[SCFeedbackManager sharedManager] gotoEditWithMediaInfo:nil];

禁用 shake 动作

当您摇动设备时,将显示一个警告,如果想要禁用该警告,请按照以下代码进行操作:

[[SCFeedbackManager sharedManager] enableShake:NO];

内嵌录制

视频

您可以通过 [SCFeedbackManager sharedManager].screenRecorder 的属性和 API 以自定义的方式做些操作(设置视频的帧率,设置视频的输出 URL 等)

SCScreenRecorder.h

有一个协议可以在视频录制完成后获取视频文件 URL 和封面图像

[SCFeedbackManager sharedManager].delegate = self;

- (void)scFeedback:(SCFeedbackManager *)manager didSaveRecordingVideoUrl:(NSURL *)fileUrl coverImage:(UIImage *)coverImage {
    
}

音频

您可以通过 [SCFeedbackManager sharedManager].audioManager 的属性和 API 进行一些自定义操作

SCAudioManager.h

捕获屏幕

如果您想自定义右上角按钮的下一步动作,请使用SCFeedbackDelegate

[SCFeedbackManager sharedManager].delegate = self;

- (void)scFeedback:(SCFeedbackManager *)manager didShowDrawerController:(SCDrawerViewController *)controller {
    controller.isCustomNextStep = YES;
    controller.completeBlock = ^(UIImage *image) {
        // do something with the image
    };
}

文本

您可以通过这种方法来更改警报和textview的占位符文本

[SCFeedbackManager sharedManager].customInfo[scInfo_drawer_title] = @"Drawer title";

以下customInfo的键可以用于更改文本(您可以在文件SCFeedbackManager.h中找到它们)

extern NSString *const scInfo_drawer_title; // SCEditInfoViewController's title

extern NSString *const scInfo_editInfo_title; // SCEditInfoViewController's title
extern NSString *const scInfo_editInfo_placeholder; // SCEditInfoViewController, placeholder of textview
extern NSString *const scInfo_editInfo_beyondNumTitle; // SCEditInfoViewController, title of alert when the number of attachments is out of 4
extern NSString *const scInfo_editInfo_beyondNumMsg; // SCEditInfoViewController, message of alert when the number of attachments is out of 4
extern NSString *const scInfo_editInfo_beyondNumCancel; // SCEditInfoViewController, cancel button text of alert when the number of attachments is out of 4

extern NSString *const scInfo_shake_title; // title of alert after shaking
extern NSString *const scInfo_shake_msg; // message of alert after shaking
extern NSString *const scInfo_shake_capture; // capture button text of alert after shaking
extern NSString *const scInfo_shake_record; // record button text of alert after shaking
extern NSString *const scInfo_shake_closeShake; // close shaken button text of alert after shaking
extern NSString *const scInfo_shake_cancel; // cancel button text of alert after shaking

覆盖按钮

您可以像这样显示或隐藏右下角的覆盖按钮

// for in-app recording
[[SCFeedbackManager sharedManager] showOverlayBtnWithtype:SCFbOverlayTypeRecorder];

// for capture screen
[[SCFeedbackManager sharedManager] showOverlayBtnWithtype:SCFbOverlayTypeCapture];

// hide
[[SCFeedbackManager sharedManager] hideOverlayBtn];

默认视频路径

默认路径是'Library/Caches/scrcd_{yyyyMMdd_HHmmss}.mp4',您可以使用属性更改路径
[[SCFeedbackManager sharedManager].screenRecorder.outputURL.

您可以使用[SCFeedbackManager sharedManager]的API显示所有视频和音频文件

/**
 show the video saved in the sanbox

 @param folder the files in the folder will be shown, if it is nil or empty, will find the default folder
 */
- (void)showFileListWithFolder:(NSString*)folder;

感谢

KTouchPointerWindow

许可协议

本代码在MIT许可的条款和条件下分发。