Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ IsAddedToFav: false
通过 Debug 模式,可以校验追踪的事件及属性是否正确。普通模式下,数据导入后,在 Sensors Analytics 中稍等片刻,便能看到追踪结果。请注意,**不要在正式发布的 App 中使用 Debug 模式**。

![](https://www.sensorsdata.cn/manual/img/ios_sdk_1.png)

8 changes: 8 additions & 0 deletions SensorsAnalyticsAPICloudSDK/SensorsAnalyticsAPICloudSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,12 @@
* }
*/
-(void)setServerUrl:(NSDictionary *)paramsDict;

/**
* @abstract
* 删除keyChain数据
* @param paramsDict 无参数
*/
-(void)clearKeyChainData:(NSDictionary *)paramsDict;

@end
10 changes: 7 additions & 3 deletions SensorsAnalyticsAPICloudSDK/SensorsAnalyticsAPICloudSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @implementation SensorsAnalyticsAPICloudSDK

+ (void)launch{
@try {
NSDictionary *feature = [UZAppDelegate.appDelegate getFeatureByName:@"SensorsAnalyticsAPICloudSDK"];
NSDictionary *feature = [UZAppDelegate.appDelegate getFeatureByName:@"sensorsAnalyticsAPICloudSDK"];
NSString *serverURL = [feature stringValueForKey:@"serverURL" defaultValue:nil];
NSString *debugMode = [feature stringValueForKey:@"debugMode" defaultValue:nil];
BOOL enableLog = [feature boolValueForKey:@"enableLog" defaultValue:NO];
Expand All @@ -29,7 +29,6 @@ + (void)launch{
//校验debugMode
SensorsAnalyticsDebugMode mode;
if (debugMode.length > 0) {

if ([debugMode isEqualToString:@"debugOnly"]) {
mode = SensorsAnalyticsDebugOnly;
}else if ([debugMode isEqualToString:@"debugAndTrack"]){
Expand All @@ -48,7 +47,7 @@ + (void)launch{
if (serverURL.length > 0) {
[SensorsAnalyticsSDK sharedInstanceWithServerURL:serverURL andDebugMode:mode];
if (downloadChannel.length > 0) {
[SensorsAnalyticsSDK.sharedInstance trackInstallation:@"AppInstall" withProperties:@{@"downloadChannel":downloadChannel}];
[SensorsAnalyticsSDK.sharedInstance trackInstallation:@"AppInstall" withProperties:@{@"DownloadChannel":downloadChannel}];
}
[SensorsAnalyticsSDK.sharedInstance enableLog:enableLog];
if (enableAutoTrack) {
Expand Down Expand Up @@ -311,4 +310,9 @@ -(void)setServerUrl:(NSDictionary *)paramsDict {

}
}

-(void)clearKeyChainData:(NSDictionary *)paramsDict{
[SensorsAnalyticsSDK.sharedInstance clearKeychainData];
}

@end
2 changes: 1 addition & 1 deletion SensorsAnalyticsAPICloudSDK/Supporting Files/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name":"sensorsAnalyticsAPICloudSDK",
"class":"SensorsAnalyticsAPICloudSDK",
"methods":["enableLog","login","track","flush","registerSuperProperties","unregisterSuperProperty","identify","trackInstallation","trackTimerStart","trackTimerEnd","clearTrackTimer","logout","profileSet","profileSetOnce","profileUnset","profileIncrement","profileAppend","profileDelete","trackViewScreen","deleteAll","setServerUrl"],
"methods":["enableLog","login","track","flush","registerSuperProperties","unregisterSuperProperty","identify","trackInstallation","trackTimerStart","trackTimerEnd","clearTrackTimer","logout","profileSet","profileSetOnce","profileUnset","profileIncrement","profileAppend","profileDelete","trackViewScreen","deleteAll","setServerUrl","clearKeyChainData"],
"syncMethods":["getDistinctId"],
"launchClassMethod":"launch"
}
Expand Down
Binary file not shown.