补充遗漏的目录

This commit is contained in:
2018-03-06 17:02:11 +08:00
parent 681ba54739
commit cb01ac2be9
5 changed files with 535 additions and 0 deletions
+77
View File
@@ -0,0 +1,77 @@
//
// DplusMobClick.h
// Analytics
//
// Copyright (C) 2010-2016 Umeng.com . All rights reserved.
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface DplusMobClick : NSObject
/** Dplus增加事件
@param eventName 事件名
@param property 自定义属性
*/
+(void) track:(NSString *)eventName;
+(void) track:(NSString *)eventName property:(NSDictionary *) property;
/**
* 设置属性 键值对 会覆盖同名的key
* 将该函数指定的key-value写入dplus专用文件;APP启动时会自动读取该文件的所有key-value,并将key-value自动作为后续所有track事件的属性。
*/
+(void) registerSuperProperty:(NSDictionary *)property;
/**
*
* 从dplus专用文件中删除指定key-value
@param key
*/
+(void) unregisterSuperProperty:(NSString *)propertyName;
/**
*
* 返回dplus专用文件中key对应的value;如果不存在,则返回空。
@param key
@return void
*/
+(NSString *)getSuperProperty:(NSString *)propertyName;
/**
* 返回Dplus专用文件中的所有key-value;如果不存在,则返回空。
*/
+(NSDictionary *)getSuperProperties;
/**
*清空Dplus专用文件中的所有key-value。
*/
+(void)clearSuperProperties;
/**
* 设置预置事件属性 键值对 会覆盖同名的key
*/
+(void) registerPreProperties:(NSDictionary *)property;
/**
*
* 删除指定预置事件属性
@param key
*/
+(void) unregisterPreProperty:(NSString *)propertyName;
/**
* 获取预置事件所有属性;如果不存在,则返回空。
*/
+(NSDictionary *)getPreProperties;
/**
*清空所有预置事件属性。
*/
+(void)clearPreProperties;
/**
* 设置关注事件是否首次触发,只关注eventList前五个合法eventID.只要已经保存五个,此接口无效
*/
+(void)setFirstLaunchEvent:(NSArray *)eventList;
@end
+214
View File
@@ -0,0 +1,214 @@
//
// MobClick.h
// Analytics
//
// Copyright (C) 2010-2017 Umeng.com . All rights reserved.
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
typedef void(^CallbackBlock)();
/**
统计的场景类别,默认为普通统计;若使用游戏统计API,则需选择游戏场景类别,如E_UM_GAME。
*/
typedef NS_ENUM (NSUInteger, eScenarioType)
{
E_UM_NORMAL = 0, // default value
E_UM_GAME = 1, // game
E_UM_DPLUS = 4 // DPlus
};
@class CLLocation;
@interface MobClick : NSObject <UIAlertViewDelegate>
#pragma mark basics
///---------------------------------------------------------------------------------------
/// @name 设置
///---------------------------------------------------------------------------------------
/** 设置 统计场景类型,默认为普通应用统计:E_UM_NORMAL
@param 游戏统计必须设置为:E_UM_GAME.
@return void.
*/
+ (void)setScenarioType:(eScenarioType)eSType;
/** 开启CrashReport收集, 默认YES(开启状态).
@param value 设置为NO,可关闭友盟CrashReport收集功能.
@return void.
*/
+ (void)setCrashReportEnabled:(BOOL)value;
#pragma mark event logs
///---------------------------------------------------------------------------------------
/// @name 页面计时
///---------------------------------------------------------------------------------------
/** 手动页面时长统计, 记录某个页面展示的时长.
@param pageName 统计的页面名称.
@param seconds 单位为秒,int型.
@return void.
*/
+ (void)logPageView:(NSString *)pageName seconds:(int)seconds;
/** 自动页面时长统计, 开始记录某个页面展示时长.
使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
@param pageName 统计的页面名称.
@return void.
*/
+ (void)beginLogPageView:(NSString *)pageName;
/** 自动页面时长统计, 结束记录某个页面展示时长.
使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
@param pageName 统计的页面名称.
@return void.
*/
+ (void)endLogPageView:(NSString *)pageName;
///---------------------------------------------------------------------------------------
/// @name 事件统计
///---------------------------------------------------------------------------------------
/** 自定义事件,数量统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID
@param eventId 网站上注册的事件Id.
@param label 分类标签。不同的标签会分别进行统计,方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签.
@param accumulation 累加值。为减少网络交互,可以自行对某一事件ID的某一分类标签进行累加,再传入次数作为参数。
@return void.
*/
+ (void)event:(NSString *)eventId; //等同于 event:eventId label:eventId;
/** 自定义事件,数量统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID
*/
+ (void)event:(NSString *)eventId label:(NSString *)label; // label为nil或@""时,等同于 event:eventId label:eventId;
/** 自定义事件,数量统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID
*/
+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes;
+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes counter:(int)number;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
beginEvent,endEvent要配对使用,也可以自己计时后通过durations参数传递进来
@param eventId 网站上注册的事件Id.
@param label 分类标签。不同的标签会分别进行统计,方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签.
@param primarykey 这个参数用于和event_id一起标示一个唯一事件,并不会被统计;对于同一个事件在beginEvent和endEvent 中要传递相同的eventId 和 primarykey
@param millisecond 自己计时需要的话需要传毫秒进来
@return void.
@warning 每个event的attributes不能超过10个
eventId、attributes中key和value都不能使用空格和特殊字符,必须是NSString,且长度不能超过255个字符(否则将截取前255个字符)
id, ts, du是保留字段,不能作为eventId及key的名称
*/
+ (void)beginEvent:(NSString *)eventId;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)endEvent:(NSString *)eventId;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)beginEvent:(NSString *)eventId label:(NSString *)label;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)endEvent:(NSString *)eventId label:(NSString *)label;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)beginEvent:(NSString *)eventId primarykey :(NSString *)keyName attributes:(NSDictionary *)attributes;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)endEvent:(NSString *)eventId primarykey:(NSString *)keyName;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)event:(NSString *)eventId durations:(int)millisecond;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)event:(NSString *)eventId label:(NSString *)label durations:(int)millisecond;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes durations:(int)millisecond;
#pragma mark - user methods
/** active user sign-in.
使用sign-In函数后,如果结束该PUID的统计,需要调用sign-Off函数
@param puid : user's ID
@param provider : 不能以下划线"_"开头,使用大写字母和数字标识; 如果是上市公司,建议使用股票代码。
@return void.
*/
+ (void)profileSignInWithPUID:(NSString *)puid;
+ (void)profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider;
/** active user sign-off.
停止sign-in PUID的统计
@return void.
*/
+ (void)profileSignOff;
///---------------------------------------------------------------------------------------
/// @name 地理位置设置
/// 需要链接 CoreLocation.framework 并且 #import <CoreLocation/CoreLocation.h>
///---------------------------------------------------------------------------------------
/** 设置经纬度信息
@param latitude 纬度.
@param longitude 经度.
@return void
*/
+ (void)setLatitude:(double)latitude longitude:(double)longitude;
/** 设置经纬度信息
@param location CLLocation 经纬度信息
@return void
*/
+ (void)setLocation:(CLLocation *)location;
///---------------------------------------------------------------------------------------
/// @name Utility函数
///---------------------------------------------------------------------------------------
/** 判断设备是否越狱,依据是否存在apt和Cydia.app
*/
+ (BOOL)isJailbroken;
/** 判断App是否被破解
*/
+ (BOOL)isPirated;
/** 设置 app secret
@param secret string
@return void.
*/
+ (void)setSecret:(NSString *)secret;
+ (void)setCrashCBBlock:(CallbackBlock)cbBlock;
/** DeepLink事件
@param link 唤起应用的link
@return void.
*/
+ (void)onDeepLinkReceived:(NSURL *)link;
@end
@@ -0,0 +1,184 @@
//
// MobClickGameAnalytics.h
// Analytics
//
// Copyright (C) 2010-2014 Umeng.com . All rights reserved.
@interface MobClickGameAnalytics : NSObject
#pragma mark - account function
/** active user sign-in.
使用sign-In函数后,如果结束该PUID的统计,需要调用sign-Off函数
@param puid : user's ID
@param provider : 不能以下划线"_"开头,使用大写字母和数字标识; 如果是上市公司,建议使用股票代码。
@return void.
*/
+ (void)profileSignInWithPUID:(NSString *)puid;
+ (void)profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider;
/** active user sign-off.
停止sign-in PUID的统计
@return void.
*/
+ (void)profileSignOff;
#pragma mark GameLevel methods
///---------------------------------------------------------------------------------------
/// @name set game level
///---------------------------------------------------------------------------------------
/** 设置玩家的等级.
*/
/** 设置玩家等级属性.
@param level 玩家等级
@return void
*/
+ (void)setUserLevelId:(int)level;
///---------------------------------------------------------------------------------------
/// @name 关卡统计
///---------------------------------------------------------------------------------------
/** 记录玩家进入关卡,通过关卡及失败的情况.
*/
/** 进入关卡.
@param level 关卡
@return void
*/
+ (void)startLevel:(NSString *)level;
/** 通过关卡.
@param level 关卡,如果level == nil 则为当前关卡
@return void
*/
+ (void)finishLevel:(NSString *)level;
/** 未通过关卡.
@param level 关卡,如果level == nil 则为当前关卡
@return void
*/
+ (void)failLevel:(NSString *)level;
#pragma mark -
#pragma mark Pay methods
///---------------------------------------------------------------------------------------
/// @name 支付统计
///---------------------------------------------------------------------------------------
/** 记录玩家交易兑换货币的情况
@param currencyAmount 现金或等价物总额
@param currencyType 为ISO4217定义的3位字母代码,如CNY,USD等(如使用其它自定义等价物作为现金,可使用ISO4217中未定义的3位字母组合传入货币类型)
@param virtualAmount 虚拟币数量
@param channel 支付渠道
@param orderId 交易订单ID
@return void
*/
+ (void)exchange:(NSString *)orderId currencyAmount:(double)currencyAmount currencyType:(NSString *)currencyType virtualCurrencyAmount:(double)virtualAmount paychannel:(int)channel;
/** 玩家支付货币兑换虚拟币.
@param cash 真实货币数量
@param source 支付渠道
@param coin 虚拟币数量
@return void
*/
+ (void)pay:(double)cash source:(int)source coin:(double)coin;
/** 玩家支付货币购买道具.
@param cash 真实货币数量
@param source 支付渠道
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@return void
*/
+ (void)pay:(double)cash source:(int)source item:(NSString *)item amount:(int)amount price:(double)price;
#pragma mark -
#pragma mark Buy methods
///---------------------------------------------------------------------------------------
/// @name 虚拟币购买统计
///---------------------------------------------------------------------------------------
/** 记录玩家使用虚拟币的消费情况
*/
/** 玩家使用虚拟币购买道具
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@return void
*/
+ (void)buy:(NSString *)item amount:(int)amount price:(double)price;
#pragma mark -
#pragma mark Use methods
///---------------------------------------------------------------------------------------
/// @name 道具消耗统计
///---------------------------------------------------------------------------------------
/** 记录玩家道具消费情况
*/
/** 玩家使用虚拟币购买道具
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@return void
*/
+ (void)use:(NSString *)item amount:(int)amount price:(double)price;
#pragma mark -
#pragma mark Bonus methods
///---------------------------------------------------------------------------------------
/// @name 虚拟币及道具奖励统计
///---------------------------------------------------------------------------------------
/** 记录玩家获赠虚拟币及道具的情况
*/
/** 玩家获虚拟币奖励
@param coin 虚拟币数量
@param source 奖励方式
@return void
*/
+ (void)bonus:(double)coin source:(int)source;
/** 玩家获道具奖励
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@param source 奖励方式
@return void
*/
+ (void)bonus:(NSString *)item amount:(int)amount price:(double)price source:(int)source;
#pragma mark DEPRECATED
//已经被新的setUserLevelId:方法替代,请使用新的API。
+ (void)setUserLevel:(NSString *)level;
//已经被新的active user方法替代,请使用新的API。
+ (void)setUserID:(NSString *)userId sex:(int)sex age:(int)age platform:(NSString *)platform;
@end
+19
View File
@@ -0,0 +1,19 @@
//
// UMCommon.h
// UMCommon
//
// Created by San Zhang on 11/2/16.
// Copyright © 2016 UMeng. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for UMCommon.
FOUNDATION_EXPORT double UMCommonVersionNumber;
//! Project version string for UMCommon.
FOUNDATION_EXPORT const unsigned char UMCommonVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <UMCommon/PublicHeader.h>
#import <UMCommon/UMConfigure.h>
+41
View File
@@ -0,0 +1,41 @@
//
// UMConfigure.h
// UMCommon
//
// Created by San Zhang on 9/6/16.
// Copyright © 2016 UMeng. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UMConfigure : NSObject
/** 初始化友盟所有组件产品
@param appKey 开发者在友盟官网申请的appkey.
@param channel 渠道标识,可设置nil表示"App Store".
@return;
*/
+ (void)initWithAppkey:(NSString *)appKey channel:(NSString *)channel;
/** 设置是否在console输出sdk的log信息.
@param bFlag 默认NO(不输出log); 设置为YES, 输出可供调试参考的log信息. 发布产品时必须设置为NO.
@return void.
*/
+ (void)setLogEnabled:(BOOL)bFlag;
/** 设置是否对日志信息进行加密, 默认NO(不加密).
@param value 设置为YES, umeng SDK 会将日志信息做加密处理
@return void.
*/
+ (void)setEncryptEnabled:(BOOL)value;
+ (NSString *)umidString;
/**
集成测试需要device_id
*/
+ (NSString*)deviceIDForIntegration;
@end