diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..99de798 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,123 @@ +# ChangeLog + +## 3.6.1 + +## Dependencies + +- TapTap.Common v3.6.1 + +## 3.6.0 + +## Dependencies + +- TapTap.Common v3.6.0 + +## 3.5.0 + +## New Feature + +- 新增 SOC 参数上报 + +## Dependencies +- TapTap.Common v3.5.0 + +## 3.4.0 + +## New Feature + +- 修改部分上报参数及修复时长统计问题 + +### Dependencies + +- TapTap.Common v3.4.0 + +## 3.3.0 + +### Dependencies + +- TapTap.Common v3.3.0 + +## 3.2.0 + +### New Feature + +- Android TapDB 支持沙盒上报 +- iOS 支持ASA +- iOS 删除多余的上报参数(appId) + +### Dependencies + +- TapTap.Common v3.2.0 + +## 3.1.0 + +### Dependencies + +- TapTap.Common v3.1.0 + +## 3.0.0 + +### Dependencies + +- TapTap.Common v3.0.0 + +## 2.1.7 + +### New Feature + +- 充值接口新增支持传入自定义字段的函数 + +### Dependencies + +- TapTap.Common v2.1.7 + +## 2.1.6 + +### Dependencies + +- TapTap.Common v2.1.6 + +## 2.1.5 + +### New Feature + +- Android 新增游戏 TapTap 共享ID 开关 + +### Dependencies + +- TapTap.Common v2.1.5 + +## 2.1.4 + +### Dependencies + +- TapTap.Common v2.1.4 + +## 2.1.3 + +### Dependencies + +- TapTap.Common v2.1.3 + +## 2.1.2 + +### Dependencies + +- TapTap.Common v2.1.2 + +## 2.1.1 + +### Feature + +- 新增 RegisterDynamicProperties 接口 +- 新增 AdvertiserIDCollectionEnabled IDFA 获取开关 + +### Dependencies + +- TapTap.Common v2.1.1 + +## 2.0.0 + +### Dependencies + +* TapTap.Common v2.0.0 diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..0e95df1 --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ef85b4076e75343ccaeeb201c070bef2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation.meta b/Documentation.meta new file mode 100644 index 0000000..28b243f --- /dev/null +++ b/Documentation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d361a13a7c484cd7b9af39c09fab0e6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation/README.md b/Documentation/README.md new file mode 100644 index 0000000..3e98f9c --- /dev/null +++ b/Documentation/README.md @@ -0,0 +1,116 @@ +## TapTap.TapDB + +## 使用前提 + +使用 TapTap.TapDB 前提是必须依赖以下库: +* [TapTap.Common](https://github.com/TapTap/TapCommon-Unity.git) + +## 命名空间 + +```c# +using TapTap.TapDB; +``` + +## 接口描述 + +### 初始化 +```c# +TapDB.Init(string clientId, string channel, string gameVersion, bool isCN); +``` + +### 设置用户 + +```c# +TapDB.SetUser(string userId); + +TapDB.SetUser(string userId,string openId,string loginType); +``` + +### 设置姓名 + +```c# +TapDB.SetName(string name); +``` + +### 设置玩家等级 + +```c# +TapDB.SetLevel(int level); +``` + +### 设置服务器 + +```c# +TapDB.SetServer(string server); +``` + +### 充值成功 + +```c# +TapDB.OnCharge(string orderId, string productId, long amount, string currencyType, string payment); +``` + +### 自定义事件 + +```c# +TapDB.TrackEvent(string eventName,string jsonProperties); +``` + +### 注册静态事件 + +```c# +TapDB.RegisterStaticProperties(string jsonProperties); +``` + +### 取消静态事件 + +```c# +TapDB.UnregisterStaticProperty(string propertKey); +``` + +### 清除静态事件 + +```c# +TapDB.ClearStaticProperties(); +``` + +### 注册动态事件 +```c# +TapDB.RegisterDynamicProperties(IDynamicProperties properties); +``` + +### 设备初始化 + +```c# +TapDB.DeviceInitialize(string properties); +``` + +### 设备更新 + +```c# +TapDB.DeviceUpdate(string properties); +``` + +### 用户初始化 + +```c# +TapDB.UserInitialize(string properties); +``` + +### 用户更新 + +```c# +TapDB.UserUpdate(string properties); +``` + +### 添加用户 + +```c# +TapDB.UserAdd(string properties); +``` + +### 清除用户 + +```c# +TapDB.ClearUser(); +``` \ No newline at end of file diff --git a/Documentation/README.md.meta b/Documentation/README.md.meta new file mode 100644 index 0000000..9e8b4cc --- /dev/null +++ b/Documentation/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9d4164464c2f34cf0b5dbdcb62136631 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..c506709 --- /dev/null +++ b/Editor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a4c97e39a5394ff4a3f6ec74667dfeee +timeCreated: 1617120982 \ No newline at end of file diff --git a/Editor/TapDBIOSProcessor.cs b/Editor/TapDBIOSProcessor.cs new file mode 100644 index 0000000..75aced1 --- /dev/null +++ b/Editor/TapDBIOSProcessor.cs @@ -0,0 +1,38 @@ +using System.IO; +using TapTap.Common.Editor; +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEngine; + +namespace TapTap.TapDB.Editor +{ +#if UNITY_IOS + public class TapDBIOSProcessor + { + [PostProcessBuild(104)] + public static void OnPostprocessBuild(BuildTarget buildTarget, string path) + { + if (buildTarget != BuildTarget.iOS) return; + + var projPath = TapCommonCompile.GetProjPath(path); + var proj = TapCommonCompile.ParseProjPath(projPath); + var target = TapCommonCompile.GetUnityTarget(proj); + var unityFrameworkTarget = TapCommonCompile.GetUnityFrameworkTarget(proj); + if (TapCommonCompile.CheckTarget(target)) + { + Debug.LogError("Unity-iPhone is NUll"); + return; + } + + proj.AddFrameworkToProject(unityFrameworkTarget, "AdSupport.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "CoreMotion.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "Security.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "AppTrackingTransparency.framework", true); + proj.AddFrameworkToProject(unityFrameworkTarget, "iAd.framework", false); + proj.AddFrameworkToProject(unityFrameworkTarget, "AdServices.framework", true); + File.WriteAllText(projPath, proj.WriteToString()); + } + } +#endif +} \ No newline at end of file diff --git a/Editor/TapDBIOSProcessor.cs.meta b/Editor/TapDBIOSProcessor.cs.meta new file mode 100644 index 0000000..fa5dd8c --- /dev/null +++ b/Editor/TapDBIOSProcessor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 60076b8248454e079ca5e154a64375ce +timeCreated: 1617120982 \ No newline at end of file diff --git a/Editor/TapTap.TapDB.asmdef b/Editor/TapTap.TapDB.asmdef new file mode 100644 index 0000000..894069d --- /dev/null +++ b/Editor/TapTap.TapDB.asmdef @@ -0,0 +1,16 @@ +{ + "name": "TapTap.TapDB.Editor", + "references": [ + "TapTap.Common.Editor" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/Editor/TapTap.TapDB.asmdef.meta b/Editor/TapTap.TapDB.asmdef.meta new file mode 100644 index 0000000..3af67ba --- /dev/null +++ b/Editor/TapTap.TapDB.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eb3867057e46a42fc844e0e5fa9a7627 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins.meta b/Plugins.meta new file mode 100644 index 0000000..0ddc877 --- /dev/null +++ b/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d6b915e988e14953a553c40f211c14e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Android.meta b/Plugins/Android.meta new file mode 100644 index 0000000..f0c4804 --- /dev/null +++ b/Plugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 98136d11d90494c59bc4930deabde08f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Android/libs.meta b/Plugins/Android/libs.meta new file mode 100644 index 0000000..08d13ba --- /dev/null +++ b/Plugins/Android/libs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 75fd9c9ed4693428980d8f07167b7e61 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/Android/libs/TapDB_3.6.1.aar b/Plugins/Android/libs/TapDB_3.6.1.aar new file mode 100644 index 0000000..c88b261 Binary files /dev/null and b/Plugins/Android/libs/TapDB_3.6.1.aar differ diff --git a/Plugins/Android/libs/TapDB_3.6.1.aar.meta b/Plugins/Android/libs/TapDB_3.6.1.aar.meta new file mode 100644 index 0000000..c89ee0c --- /dev/null +++ b/Plugins/Android/libs/TapDB_3.6.1.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 1898c428727644f1f84ebdb34153f90f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/TapTap.TapDB.dll b/Plugins/TapTap.TapDB.dll new file mode 100644 index 0000000..409b396 Binary files /dev/null and b/Plugins/TapTap.TapDB.dll differ diff --git a/Plugins/TapTap.TapDB.dll.meta b/Plugins/TapTap.TapDB.dll.meta new file mode 100644 index 0000000..b9e0200 --- /dev/null +++ b/Plugins/TapTap.TapDB.dll.meta @@ -0,0 +1,86 @@ +fileFormatVersion: 2 +guid: ee329d06444c04afca2f05bb9f957d29 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/TapTap.TapDB.pdb b/Plugins/TapTap.TapDB.pdb new file mode 100644 index 0000000..109e3e3 Binary files /dev/null and b/Plugins/TapTap.TapDB.pdb differ diff --git a/Plugins/TapTap.TapDB.pdb.meta b/Plugins/TapTap.TapDB.pdb.meta new file mode 100644 index 0000000..9243d61 --- /dev/null +++ b/Plugins/TapTap.TapDB.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8fa8d35203500410dadd1f2fbe2d40f6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS.meta b/Plugins/iOS.meta new file mode 100644 index 0000000..80f2cbf --- /dev/null +++ b/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 670c88be76ae74f47a5feec2fba52d74 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework.meta b/Plugins/iOS/TapDB.framework.meta new file mode 100644 index 0000000..31e1e54 --- /dev/null +++ b/Plugins/iOS/TapDB.framework.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: 10cd5b0da284a4624a4f29e1453705dc +folderAsset: yes +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework/Headers.meta b/Plugins/iOS/TapDB.framework/Headers.meta new file mode 100644 index 0000000..3cab80d --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Headers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ab03e2600f6443d88a9906f843bd32b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework/Headers/TapDB.h b/Plugins/iOS/TapDB.framework/Headers/TapDB.h new file mode 100755 index 0000000..43e987d --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Headers/TapDB.h @@ -0,0 +1,190 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef struct LoginType{ + NSString *loginType; +}TapDBLoginType; + +/* +自定义登录方式: +TapDBLoginType customLoginType = {@"custom"}; +*/ +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeTapTap; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeWeiXin; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeQQ; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeTourist; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeApple; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeZhifubao; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeFacebook; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeGoogle; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeTwitter; +FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypePhoneNumber; + +#define TapDBSDK @"TapDB" +#define TapDBSDK_VERSION_NUMBER @"30601001" +#define TapDBSDK_VERSION @"3.6.1" +//版本号 +static NSString *const TAPDB_VERSION = @"3.0.8"; + +@interface TapDB : NSObject +/** + Controls the access to IDFA + If not explicitly set, the default is NO + */ +@property (class, nonatomic, assign, getter=isAdvertiserIDCollectionEnabled) BOOL advertiserIDCollectionEnabled; + +/** + * 是否打开日志输出 + * enbale : YES 打开 NO 关闭 + */ ++ (void)enableLog:(BOOL)enable; + +/** + * 调用该接口修改数据发送的域名,有特殊需要时调用,调用必须位于初始化之前 + * 域名必须是https://abc.example.com/的格式,不能为空 + */ ++ (void)setHost:(NSString *)host; + +/** + * 调用该接口修改自定义事件数据发送的域名,有特殊需要时调用,调用必须位于初始化之前 + * 域名必须是https://abc.example.com/的格式,不能为空 + */ ++ (void)setCustomEventHost:(NSString *)host; + ++ (void)onStart:(NSString *)appId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion; +/** + * 初始化,尽早调用 + * appId: 注册游戏时获得的APP ID + * channel: 分包渠道名称,可为空 + * gameVersion: 游戏版本,可为空,为空时,自动获取游戏安装包的版本(Xcode配置中的Version) + * properties: 自定义属性 + */ ++ (void)onStart:(NSString *)appId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion properties:(nullable NSDictionary *)properties; + ++ (void)onStartWithClientId:(NSString *)clientId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion; + +//sm ++ (void)onStartWithClientId:(NSString *)clientId channel:(nullable NSString *)channel version:(nullable NSString *)gameVersion isCN:(BOOL)isCN; + +/** + * 初始化,尽早调用 + * 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; + ++ (void)setUser:(NSString *)userId; + ++ (void)setUser:(NSString *)userId properties:(nullable NSDictionary *)properties; +/// 对外隐藏接口 ++ (void)setUser:(NSString *)userId loginType:(TapDBLoginType)loginType; + +/// 记录一个用户(不是游戏角色!!!!),需要保证唯一性 +/// @param userId 用户ID。不同用户需要保证ID的唯一性 +/// @param loginType 登录方式 +/// @param properties 自定义属性 ++ (void)setUser:(NSString *)userId loginType:(TapDBLoginType)loginType properties:(nullable NSDictionary *)properties; + +/** + 登出清理用户 + */ ++ (void)clearUser; +/** + * 目前TapDB SDK仅支持单实例模式,如果多次调用onStart方法,只有最初传入的appid生效。调用该函数可以获取生效的信息 + * 返回值:包含appId和channel的NSDictionary,对应的value均可能为nil + */ ++ (NSDictionary *)getStartInfo; + +/// 获取当前的设备标识 ++ (NSString *)getDeviceId; + +/** + * 设置用户等级,初次设置时或升级时调用 + * level: 等级 + */ ++ (void)setLevel:(NSInteger)level; + +/** + * 设置用户服务器,初次设置或更改服务器的时候调用 + * server: 服务器 + */ ++ (void)setServer:(NSString *)server; + +/// 设置用户名 +/// @param name 必传,长度大于0并小于等于256,用户名 ++ (void)setName:(NSString *)name; + ++ (void)onChargeSuccess:(nullable NSString *)orderId product:(nullable NSString *)product amount:(NSInteger)amount currencyType:(nullable NSString *)currencyType payment:(nullable NSString *)payment; + +/** + * 充值成功时调用 + * orderId: 订单ID,可为空 + * product: 产品名称,可为空 + * amount: 充值金额(单位分,即无论什么币种,都需要乘以100) + * currencyType: 货币类型,可为空,参考:人民币 CNY,美元 USD;欧元 EUR + * payment: 支付方式,可为空,如:支付宝 + * properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数 + */ ++ (void)onChargeSuccess:(nullable NSString *)orderId product:(nullable NSString *)product amount:(NSInteger)amount currencyType:(nullable NSString *)currencyType payment:(nullable NSString *)payment properties:(nullable NSDictionary *)properties; +/** + * 自定义事件 + * eventName: 事件代码,需要在控制后台预先进行配置 + * properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数 + */ ++ (void)trackEvent:(NSString *)eventName properties:(NSDictionary *)properties; + +/** + * 自定义事件,即将弃用,请使用trackEvent接口 + * eventCode: 事件代码,需要在控制后台预先进行配置 + * properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数 + */ ++ (void)onEvent:(NSString *)eventCode properties:(NSDictionary *)properties DEPRECATED_MSG_ATTRIBUTE("已弃用,请按文档迁移到trackEvent接口"); + +#pragma mark - operation +/// 初始化设备属性操作 +/// @param properties 属性字典 ++ (void)deviceInitialize:(NSDictionary *)properties; + +/// 更新设备属性操作 +/// @param properties 属性字典 ++ (void)deviceUpdate:(NSDictionary *)properties; + +/// 设备属性增加操作 +/// @param properties 属性字典 暂时只支持数字属性 ++ (void)deviceAdd:(NSDictionary *)properties; + +/// 初始化用户属性操作 +/// @param properties 属性字典 ++ (void)userInitialize:(NSDictionary *)properties; + +/// 更新用户属性操作 +/// @param properties 属性字典 ++ (void)userUpdate:(NSDictionary *)properties; + +/// 用户属性增加操作 +/// @param properties 属性字典 暂时只支持数字属性 ++ (void)userAdd:(NSDictionary *)properties; + + +#pragma mark - properties +/// 添加静态事件属性,每个事件都将会发送 +/// @param staticProperties 属性字典 ++ (void)registerStaticProperties:(NSDictionary *)staticProperties; + +/// 删除添加的静态事件属性 ++ (void)clearStaticProperties; + +/// 删除添加的某个静态事件属性 +/// @param propertyName 属性Key ++ (void)unregisterStaticProperty:(NSString *)propertyName; + +/// 添加动态事件属性,每次发送事件会调用dynamicPropertiesCaculator +/// @param dynamicPropertiesCaculator 动态属性回调,需返回希望上传的属性字典 ++ (void)registerDynamicProperties:(NSDictionary* (^)(void))dynamicPropertiesCaculator; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapDB.framework/Headers/TapDB.h.meta b/Plugins/iOS/TapDB.framework/Headers/TapDB.h.meta new file mode 100644 index 0000000..4a95765 --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Headers/TapDB.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 10dd2bbc7d9ce4bbf85ec1dfe8481fbe +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework/Info.plist b/Plugins/iOS/TapDB.framework/Info.plist new file mode 100644 index 0000000..8541d05 Binary files /dev/null and b/Plugins/iOS/TapDB.framework/Info.plist differ diff --git a/Plugins/iOS/TapDB.framework/Info.plist.meta b/Plugins/iOS/TapDB.framework/Info.plist.meta new file mode 100644 index 0000000..b6df29b --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c08aae941e3cb4ed89a365e69e5cbafc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework/Modules.meta b/Plugins/iOS/TapDB.framework/Modules.meta new file mode 100644 index 0000000..49bf30d --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a647188afd8e142598c6421c3cb09712 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework/Modules/module.modulemap b/Plugins/iOS/TapDB.framework/Modules/module.modulemap new file mode 100644 index 0000000..eb75fdc --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module TapDB { + umbrella header "TapDB.h" + + export * + module * { export * } +} diff --git a/Plugins/iOS/TapDB.framework/Modules/module.modulemap.meta b/Plugins/iOS/TapDB.framework/Modules/module.modulemap.meta new file mode 100644 index 0000000..8feccaa --- /dev/null +++ b/Plugins/iOS/TapDB.framework/Modules/module.modulemap.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0eb9d8e3d636149cbae1aae9868ab138 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapDB.framework/TapDB b/Plugins/iOS/TapDB.framework/TapDB new file mode 100644 index 0000000..7c053db Binary files /dev/null and b/Plugins/iOS/TapDB.framework/TapDB differ diff --git a/Plugins/iOS/TapDB.framework/TapDB.meta b/Plugins/iOS/TapDB.framework/TapDB.meta new file mode 100644 index 0000000..2dc9411 --- /dev/null +++ b/Plugins/iOS/TapDB.framework/TapDB.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e993d592f396849d3ad05cddb9b19965 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapTap.TapDB.dll b/Plugins/iOS/TapTap.TapDB.dll new file mode 100644 index 0000000..be7b2f8 Binary files /dev/null and b/Plugins/iOS/TapTap.TapDB.dll differ diff --git a/Plugins/iOS/TapTap.TapDB.dll.meta b/Plugins/iOS/TapTap.TapDB.dll.meta new file mode 100644 index 0000000..417d665 --- /dev/null +++ b/Plugins/iOS/TapTap.TapDB.dll.meta @@ -0,0 +1,86 @@ +fileFormatVersion: 2 +guid: 6b9d184ffd380486991ba6e110497b3c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapTap.TapDB.pdb b/Plugins/iOS/TapTap.TapDB.pdb new file mode 100644 index 0000000..e7596f9 Binary files /dev/null and b/Plugins/iOS/TapTap.TapDB.pdb differ diff --git a/Plugins/iOS/TapTap.TapDB.pdb.meta b/Plugins/iOS/TapTap.TapDB.pdb.meta new file mode 100644 index 0000000..2e54bc6 --- /dev/null +++ b/Plugins/iOS/TapTap.TapDB.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 18b273c212bf34e70a62619e405d0e1d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md b/README.md new file mode 100644 index 0000000..08d6464 --- /dev/null +++ b/README.md @@ -0,0 +1,124 @@ +## [TapTap.TapDB](./Documentation/README.md) + +## 使用前提 + +使用 TapTap.TapDB 前提是必须依赖以下库: +* [TapTap.Common](https://github.com/TapTap/TapCommon-Unity.git) + +## 命名空间 + +```c# +using TapTap.TapDB; +``` + +## 接口描述 + +### 初始化 +```c# +TapDB.Init(string clientId, string channel, string gameVersion, bool isCN); +``` + +### 设置用户 + +```c# +TapDB.SetUser(string userId); + +TapDB.SetUser(string userId,string openId,string loginType); +``` + +### 设置姓名 + +```c# +TapDB.SetName(string name); +``` + +### 设置玩家等级 + +```c# +TapDB.SetLevel(int level); +``` + +### 设置服务器 + +```c# +TapDB.SetServer(string server); +``` + +### 充值成功 + +```c# +TapDB.OnCharge(string orderId, string productId, long amount, string currencyType, string payment); +``` + +### 自定义事件 + +```c# +TapDB.TrackEvent(string eventName,string jsonProperties); +``` + +### 注册静态事件 + +```c# +TapDB.RegisterStaticProperties(string jsonProperties); +``` + +### 取消静态事件 + +```c# +TapDB.UnregisterStaticProperty(string propertKey); +``` + +### 清除静态事件 + +```c# +TapDB.ClearStaticProperties(); +``` + +### 注册动态事件 +```c# +TapDB.RegisterDynamicProperties(IDynamicProperties properties); +``` + +### 设备初始化 + +```c# +TapDB.DeviceInitialize(string properties); +``` + +### 设备更新 + +```c# +TapDB.DeviceUpdate(string properties); +``` + +### 用户初始化 + +```c# +TapDB.UserInitialize(string properties); +``` + +### 用户更新 + +```c# +TapDB.UserUpdate(string properties); +``` + +### 添加用户 + +```c# +TapDB.UserAdd(string properties); +``` + +### 清除用户 + +```c# +TapDB.ClearUser(); +``` + +## iOS 独占方法 + +### 开启 IDFA + +```c# +TapDB.AdvertiserIDCollectionEnabled(bool enable); +``` \ No newline at end of file diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..fc06688 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c84aa94cf358345009bf80a38e997148 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VERSIONNOTE.md b/VERSIONNOTE.md new file mode 100644 index 0000000..2d6d86b --- /dev/null +++ b/VERSIONNOTE.md @@ -0,0 +1,3 @@ +### Dependencies + +- TapTap.Common v3.5.0 \ No newline at end of file diff --git a/VERSIONNOTE.md.meta b/VERSIONNOTE.md.meta new file mode 100644 index 0000000..608ce8f --- /dev/null +++ b/VERSIONNOTE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 330edada4cf9641faab01ba8b3818374 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..0e828ec --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "com.taptap.tds.tapdb", + "displayName": "TapTap TapDB", + "description": "TapTap Develop Service", + "version": "3.6.1", + "unity": "2018.3", + "license": "MIT", + "dependencies": { + "com.taptap.tds.common": "https://github.com/TapTap/TapCommon-Unity.git#3.6.1" + } +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..7322a56 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e9863969d8b544ce18213cf9c26147ba +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: