TapDB Class Reference

Inherits from NSObject
Declared in TapDB.h

  advertiserIDCollectionEnabled

Controls the access to IDFA If not explicitly set, the default is NO

@property (class, nonatomic, assign, getter=isAdvertiserIDCollectionEnabled) BOOL advertiserIDCollectionEnabled

Discussion

Controls the access to IDFA If not explicitly set, the default is NO

Declared In

TapDB.h

+ enableLog:

是否打开日志输出 enbale : YES 打开 NO 关闭

+ (void)enableLog:(BOOL)enable

Discussion

是否打开日志输出 enbale : YES 打开 NO 关闭

Declared In

TapDB.h

+ setHost:

调用该接口修改数据发送的域名,有特殊需要时调用,调用必须位于初始化之前 域名必须是https://abc.example.com/的格式,不能为空

+ (void)setHost:(NSString *)host

Discussion

调用该接口修改数据发送的域名,有特殊需要时调用,调用必须位于初始化之前 域名必须是https://abc.example.com/的格式,不能为空

Declared In

TapDB.h

+ setCustomEventHost:

调用该接口修改自定义事件数据发送的域名,有特殊需要时调用,调用必须位于初始化之前 域名必须是https://abc.example.com/的格式,不能为空

+ (void)setCustomEventHost:(NSString *)host

Discussion

调用该接口修改自定义事件数据发送的域名,有特殊需要时调用,调用必须位于初始化之前 域名必须是https://abc.example.com/的格式,不能为空

Declared In

TapDB.h

+ onStart:channel:version:

+ (void)onStart:(NSString *)appId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion

+ onStart:channel:version:properties:

初始化,尽早调用 appId: 注册游戏时获得的APP ID channel: 分包渠道名称,可为空 gameVersion: 游戏版本,可为空,为空时,自动获取游戏安装包的版本(Xcode配置中的Version) properties: 自定义属性

+ (void)onStart:(NSString *)appId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion properties:(nullable NSDictionary *)properties

Discussion

初始化,尽早调用 appId: 注册游戏时获得的APP ID channel: 分包渠道名称,可为空 gameVersion: 游戏版本,可为空,为空时,自动获取游戏安装包的版本(Xcode配置中的Version) properties: 自定义属性

Declared In

TapDB.h

+ onStartWithClientId:channel:version:

+ (void)onStartWithClientId:(NSString *)clientId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion

+ onStartWithClientId:channel:version:isCN:

+ (void)onStartWithClientId:(NSString *)clientId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion isCN:(BOOL)isCN

+ onStartWithClientId:channel:version:properties:

初始化,尽早调用 clientId: TapTap登录sdk后台页面 client id channel: 分包渠道名称,可为空 gameVersion: 游戏版本,可为空,为空时,自动获取游戏安装包的版本(Xcode配置中的Version) properties: 自定义属性

+ (void)onStartWithClientId:(NSString *)clientId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion properties:(nullable NSDictionary *)properties

Discussion

初始化,尽早调用 clientId: TapTap登录sdk后台页面 client id channel: 分包渠道名称,可为空 gameVersion: 游戏版本,可为空,为空时,自动获取游戏安装包的版本(Xcode配置中的Version) properties: 自定义属性

Declared In

TapDB.h

+ setUser:

+ (void)setUser:(NSString *)userId

+ setUser:properties:

+ (void)setUser:(NSString *)userId properties:(nullable NSDictionary *)properties

+ setUser:loginType:

对外隐藏接口

+ (void)setUser:(NSString *)userId loginType:(TapDBLoginType)loginType

Discussion

对外隐藏接口

Declared In

TapDB.h

+ setUser:loginType:properties:

记录一个用户(不是游戏角色!!!!),需要保证唯一性

+ (void)setUser:(NSString *)userId loginType:(TapDBLoginType)loginType properties:(nullable NSDictionary *)properties

Parameters

userId

用户ID。不同用户需要保证ID的唯一性

loginType

登录方式

properties

自定义属性

Discussion

记录一个用户(不是游戏角色!!!!),需要保证唯一性

Declared In

TapDB.h

+ clearUser

登出清理用户

+ (void)clearUser

Discussion

登出清理用户

Declared In

TapDB.h

+ getStartInfo

目前TapDB SDK仅支持单实例模式,如果多次调用onStart方法,只有最初传入的appid生效。调用该函数可以获取生效的信息 返回值:包含appId和channel的NSDictionary,对应的value均可能为nil

+ (NSDictionary *)getStartInfo

Discussion

目前TapDB SDK仅支持单实例模式,如果多次调用onStart方法,只有最初传入的appid生效。调用该函数可以获取生效的信息 返回值:包含appId和channel的NSDictionary,对应的value均可能为nil

Declared In

TapDB.h

+ getDeviceId

获取当前的设备标识

+ (NSString *)getDeviceId

Discussion

获取当前的设备标识

Declared In

TapDB.h

+ setLevel:

设置用户等级,初次设置时或升级时调用 level: 等级

+ (void)setLevel:(NSInteger)level

Discussion

设置用户等级,初次设置时或升级时调用 level: 等级

Declared In

TapDB.h

+ setServer:

设置用户服务器,初次设置或更改服务器的时候调用 server: 服务器

+ (void)setServer:(NSString *)server

Discussion

设置用户服务器,初次设置或更改服务器的时候调用 server: 服务器

Declared In

TapDB.h

+ setName:

设置用户名

+ (void)setName:(NSString *)name

Parameters

name

必传,长度大于0并小于等于256,用户名

Discussion

设置用户名

Declared In

TapDB.h

+ onChargeSuccess:product:amount:currencyType:payment:

充值成功时调用 orderId: 订单ID,可为空 product: 产品名称,可为空 amount: 充值金额(单位分,即无论什么币种,都需要乘以100) currencyType: 货币类型,可为空,参考:人民币 CNY,美元 USD;欧元 EUR payment: 支付方式,可为空,如:支付宝

+ (void)onChargeSuccess:(nullable NSString *)orderId product:(nullable NSString *)product amount:(NSInteger)amount currencyType:(nullable NSString *)currencyType payment:(nullable NSString *)payment

Discussion

充值成功时调用 orderId: 订单ID,可为空 product: 产品名称,可为空 amount: 充值金额(单位分,即无论什么币种,都需要乘以100) currencyType: 货币类型,可为空,参考:人民币 CNY,美元 USD;欧元 EUR payment: 支付方式,可为空,如:支付宝

Declared In

TapDB.h

+ trackEvent:properties:

自定义事件 eventName: 事件代码,需要在控制后台预先进行配置 properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数

+ (void)trackEvent:(NSString *)eventName properties:(NSDictionary *)properties

Discussion

自定义事件 eventName: 事件代码,需要在控制后台预先进行配置 properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数

Declared In

TapDB.h

+ onEvent:properties:

自定义事件,即将弃用,请使用trackEvent接口 eventCode: 事件代码,需要在控制后台预先进行配置 properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数

+ (void)onEvent:(NSString *)eventCode properties:(NSDictionary *)properties

Discussion

自定义事件,即将弃用,请使用trackEvent接口 eventCode: 事件代码,需要在控制后台预先进行配置 properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数

Declared In

TapDB.h

+ deviceInitialize:

初始化设备属性操作

+ (void)deviceInitialize:(NSDictionary *)properties

Parameters

properties

属性字典

Discussion

初始化设备属性操作

Declared In

TapDB.h

+ deviceUpdate:

更新设备属性操作

+ (void)deviceUpdate:(NSDictionary *)properties

Parameters

properties

属性字典

Discussion

更新设备属性操作

Declared In

TapDB.h

+ deviceAdd:

设备属性增加操作

+ (void)deviceAdd:(NSDictionary *)properties

Parameters

properties

属性字典 暂时只支持数字属性

Discussion

设备属性增加操作

Declared In

TapDB.h

+ userInitialize:

初始化用户属性操作

+ (void)userInitialize:(NSDictionary *)properties

Parameters

properties

属性字典

Discussion

初始化用户属性操作

Declared In

TapDB.h

+ userUpdate:

更新用户属性操作

+ (void)userUpdate:(NSDictionary *)properties

Parameters

properties

属性字典

Discussion

更新用户属性操作

Declared In

TapDB.h

+ userAdd:

用户属性增加操作

+ (void)userAdd:(NSDictionary *)properties

Parameters

properties

属性字典 暂时只支持数字属性

Discussion

用户属性增加操作

Declared In

TapDB.h

+ registerStaticProperties:

添加静态事件属性,每个事件都将会发送

+ (void)registerStaticProperties:(NSDictionary *)staticProperties

Parameters

staticProperties

属性字典

Discussion

添加静态事件属性,每个事件都将会发送

Declared In

TapDB.h

+ clearStaticProperties

删除添加的静态事件属性

+ (void)clearStaticProperties

Discussion

删除添加的静态事件属性

Declared In

TapDB.h

+ unregisterStaticProperty:

删除添加的某个静态事件属性

+ (void)unregisterStaticProperty:(NSString *)propertyName

Parameters

propertyName

属性Key

Discussion

删除添加的某个静态事件属性

Declared In

TapDB.h

+ registerDynamicProperties:

添加动态事件属性,每次发送事件会调用dynamicPropertiesCaculator

+ (void)registerDynamicProperties:(NSDictionary *( ^ ) ( void ))dynamicPropertiesCaculator

Parameters

dynamicPropertiesCaculator

动态属性回调,需返回希望上传的属性字典

Discussion

添加动态事件属性,每次发送事件会调用dynamicPropertiesCaculator

Declared In

TapDB.h