iOS集成阿里百川用户反馈功能及给app评分

用户反馈功能几乎是每个app都有的一个功能点,通过反馈功能实现与用户的连接、沟通,随时随地收集用户意见反馈和Bug报告,即时和用户保持沟通,在一定程度上提升了app的竞争力。而给app评分也是一个常见的功能。接下来和大家分享如何在自己的工程中集入阿里百川的用户反馈模块,另外介绍如何实现对app的评分功能。

一、用户反馈功能
1.首先需要到阿里百川申请appkey.同时生成自己需要的SDK并下载下来,将SDK导入到自己的工程中,另外将阿里百川的demo下载下来,把里面的TWMessageBarManager包也导入自己的工程中。

2.在工程中添加以下的依赖库:

UIKit.framework
AddressBook.framework
SystemConfiguration.framework
CoreLocation.framework
CoreTelephony.framework
CoreData.framework
libz.tbd
libstdc++.6.0.9.tbd
MobileCoreServices.framework
ImageIO.framework
AudioToolbox.framework
AVFoundation.framework
AssetsLibrary.framework
CoreMotion.framework

3.导入头文件

#import 
#import "TWMessageBarManager.h"

4.实现反馈功能

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"意见反馈与给app评分";
    self.view.backgroundColor = [UIColor whiteColor];
//    在阿里百川申请的appkey
    self.appKey = @"appkey";
    self.environment = YWEnvironmentRelease;
    
    UIButton *feedbackButton = [UIButton buttonWithType:UIButtonTypeSystem];
    feedbackButton.frame = CGRectMake(100, 150, 100, 50);
    [self.view addSubview:feedbackButton];
    [feedbackButton setTitle:@"意见反馈" forState:UIControlStateNormal];
    [feedbackButton addTarget:self action:@selector(actionOpenFeedback) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *markButton = [UIButton buttonWithType:UIButtonTypeSystem];
    markButton .frame = CGRectMake(100, 200, 100, 50);
    [self.view addSubview:markButton];
    [markButton setTitle:@"评分" forState:UIControlStateNormal];
    [markButton addTarget:self action:@selector(markButtonAction) forControlEvents:UIControlEventTouchUpInside];
    // Do any additional setup after loading the view, typically from a nib.
}
#pragma mark -- 调起意见反馈
- (void )actionOpenFeedback{
    self.tabBarController.tabBar.hidden = YES;
    
    self.appKey = @"appkey";
    
    self.feedbackKit = [[YWFeedbackKit alloc] initWithAppKey:self.appKey];
    
    _feedbackKit.environment = self.environment;
    
#warning 设置App自定义扩展反馈数据
    _feedbackKit.extInfo = @{@"loginTime":[[NSDate date] description],
                             @"visitPath":@"登陆->关于->反馈",
                             @"应用自定义扩展信息":@"开发者可以根据需要设置不同的自定义信息,方便在反馈系统中查看"};
#warning 自定义反馈页面配置
    _feedbackKit.customUIPlist = [NSDictionary dictionaryWithObjectsAndKeys:@"/te\'st\\Value1\"", @"testKey1", @"test
                    
                    

你可能感兴趣的:(iOS集成阿里百川用户反馈功能及给app评分)