评论 快速集成

1 产品概述

通过评论组件,用户可以针对应用中一篇文章,一首歌曲等内容发表评论,并可同步到微博。喜欢组件会增强用户和应用的交互频率,提高用户的活跃率和留存率。

2 下载并安装SDK

Step1

下载 最新版SDK

Step2

确认你使用的XCode版本在4.4以上,工程的Base SDK和iOS Deployment Target在iOS4.3以上

Step3

解压SDK压缩包,将其中形如UMSocial_Sdk_x.x.x的文件夹拖入工程目录:

alt text

Step4

确认勾选了“Copy items to destination's group folder”选项,并选择你要添加到的Target:

alt text

现在应该是这样的效果:

alt text

3 集成代码

设置友盟Appkey

#import "UMSocial.h"
……
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [UMSocialData setAppKey:@"507fcab25270157b37000010"];
}

得到一个评论列表

#import UMSocialControllerServiceComment.h
……
UINavigationController *commentList = [[UMSocialControllerServiceComment defaultControllerService] getSocialCommentListController];
[self presentModalViewController:commentList animated:YES];

socialbar

[UMSocialData defaultData].commentText = @"评论内嵌文字";
[UMSocialData defaultData].commentImage = [UIImage imageNamed:@"icon.png"];

4 进阶使用

如果上述文档不能满足你的需求,请移步至“详细集成文档”。