diff --git a/src/ios/UMAnalytics.framework/Headers/DplusMobClick.h b/src/ios/UMAnalytics.framework/Headers/DplusMobClick.h deleted file mode 100755 index 0d9f183..0000000 --- a/src/ios/UMAnalytics.framework/Headers/DplusMobClick.h +++ /dev/null @@ -1,77 +0,0 @@ -// -// DplusMobClick.h -// Analytics -// -// Copyright (C) 2010-2016 Umeng.com . All rights reserved. - -#import -#import - -@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 diff --git a/src/ios/UMAnalytics.framework/Headers/MobClick.h b/src/ios/UMAnalytics.framework/Headers/MobClick.h index 539734d..4d7f29c 100755 --- a/src/ios/UMAnalytics.framework/Headers/MobClick.h +++ b/src/ios/UMAnalytics.framework/Headers/MobClick.h @@ -14,9 +14,7 @@ typedef void(^CallbackBlock)(); */ typedef NS_ENUM (NSUInteger, eScenarioType) { - E_UM_NORMAL = 0, // default value E_UM_GAME = 1, // game - E_UM_DPLUS = 4 // DPlus }; @class CLLocation; @@ -28,7 +26,7 @@ typedef NS_ENUM (NSUInteger, eScenarioType) /// @name 设置 ///--------------------------------------------------------------------------------------- -/** 设置 统计场景类型,默认为普通应用统计:E_UM_NORMAL +/** 设置 统计场景类型 @param 游戏统计必须设置为:E_UM_GAME. @return void. */ @@ -211,4 +209,39 @@ typedef NS_ENUM (NSUInteger, eScenarioType) */ + (void)onDeepLinkReceived:(NSURL *)link; +/** + * 设置预置事件属性 键值对 会覆盖同名的key + */ ++(void) registerPreProperties:(NSDictionary *)property; + +/** + * + * 删除指定预置事件属性 + @param key + */ ++(void) unregisterPreProperty:(NSString *)propertyName; + +/** + * 获取预置事件所有属性;如果不存在,则返回空。 + */ ++(NSDictionary *)getPreProperties; + +/** + *清空所有预置事件属性。 + */ ++(void)clearPreProperties; + + +/** + * 设置关注事件是否首次触发,只关注eventList前五个合法eventID.只要已经保存五个,此接口无效 + */ ++(void)setFirstLaunchEvent:(NSArray *)eventList; + +/** 设置是否自动采集页面, 默认NO(不自动采集). + @param value 设置为YES, umeng SDK 会将自动采集页面信息 + */ ++ (void)setAutoPageEnabled:(BOOL)value; + @end + + diff --git a/src/ios/UMAnalytics.framework/UMAnalytics b/src/ios/UMAnalytics.framework/UMAnalytics index ba02087..4be488c 100755 Binary files a/src/ios/UMAnalytics.framework/UMAnalytics and b/src/ios/UMAnalytics.framework/UMAnalytics differ diff --git a/src/ios/UMAnalyticsModule.h b/src/ios/UMAnalyticsModule.h index 683e953..5089f1a 100644 --- a/src/ios/UMAnalyticsModule.h +++ b/src/ios/UMAnalyticsModule.h @@ -12,6 +12,8 @@ @interface UMAnalyticsModule : CDVPlugin +- (void)init:(CDVInvokedUrlCommand*)command; +- (void)setLogEnabled:(CDVInvokedUrlCommand*)command; - (void)onEvent:(CDVInvokedUrlCommand*)command; - (void)onEventWithLabel:(CDVInvokedUrlCommand*)command; - (void)onEventWithParameters:(CDVInvokedUrlCommand*)command; diff --git a/src/ios/UMAnalyticsModule.m b/src/ios/UMAnalyticsModule.m index cc93ac7..255f06b 100755 --- a/src/ios/UMAnalyticsModule.m +++ b/src/ios/UMAnalyticsModule.m @@ -8,7 +8,8 @@ #import "UMAnalyticsModule.h" #import #import -#import +//#import +#import "UMCommonModule.h" @interface UMAnalyticsModule () @@ -33,6 +34,20 @@ +- (void)init:(CDVInvokedUrlCommand*)command { + NSString *appkey = [command.arguments objectAtIndex:0]; + NSString *channel = [command.arguments objectAtIndex:1]; + if (appkey == nil || [appkey isKindOfClass:[NSNull class]] || channel == nil || [channel isKindOfClass:[NSNull class]]) { + return; + } + [UMCommonModule initWithAppkey:appkey channel:channel]; +} + +- (void)setLogEnabled:(CDVInvokedUrlCommand*)command { + BOOL enabled = [command.arguments objectAtIndex:0]; + [UMConfigure setLogEnabled:enabled]; +} + - (void)onEvent:(CDVInvokedUrlCommand*)command { NSString *eventId = [command.arguments objectAtIndex:0]; if (eventId == nil || [eventId isKindOfClass:[NSNull class]]) { @@ -318,7 +333,7 @@ if (eventName == nil || [eventName isKindOfClass:[NSNull class]]) { return; } - [DplusMobClick track:eventName]; +// [DplusMobClick track:eventName]; } - (void)trackWithProperty:(CDVInvokedUrlCommand*)command { @@ -327,12 +342,12 @@ return; } NSDictionary *property = [command.arguments objectAtIndex:1]; - [DplusMobClick track:eventName property:property]; +// [DplusMobClick track:eventName property:property]; } - (void)registerSuperProperty:(CDVInvokedUrlCommand*)command { NSDictionary *property = [command.arguments objectAtIndex:0]; - [DplusMobClick registerSuperProperty:property]; +// [DplusMobClick registerSuperProperty:property]; } - (void)unregisterSuperProperty:(CDVInvokedUrlCommand*)command { @@ -340,14 +355,14 @@ if (propertyName == nil || [propertyName isKindOfClass:[NSNull class]]) { return; } - [DplusMobClick unregisterSuperProperty:propertyName]; +// [DplusMobClick unregisterSuperProperty:propertyName]; } - (void)getSuperProperty:(CDVInvokedUrlCommand*)command { NSString *propertyName = [command.arguments objectAtIndex:0]; - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[DplusMobClick getSuperProperty:propertyName]]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; +// CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[DplusMobClick getSuperProperty:propertyName]]; +// [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } @@ -356,29 +371,29 @@ NSString *jsonString = nil; NSError *error = nil; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[DplusMobClick getSuperProperties] - options:kNilOptions //TODO: NSJSONWritingPrettyPrinted // kNilOptions - error:&error]; - if ([jsonData length] && (error == nil)) - { - jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] ; - }else{ - jsonString=@""; - } - NSString *callBack = [NSString stringWithFormat:@"getSuperProperties('%@')",jsonString]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:callBack]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[DplusMobClick getSuperProperties] +// options:kNilOptions //TODO: NSJSONWritingPrettyPrinted // kNilOptions +// error:&error]; +// if ([jsonData length] && (error == nil)) +// { +// jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] ; +// }else{ +// jsonString=@""; +// } +// NSString *callBack = [NSString stringWithFormat:@"getSuperProperties('%@')",jsonString]; +// +// CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:callBack]; +// [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } - (void)clearSuperProperties:(CDVInvokedUrlCommand*)commands { - [DplusMobClick clearSuperProperties]; +// [DplusMobClick clearSuperProperties]; } - (void)setFirstLaunchEvent:(CDVInvokedUrlCommand*)command { NSArray *eventList = [command.arguments objectAtIndex:0]; - [DplusMobClick setFirstLaunchEvent:eventList]; +// [DplusMobClick setFirstLaunchEvent:eventList]; } @end diff --git a/src/ios/UMCommon.framework/Headers/UMConfigure.h b/src/ios/UMCommon.framework/Headers/UMConfigure.h index f6e1cc5..fd07759 100755 --- a/src/ios/UMCommon.framework/Headers/UMConfigure.h +++ b/src/ios/UMCommon.framework/Headers/UMConfigure.h @@ -13,19 +13,16 @@ /** 初始化友盟所有组件产品 @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; diff --git a/src/ios/UMCommon.framework/UMCommon b/src/ios/UMCommon.framework/UMCommon index e8e6041..f6d8d5d 100755 Binary files a/src/ios/UMCommon.framework/UMCommon and b/src/ios/UMCommon.framework/UMCommon differ