mirror of
https://github.com/camelwoo/umeng-analytics-cordova-plugin.git
synced 2026-01-27 00:00:06 +08:00
ios 的 sdk 升级到 6.0.3,似乎没有 dplus 的内容了。
This commit is contained in:
@@ -1,77 +0,0 @@
|
||||
//
|
||||
// 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
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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;
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#import "UMAnalyticsModule.h"
|
||||
#import <UMAnalytics/MobClick.h>
|
||||
#import <UMAnalytics/MobClickGameAnalytics.h>
|
||||
#import <UMAnalytics/DplusMobClick.h>
|
||||
//#import <UMAnalytics/DplusMobClick.h>
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user