ApexDataCollectSDK 0.1.8

ApexDataCollectSDK 0.1.8

Maintained by long0133, 远方竹叶.



 
Depends on:
ApexDataCollectUtil_iOS>= 0
ApexDataCollectMoniterSDK>= 0
 

  • By
  • long0133

ApexDataCollectSDK

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

##Installation

ApexDataCollectSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ApexDataCollectSDK'

then run 'pod update'

Usage

Prepare

In BuildSettings - Other Linker Flags, add ''-ObjC''

Initialize

import <ApexDataCollect.h> in your project

All configration must be set after SDK initialized, and apiKey can be nil for now.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //开启日志输出
    [[PEXLogger sharedInstance] setLogLevel:LoggerLevelVerbose];
    //初始化
    [[APEXDataCollectSDK shareCollector] startCollectorWithServersUrl:@"Url" uuid:@"xxx"];
    return YES;
}

Configration

You can set which kind of event you'd like to track with the following api.(All event type listed in ApexDataCollectSDK.h)

[[APEXDataCollectSDK shareCollector] configAutoTrackEventType:ApexAnalyticEventType_Click | ApexAnalyticEventType_ViewController | ApexAnalyticEventType_AppLaunch | ApexAnalyticEventType_ViewExposureRate];

You can also set event upload time interval, and event max count. when the number of event in queue reach the max count. The queue will automatically trigger event uploading.

Defult upload time interval and max counts are set to 60 seconds and 100 items, respectively.

[[APEXDataCollectSDK shareCollector] configUploadTrigerTimeInterval:60]; 
[[APEXDataCollectSDK shareCollector] configUploadTrigerQueneMaxCount:100];

SignIn/SignOut

If your App is based on Account System, You can use these api to set user's SignIn Status or SignOut Status

/**
 登入with用户id
 */
- (void)signInWithUID:(NSString*)UID;

/**
 登出时调用
 */
- (void)signOut;

Author

long0133, [email protected]

License

ApexDataCollectSDK is available under the MIT license. See the LICENSE file for more info.