pod 'ZLYQAnalyticSDK'
导入头文件#import <ZLYQAnalyticSDK/ZADataAPI>
[[ZADataAPI share] configWithProjectID:projectID
appKey:appKey
apiKey:apiKey
server:server
uploadDuration:duration
uploadCount:count
projectID
、appKey
、apiKey
、server
在私有化部署后获取,其中appKey
需要添加到工程的scheme
中,调试debugMode
时需要唤起APP使用;
duration
指定触发上传的间隔时间, 如果duration
等于0,使用默认的15秒, 如果duration
小于0,取消定时任务;
count
指定触发上传的条数。
App用户登录时调用loginWithUserID
传入userID
,退出登录时调用logout
清除登录信息
根据需要调用下面的方法,increaseProfile
只能传入value
是数值类型的信息
- (void)setProfile:(NSDictionary *)profileInfo;
- (void)setOnceProfile:(NSDictionary *)profileInfo;
- (void)appendProfile:(NSDictionary *)profileInfo;
- (void)increaseProfile:(NSDictionary *)profileInfo;
- (void)deleteProfile:(NSDictionary *)profileInfo;
- (void)unsetProfile:(NSDictionary *)profileInfo;
普通上传
+ (void)addEvent:(NSString *)eventName info:(nullable NSDictionary *)info
实时上传 传入事件名称和时间对应的属性
+ (void)addEvent:(NSString *)eventName info:(nullable NSDictionary *)info shouldDelay:(BOOL)shouldDelay
当shouldDelay
值为false
时,该事件实时上传,值为true
时,等于普通上传
登录成功后,传入userId
- (void)loginWithUserID:(NSString *)userID;
退出登录,清空userId
- (void)logout;
提供了获取事件公共参数的方法, 用作服务端埋点时保证数据的完整性
- (NSDictionary *)commonParams;