友盟统计和友盟反馈的添加
来源:互联网 发布:迅雷网络加速器手机版 编辑:程序博客网 时间:2024/06/04 20:04
一 、友盟统计的添加
要在appdelegate里面导入文件
#import "MobClick.h"
- (NSString *)appKey
{
return UMENG_APPKEY;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//其他的添加内容
......
//添加友盟统计
[MobClick setDelegate:self reportPolicy:BATCH];
[MobClick setLogEnabled:YES];
}
- (void)applicationWillResignActive:(UIApplication *)application
{
[MobClick appTerminated];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[MobClick setDelegate:self];
[MobClick appLaunched];
}
- (void)applicationWillTerminate:(UIApplication *)application
{
[MobClick appTerminated];
}
导入#import "UMFeedback.h",以及添加代理
UMFeedbackDataDelegate
在相应的.m文件里面加入
//添加友盟反馈
[UMFeedback setLogEnabled:YES];
[UMFeedback checkWithAppkey:UMENG_APPKEY];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(umCheck:) name:UMFBCheckFinishedNotification object:nil];
在点击实现的方法里面添加
[UMFeedback showFeedback:self withAppkey:UMENG_APPKEY];
- (void)umCheck:(NSNotification *)notification {
// UIAlertView *fanKuiAlertView;
if (notification.userInfo) {
NSArray *newReplies = [notification.userInfo objectForKey:@"newReplies"];
NSLog(@"newReplies = %@", newReplies);
NSString *title = [NSString stringWithFormat:@"有%d条新回复", [newReplies count]];
NSMutableString *content = [NSMutableString string];
for (NSUInteger i = 0; i < [newReplies count]; i++) {
NSString *dateTime = [[newReplies objectAtIndex:i] objectForKey:@"datetime"];
NSString *_content = [[newReplies objectAtIndex:i] objectForKey:@"content"];
[content appendString:[NSString stringWithFormat:@"%d .......%@.......\r\n", i + 1, dateTime]];
[content appendString:_content];
[content appendString:@"\r\n\r\n"];
}
fanKuiAlertView = [[UIAlertView alloc] initWithTitle:title message:content delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"查看", nil];
if ([[UIDevice currentDevice].systemVersion floatValue] < 7.0f) {
((UILabel *) [[fanKuiAlertView subviews] objectAtIndex:1]).textAlignment = NSTextAlignmentLeft;
}
} else {
fanKuiAlertView = [[UIAlertView alloc] initWithTitle:@"没有新回复" message:nil delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil];
}
[fanKuiAlertView show];
}
把这些添加之后就可以进入友盟的客户端的用户反馈信息界面,这时候登录友盟的网页信息,可以看到用户的反馈信息,当开发者在此回复的时候,客户就可以在自己的反馈界面实现弹出回复信息提示。
这样友盟的统计和反馈都添加完毕了。
}{}}
}}}}}}
}
- 友盟统计和友盟反馈的添加
- 友盟统计的用户反馈api的使用
- 友盟SDK应用(二)------友盟统计及用户反馈
- 添加友盟统计
- 利用友盟在自己项目中添加反馈功能
- 友盟用户反馈
- COCOS2D-X编译成安卓APP添加友盟统计和百度广告的代码示例
- 友盟用户反馈集成中遇到的问题
- 友盟统计添加之后页面出现 "站长统计"
- Android应用中添加友盟统计
- 友盟用户反馈自定义UI-Android
- 友盟反馈界面效果实现
- 电流反馈和电压反馈的判断
- 项目产品化:添加友盟统计(Android和IOS)
- 最近上传了一个自编的统计程序,欢迎大家使用和反馈
- 开发后期在各个页面中添加友盟统计
- 友盟意见反馈——对话框改为单一的用户反馈
- 友盟意见反馈——对话框改为单一的用户反馈
- mysql数据库的左连接,右连接,内链接。有何区别
- 遇到一个<iostream>引发的非常难缠的连接错误LNK2001
- Arm 系统中常用的段分类说明
- 编程相关的缩略词
- poj 3268
- 友盟统计和友盟反馈的添加
- 圣诞偶感
- error LNK2001: unresolved external symbol "private: static
- 动态共享库 延迟绑定
- 黑马程序员_winform
- 0-1背包问题
- 从现在开始吧
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- osg demo7 close a node osg::switch