@thinkingai/ae-cli 6.0.60 → 6.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +6 -1
  2. package/README.zh.md +8 -1
  3. package/bin/runtime-capabilities.json +1 -1
  4. package/dist/{ai-monitor-FCXSLHAP.js → ai-monitor-X5GL44JT.js} +10 -9
  5. package/dist/ai-monitor.js +14 -13
  6. package/dist/{auth-ATK2SLEV.js → auth-SPQ46XQ3.js} +18 -10
  7. package/dist/{automation-FLCPFMN4.js → automation-7XC3VBZI.js} +87 -12
  8. package/dist/{capability-6KTSOI7L.js → capability-JZP4KXZC.js} +10 -9
  9. package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
  10. package/dist/{chunk-VRMGHQKE.js → chunk-2VKMHNUU.js} +11 -11
  11. package/dist/{chunk-2ETRY2CU.js → chunk-6HOM2FOJ.js} +19 -9
  12. package/dist/{chunk-KTJXD27G.js → chunk-AAN6KBUK.js} +3 -3
  13. package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
  14. package/dist/{chunk-6M7ZEDT2.js → chunk-BQFLABJQ.js} +11 -7
  15. package/dist/{chunk-BEYLCUZX.js → chunk-E457FREE.js} +3 -3
  16. package/dist/{chunk-CF6JTT2U.js → chunk-EFGUBGA6.js} +1 -1
  17. package/dist/{chunk-5M5LBRR3.js → chunk-ETQXIZFP.js} +15 -8
  18. package/dist/{chunk-72NJKS7O.js → chunk-F36ORPI6.js} +7 -32
  19. package/dist/{chunk-5E7MTTFN.js → chunk-F7TCQPQX.js} +23 -9
  20. package/dist/{chunk-AXTO4FTM.js → chunk-FGGEF7MI.js} +3 -3
  21. package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
  22. package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
  23. package/dist/{chunk-P7QDCWJ6.js → chunk-LFJ7N36I.js} +5 -1
  24. package/dist/chunk-N2MAYIRU.js +32 -0
  25. package/dist/chunk-NNK3JBH4.js +60 -0
  26. package/dist/{chunk-HTZ2MLYA.js → chunk-PLNS5J33.js} +11 -5
  27. package/dist/{chunk-HSZAIPUX.js → chunk-PRCHMOWT.js} +7 -5
  28. package/dist/chunk-PUSFEC6B.js +29 -0
  29. package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
  30. package/dist/{chunk-SDKW6LYE.js → chunk-RYY5NJK3.js} +3 -3
  31. package/dist/{chunk-QVRIDN42.js → chunk-UCMO4LKL.js} +2 -2
  32. package/dist/{chunk-VJUXKVRE.js → chunk-VR2D54AA.js} +2 -2
  33. package/dist/{chunk-HVMCPKOZ.js → chunk-YIG3L4RC.js} +1 -1
  34. package/dist/{chunk-LOR4IA26.js → chunk-YJYC5PLL.js} +166 -188
  35. package/dist/{chunk-F2VFZUGG.js → chunk-ZVUXAHEV.js} +2 -2
  36. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
  37. package/dist/{compat-check-XD2U7PZ2.js → compat-check-JD5D77ET.js} +5 -4
  38. package/dist/{config-U3GDWU6E.js → config-IIMRATTP.js} +7 -6
  39. package/dist/{context-YAQG6YQC.js → context-BXHIPIIX.js} +8 -6
  40. package/dist/{data-integration-QE37EQ3A.js → data-integration-VRJQ3HVK.js} +7 -6
  41. package/dist/{evaluation-2JSF4V47.js → evaluation-Q3AIGFOG.js} +5 -5
  42. package/dist/index.js +49 -43
  43. package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
  44. package/dist/{memory-WEB27VI6.js → memory-B44LY27L.js} +6 -7
  45. package/dist/{metadata-7FYE4234.js → metadata-ZVPG2MIA.js} +10 -9
  46. package/dist/{model-T7H7Q6BG.js → model-ANZBYVST.js} +4 -5
  47. package/dist/{personal-semantic-preference-O6VXM74A.js → personal-semantic-preference-YNCV4QG3.js} +45 -14
  48. package/dist/{project-semantic-2GGFJWW6.js → project-semantic-E7ZAQL5S.js} +9 -8
  49. package/dist/{sync-ULBB7WO5.js → sync-Y4OZRQAY.js} +9 -9
  50. package/dist/{te-agent-6RMF7LUV.js → te-agent-RKAUTYJZ.js} +303 -17
  51. package/dist/{te-analysis-HSYC7GNV.js → te-analysis-7N5VC4JB.js} +25 -20
  52. package/dist/{te-community-FLKZGQKB.js → te-community-SIA2UHTS.js} +13 -11
  53. package/dist/{te-dataops-OQQGTCUA.js → te-dataops-5MJQCODU.js} +13 -11
  54. package/dist/{te-engage-RIEBHL5T.js → te-engage-ZTLOMKO3.js} +73 -20
  55. package/dist/{te-kb-4HG2FMHJ.js → te-kb-LDL3MF2Y.js} +107 -25
  56. package/dist/{te-system-AL4B4XZL.js → te-system-473I5O53.js} +6 -7
  57. package/dist/{te-team-5O4UVUWE.js → te-team-JOWHCMZA.js} +92 -10
  58. package/dist/{things-TSJ64GBT.js → things-DOQ2L3O2.js} +9 -8
  59. package/dist/{update-Q5LURAWV.js → update-KUS6TCPB.js} +8 -6
  60. package/dist/{workspace-FF2HXJGR.js → workspace-MJFPIV7C.js} +6 -7
  61. package/package.json +6 -3
  62. package/skills/ae-agent/SKILL.md +19 -5
  63. package/skills/ae-agent/references/a2a.md +103 -0
  64. package/skills/ae-agent/references/command_index.md +11 -0
  65. package/skills/ae-analysis/SKILL.md +35 -23
  66. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  67. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  68. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  69. package/skills/ae-analysis/references/bad_case_review.md +4 -4
  70. package/skills/ae-analysis/references/command_index.md +7 -7
  71. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  72. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  73. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  74. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  75. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  76. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  77. package/skills/ae-analysis/references/project_owner_update.md +5 -1
  78. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  79. package/skills/ae-analysis/references/scenario_list.md +5 -6
  80. package/skills/ae-automation/SKILL.md +6 -2
  81. package/skills/ae-automation/references/cli.md +9 -3
  82. package/skills/ae-capability/SKILL.md +8 -4
  83. package/skills/ae-engage/SKILL.md +6 -1
  84. package/skills/ae-engage/references/common-metric.md +47 -1
  85. package/skills/ae-engage/references/flow-metric-update.md +1 -1
  86. package/skills/ae-engage/references/task-metric-update.md +1 -1
  87. package/skills/ae-kb/SKILL.md +11 -7
  88. package/skills/ae-kb/references/publication.md +45 -0
  89. package/skills/ae-kb/references/query-workflow.md +5 -1
  90. package/skills/ae-team/SKILL.md +7 -3
  91. package/skills/ae-team/references/copy-to-personal.md +7 -0
  92. package/skills/ae-team/references/promote.md +7 -0
  93. package/skills/ae-team/references/update.md +3 -3
  94. package/dist/chunk-Y74WTIKJ.js +0 -10
  95. package/skills/ae-tracking-matrix/SKILL.md +0 -170
  96. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  97. package/skills/ae-tracking-matrix/i18n.yaml +0 -12
  98. package/skills/ae-tracking-matrix/references/ae-capabilities.md +0 -93
  99. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +0 -30
  100. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +0 -256
  101. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +0 -213
  102. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +0 -407
  103. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +0 -218
  104. package/skills/ae-tracking-matrix/references/categories/casual_music.md +0 -112
  105. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +0 -301
  106. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +0 -356
  107. package/skills/ae-tracking-matrix/references/categories/fishing.md +0 -775
  108. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +0 -89
  109. package/skills/ae-tracking-matrix/references/categories/idle_card.md +0 -27
  110. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +0 -415
  111. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +0 -133
  112. package/skills/ae-tracking-matrix/references/categories/merge.md +0 -639
  113. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +0 -406
  114. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +0 -230
  115. package/skills/ae-tracking-matrix/references/categories/music.md +0 -137
  116. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +0 -414
  117. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +0 -199
  118. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +0 -158
  119. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +0 -546
  120. package/skills/ae-tracking-matrix/references/categories/rpg.md +0 -195
  121. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +0 -115
  122. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +0 -151
  123. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +0 -260
  124. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +0 -232
  125. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +0 -359
  126. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +0 -365
  127. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +0 -211
  128. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +0 -132
  129. package/skills/ae-tracking-matrix/references/category-registry.md +0 -77
  130. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +0 -230
  131. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +0 -406
  132. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +0 -128
  133. package/skills/ae-tracking-matrix/references/eval-cases.md +0 -74
  134. package/skills/ae-tracking-matrix/references/naming-dict.md +0 -238
  135. package/skills/ae-tracking-matrix/references/optimization-checklist.md +0 -85
  136. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +0 -142
  137. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +0 -47
  138. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +0 -794
  139. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +0 -94
  140. package/skills/ae-tracking-matrix/references/scene-routing.md +0 -80
  141. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +0 -3787
  142. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +0 -827
  143. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +0 -655
  144. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +0 -953
  145. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +0 -1128
  146. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +0 -714
  147. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +0 -1268
  148. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +0 -776
  149. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +0 -182
  150. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +0 -2755
  151. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +0 -1182
  152. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +0 -1300
  153. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +0 -1369
  154. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +0 -1692
  155. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +0 -902
  156. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +0 -763
  157. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +0 -1107
  158. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +0 -1532
  159. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +0 -845
  160. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +0 -228
  161. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +0 -149
  162. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +0 -407
  163. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +0 -163
  164. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +0 -149
  165. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +0 -153
  166. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +0 -232
  167. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +0 -314
  168. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +0 -117
  169. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +0 -148
  170. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +0 -645
  171. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +0 -307
  172. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +0 -347
  173. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +0 -72
  174. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +0 -264
  175. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +0 -566
  176. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +0 -409
  177. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +0 -446
  178. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +0 -557
  179. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +0 -457
  180. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +0 -490
  181. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +0 -523
  182. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +0 -484
  183. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +0 -442
  184. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +0 -391
  185. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +0 -91
  186. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +0 -635
  187. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +0 -113
  188. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +0 -466
  189. package/skills/ae-tracking-matrix/references/standard-base/README.md +0 -22
  190. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +0 -174
  191. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +0 -20
  192. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +0 -7
  193. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +0 -14
  194. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +0 -370
  195. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +0 -47
  196. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +0 -37
  197. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +0 -27
  198. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +0 -23
  199. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +0 -14
  200. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +0 -46
  201. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +0 -13
  202. package/skills/ae-tracking-matrix/references/system-fields.md +0 -297
  203. package/skills/ae-tracking-matrix/references/te-field-translations.md +0 -1791
  204. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +0 -232
  205. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +0 -829
  206. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +0 -355
  207. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +0 -283
  208. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +0 -168
  209. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +0 -205
  210. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +0 -75
  211. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +0 -36
  212. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +0 -107
  213. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +0 -114
  214. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +0 -53
  215. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +0 -166
  216. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +0 -674
  217. package/skills/ae-tracking-matrix/scripts/plan_contract.py +0 -200
  218. package/skills/ae-tracking-matrix/scripts/plan_types.py +0 -60
  219. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +0 -169
  220. package/skills/ae-tracking-matrix/scripts/sync_plan.py +0 -296
  221. package/skills/ae-tracking-matrix/scripts/upload_plan.py +0 -340
@@ -1,655 +0,0 @@
1
- ---
2
- code: cocos2d_lua_sdk_installation
3
- name: "Cocos2d-Lua"
4
- wikiToken: QmTDwzv5mi9NVekISpKcwfJNnRc
5
- parentWikiToken: BAU2w0eipiqGnckeUsIc0mYQnZc
6
- updateTime: 1745310884000
7
- sourceUrl: https://docs-v2.thinkingdata.cn/?version=6.0&lan=zh-CN&code=cocos2d_lua_sdk_installation
8
- ---
9
-
10
- # Cocos2d-Lua
11
-
12
- ::: tip Note
13
-
14
- Before integration, please read the Pre-installation Guide first.
15
-
16
- Cocos2d-Lua SDK supports running on iOS and Android platforms, size approximately 7.1M
17
-
18
- :::
19
-
20
- **Latest Version:** v2.0.2
21
-
22
- **Update Time:** 2024-01-19
23
-
24
- **Resource Download:** Source Code, SDK Download
25
-
26
- ::: warning Warning
27
-
28
- This document applies to v2.0.0 and later versions, for historical versions please refer to Cocos2d-Lua Integration Guide (V1), SDK Download (v1.0.1)
29
-
30
- :::
31
-
32
- ### I. Integrate SDK
33
-
34
- - **Add Cocos2d-Lua Configuration**
35
- - Download Cocos2d-Lua SDK resource files, unzip the files and add `TDAnalytics.lua` to the `src` folder
36
- - **Add Android Configuration**
37
- - Create a `libs` folder in `frameworks/runtime-src/proj.android/app` directory, and add `TDAnalytics.aar` and `TDCore.aar` to the `libs` folder
38
- - Add `TDAnalyticsProxy.java` in `frameworks/runtime-src/proj.android/app/src/org/cocos2dx/lua` directory
39
- - Add the following configuration in `CMakeLists.txt`
40
-
41
- ```
42
- if(ANDROID)
43
- list(APPEND GAME_SOURCE
44
- # ... Add the following code
45
- ${RUNTIME_SRC_ROOT}/proj.android/app/src/org/cocos2dx/lua/TDAnalyticsProxy.java
46
- ${RUNTIME_SRC_ROOT}/proj.android/app/libs/TDCore.aar
47
- ${RUNTIME_SRC_ROOT}/proj.android/app/libs/TDAnalytics.aar
48
- )
49
- endif()
50
- ```
51
-
52
- - Add the following configuration in `build.gradle` under `frameworks/runtime-src/proj.android/app` directory
53
-
54
- ```
55
- dependencies {
56
- // Add .aar reference
57
- implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
58
- }
59
- ```
60
-
61
- - **Add iOS Configuration (Cocos2d-Lua-Community 4.x)**
62
- - Add `TDAnalyticsProxy.h`, `TDAnalyticsProxy.mm`, and `ThinkingSDK.framework` to `frameworks/runtime-src/proj.ios_mac/ios` directory
63
- - Add the following configuration in `CMakeLists.txt`
64
-
65
- ```
66
- if(APPLE)
67
- if(IOS)
68
- list(APPEND GAME_HEADER
69
- # [TDAnalytics] Add the following code
70
- ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/TDAnalyticsProxy.h
71
- )
72
- list(APPEND GAME_SOURCE
73
- # [TDAnalytics] Add the following code
74
- ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/TDAnalyticsProxy.mm
75
- ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/ThinkingSDK.framework
76
- )
77
- endif()
78
- endif()
79
-
80
- if(IOS)
81
- # [TDAnalytics] Add the following code
82
- target_link_libraries(${APP_NAME} ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/ThinkingSDK.framework)
83
- endif()
84
-
85
- if(IOS)
86
- # [TDAnalytics] Add the following code
87
- set(CMAKE_EXE_LINKER_FLAGS -ObjC)
88
- endif()
89
- ```
90
-
91
- - **Add iOS Configuration (Cocos2d-Lua-Community 3.x)**
92
- - Open `iOS` project with Xcode, directly drag and drop the `iOS` folder from the SDK directory into the `Classes` directory
93
- - Add `-force_load "$(SRCROOT)/ios/ThinkingSDK.framework/ThinkingSDK"` for both `Debug` and `Release` in `Build Setting` -> `Other Linker Flags`
94
-
95
- ### II. Initialization
96
-
97
- ```
98
- local TDAnalytics = require("TDAnalytics")
99
- TDAnalytics.init(APPID, SERVER_URL, TDAnalytics.debugModel.debugOff)
100
- ```
101
-
102
- Parameter description:
103
-
104
- - `APPID`: Your project's APPID, can be obtained from TE backend project management page
105
- - `SERVER_URL`: URL for data upload
106
- - If you are connecting to cloud service, enter: https://global-receiver-ta.thinkingdata.cn
107
- - If you are using a privately deployed version, please bind a domain name for the data collection address and configure HTTPS certificate: https://your-data-collection-domain
108
- <!-- unsupported block: 34 -->
109
-
110
- Since Android 9.0+ restricts HTTP requests by default, please use HTTPS protocol
111
-
112
- ### III. Common Features
113
-
114
- Before using common features, we recommend that you first understand the user identification rules; SDK will generate a random number as a visitor ID by default, and persistently store the visitor ID locally; before the user logs in, the visitor ID will be used as the identity identification ID. Note: The visitor ID will change when the user reinstalls the App or changes the device.
115
-
116
- #### 3.1 Set Account ID
117
-
118
- When a user logs in, you can call `login` to set the user's account ID. The TE platform will use the account ID as the identity identification ID, and the set account ID will be retained until `logout` is called. Calling `login` multiple times will override the previous account ID.
119
-
120
- ```
121
- --The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
122
- TDAnalytics.login("TA")
123
- ```
124
-
125
- `login` can be called multiple times. Each call will determine whether the passed account ID is consistent with the previously saved ID. If consistent, the call will be ignored; if inconsistent, the previous ID will be overridden.
126
-
127
- <!-- unsupported block: 34 -->
128
-
129
- **This method will not upload a login event**
130
-
131
- #### 3.2 Set Public Event Properties
132
-
133
- Public event properties refer to properties that will be present in every event. You can call `setSuperProperties` to set public event properties. We recommend that you set public event properties before sending events. For some important properties, such as user membership level, source channel, etc., these properties need to be set in every event, you can set these properties as public event properties.
134
-
135
- ```
136
- local superProperties = {}
137
- superProperties["channel"] = "ta" -- string
138
- superProperties["age"] = 1 -- number
139
- superProperties["isSuccess"] = true -- boolean
140
- superProperties["birthday"] = os.date("%Y-%m-%d %H:%M:%S") -- time
141
- superProperties["object"] = { key="value" } -- object
142
- superProperties["object_arr"] = { { key="value" } } -- object array
143
- superProperties["arr"] = { "value" } -- array
144
- TDAnalytics.setSuperProperties(superProperties) -- Set public event properties
145
- ```
146
-
147
- Public event properties will be saved to the cache and do not need to be called every time the App starts. If you call `setSuperProperties` to upload a previously set public event property, it will override the previous property.
148
-
149
- - Key is the property name, is a string type, can only start with a letter, contain numbers, letters and underscores "\_", maximum length 50 characters, case-insensitive, TE will uniformly convert to lowercase letters
150
- - Value is the property value, supports string, number, boolean, time, object, object array, array
151
- <!-- unsupported block: 34 -->
152
-
153
- **Event properties and user properties requirements are the same as public event properties**
154
-
155
- #### 3.3 Enable Auto-tracking
156
-
157
- The following code example enables installation, start, and end events. If you want to learn more about SDK's auto-tracking capabilities, you can view the Auto-tracking Feature Introduction
158
-
159
- ```
160
- TDAnalytics.enableAutoTrack( {
161
- appInstall = true,
162
- appStart = true,
163
- appEnd = true
164
- });
165
- ```
166
-
167
- #### 3.4 Send Event
168
-
169
- You can call `track` to upload events. It is recommended that you set event properties and conditions for sending information based on your previously documented tracking plan. Here is an example of a user purchasing a product:
170
-
171
- ```
172
- TDAnalytics.track("product_buy", {
173
- product_name="Product Name"
174
- });
175
- ```
176
-
177
- The event name is a string type, can only start with a letter, can contain numbers, letters and underscores "\_", maximum length 50 characters.
178
-
179
- #### 3.5 Set User Properties
180
-
181
- For general user properties, you can call `userSet` to set them. Properties uploaded using this interface will override existing property values. If the user property did not exist before, it will be created with the same type as the uploaded property. Here is an example of setting the username:
182
-
183
- ```
184
- -- At this time username is TA
185
- TDAnalytics.userSet({
186
- user_name = "TA"
187
- })
188
- -- At this time username is TE
189
- TDAnalytics.userSet({
190
- user_name = "TE"
191
- })
192
- ```
193
-
194
- ### IV. Best Practices
195
-
196
- The following example code includes all the above operations. We recommend following these steps:
197
-
198
- ```
199
- -- Import TDAnalytics
200
- local TDAnalytics = require("TDAnalytics")
201
-
202
- if (Privacy Policy Authorization) {
203
- -- Initialize SDK
204
- TDAnalytics.init(APP_ID, SERVER_URL, TDAnalytics.debugModel.debugOff);
205
- --Enable auto-tracking events
206
- TDAnalytics.enableAutoTrack( {
207
- appInstall = true,
208
- appStart = true,
209
- appEnd = true
210
- });
211
- --If the user has logged in, you can set the user's account ID as the unique identifier
212
- TDAnalytics.login("TA")
213
-
214
- --After setting public event properties, every event will have public event properties
215
- local superProperties = {}
216
- superProperties["channel"] = "ta" -- string
217
- superProperties["age"] = 1 -- number
218
- superProperties["isSuccess"] = true -- boolean
219
- superProperties["birthday"] = os.date("%Y-%m-%d %H:%M:%S") -- time
220
- superProperties["object"] = { key="value" } -- object
221
- superProperties["object_arr"] = { { key="value" } } -- object array
222
- superProperties["arr"] = { "value" } -- array
223
- TDAnalytics.setSuperProperties(superProperties) -- Set public event properties
224
-
225
- --Send event
226
- TDAnalytics.track("product_buy", {
227
- product_name="Product Name"
228
- });
229
-
230
- --Set user properties
231
- TDAnalytics.userSet({
232
- user_name = "TE"
233
- })
234
- }
235
- ```
236
-
237
- ###
238
-
239
- ---
240
-
241
- # Advanced Guide
242
-
243
- ### I. Set User ID
244
-
245
- The SDK instance defaults to using a random number as the default visitor ID for each user, which will serve as the identity identification ID for users in an unauthenticated state. Note that the visitor ID will change when the user reinstalls the App or changes the device.
246
-
247
- #### 1.1 Set Visitor ID
248
-
249
- ::: tip Note
250
-
251
- Generally, you do not need to customize the visitor ID. Please ensure you understand the user identification rules before setting the visitor ID.
252
-
253
- If you need to replace the visitor ID, you should call it immediately after initializing the SDK. Do not call it multiple times to avoid creating unnecessary accounts.
254
-
255
- :::
256
-
257
- If your game has its own visitor ID management system for each user, you can call `setDistinctId` to set the visitor ID:
258
-
259
- ```
260
- // Set the visitor ID to "Thinker"
261
- TDAnalytics.setDistinctId("Thinker");
262
- ```
263
-
264
- If you need to get the current visitor ID, you can call `getDistinctId`:
265
-
266
- ```
267
- //Return visitor ID
268
- local distinctId = TDAnalytics.getDistinctId();
269
- ```
270
-
271
- #### 1.2 Set Account ID
272
-
273
- When a user logs in, you can call `login` to set the user's account ID. The TE platform will use the account ID as the identity identification ID, and the set account ID will be retained until `logout` is called. Calling `login` multiple times will override the previous account ID.
274
-
275
- ```
276
- --The user's unique login identifier, this data corresponds to #account_id in the reported data, at this time #account_id is "TA"
277
- TDAnalytics.login("TA");
278
- ```
279
-
280
- <!-- unsupported block: 34 -->
281
-
282
- **This method will not upload a login event**
283
-
284
- #### 1.3 Clear Account ID
285
-
286
- After a user logs out, you can call `logout` to clear the account ID. Before calling `login` again, the visitor ID will be used as the identity identification ID.
287
-
288
- ```
289
- TDAnalytics.logout();
290
- ```
291
-
292
- We recommend that you call `logout` only when there is an explicit logout behavior, such as when the user actively cancels their account, rather than when the App is closed.
293
-
294
- <!-- unsupported block: 34 -->
295
-
296
- **This method will not upload a logout event**
297
-
298
- ### II. Send Events
299
-
300
- After the SDK initialization is complete, you can perform data tracking and collect user behavior information. Generally, ordinary events can meet business scenario requirements. You can also use first-time events, updatable events, etc. according to your actual business scenarios.
301
-
302
- #### 2.1 Ordinary Events
303
-
304
- You can call `track` to upload events. We recommend that you set event properties and conditions for sending events based on your previously documented tracking plan. Here is an example of a user purchasing a product:
305
-
306
- ```
307
- local properties = {
308
- product_name = "Product Name"
309
- }
310
- TDAnalytics.track("product_buy", properties)
311
- ```
312
-
313
- #### 2.2 First-time Event
314
-
315
- First-time events refer to events that will only be recorded once for a certain device or other dimensional ID. For example, in some scenarios, you may want to record an activation event on a certain device, then you can use first-time events to report the data.
316
-
317
- ```
318
- -- Example: Report device first-time event, assuming event name is device_activation
319
- TDAnalytics.trackFirst("device_activation", nil, {
320
- test_string="first_string"
321
- })
322
- ```
323
-
324
- If you want to determine whether it is the first time based on other dimensions other than the device, you can customize the first_check_id for the first-time event:
325
-
326
- ```
327
- -- Set the user ID as the first_check_id of the first-time event to implement the collection of user first activation event
328
- TDAnalytics.trackFirst("account_activation", "TA", {
329
- test_string="first_string"
330
- })
331
- ```
332
-
333
- <!-- unsupported block: 34 -->
334
-
335
- Note: Since the verification of whether it is the first time is completed on the server side, first-time events will be delayed by 1 hour before entering the database by default.
336
-
337
- #### 2.3 Updatable Events
338
-
339
- You can implement the need to modify event data in specific scenarios through updatable events. Updatable events need to specify an ID that identifies the event, and pass it when creating the updatable event object. The TE backend will determine the data to be updated based on the event name and event ID.
340
-
341
- ```
342
- -- Example: Report an event that can be updated, assuming the event name is UPDATABLE_EVENT
343
- -- After reporting, the event property status is 3, price is 100
344
- TDAnalytics.trackUpdate("UPDATABLE_EVENT", "Update_EventId", {
345
- status = 3,
346
- price = 100
347
- })
348
-
349
- -- After reporting, the event property status is updated to 5, price remains unchanged
350
- TDAnalytics.trackUpdate("UPDATABLE_EVENT", "Update_EventId", {
351
- status = 5
352
- })
353
- ```
354
-
355
- #### 2.4 Overwritable Events
356
-
357
- Overwritable events are similar to updatable events, the difference is that overwritable events will completely overwrite historical data with the latest data, which effectively is equivalent to deleting the previous data and storing the latest data. The TE backend will determine the data to be updated based on the event name and event ID.
358
-
359
- ```
360
- -- Example: Report an event that can be overwritten, assuming the event name is OVERWRITABLE_EVENT
361
- TDAnalytics.trackOverwrite("OVERWRITABLE_EVENT", "Overwrite_EventId", {
362
- status = 3,
363
- price = 100
364
- })
365
-
366
- -- After reporting, the event property status is updated to 5, price property is deleted
367
- TDAnalytics.trackOverwrite("OVERWRITABLE_EVENT", "Overwrite_EventId", {
368
- status = 5
369
- })
370
- ```
371
-
372
- #### 2.5 Public Event Properties
373
-
374
- Public event properties refer to properties that will be uploaded with every event. Based on the property update frequency, public event properties are divided into `static public event properties` and `dynamic public event properties`. You can choose different public event property setting methods according to your specific business scenario requirements; we recommend that you set public event properties before sending events. For the same event, when the Key of public event properties, event custom properties, and preset properties are the same, we will assign values according to the following priority: `Custom Properties > Dynamic Public Event Properties > Static Public Event Properties > Preset Properties`.
375
-
376
- ##### 2.5.1 Static Public Event Properties
377
-
378
- Static public event properties are properties that change infrequently and are present in every event, such as user membership level. After setting static public event properties through `setSuperProperties`, the SDK will obtain the set public event properties as event properties when collecting events.
379
-
380
- ```
381
- -- Set public properties
382
- TDAnalytics.setSuperProperties({
383
- vip_level = 2
384
- })
385
- ```
386
-
387
- Static public event properties will be saved to the cache and do not need to be called every time the App starts. If the property already exists, the newly set property will override the original property value; if the property did not exist before, a new property will be created. Besides setting properties, we also provide other APIs to operate static public event properties to meet daily business needs.
388
-
389
- ```
390
- -- Clear the public property named trip
391
- TDAnalytics.unsetSuperProperty("trip")
392
- -- Clear all public properties
393
- TDAnalytics.clearSuperProperties()
394
- -- Get all public properties
395
- TDAnalytics.currentSuperProperties()
396
- ```
397
-
398
- ##### 2.5.2 Dynamic Public Event Properties
399
-
400
- Dynamic public event properties are properties that change frequently and are present in every event, such as the number of gold coins a user has. After setting the dynamic public property class through `setDynamicSuperProperties`, the SDK will automatically obtain dynamic public event properties during event collection and add them to the triggered event.
401
-
402
- ```
403
- local coin = 0;
404
- local dynamicProperties = function()
405
- coin++
406
- local properties = { coin = coin }
407
- return properties
408
- end
409
- TDAnalytics.setDynamicSuperProperties(dynamicProperties);
410
- ```
411
-
412
- #### 2.6 Record Event Duration
413
-
414
- If you need to record the duration of an event, you can call `timeEvent` to start timing. Configure the event name you want to time. When you upload that event, a `#duration` property will automatically be added to your event properties to represent the recorded duration in seconds. Note that only one timing task can exist for the same event name.
415
-
416
- ```
417
- --The following example completes the statistics of the user's stay duration on a certain product page
418
- -- User enters the product page, start timing
419
- TDAnalytics.timeEvent("stay_shop")
420
- -- do some thing...
421
- -- User leaves the product page, timing ends, the "stay_shop" event will have a property #duration representing the event duration
422
- TDAnalytics.track("stay_shop", {})
423
- ```
424
-
425
- ### III. User Properties
426
-
427
- The user property setting APIs supported by TE platform are: `userSet()`, `userSetOnce()`, `userAdd()`, `userAppend()`, `userUnset()`, `userDelete()`.
428
-
429
- #### 3.1 userSet
430
-
431
- For general user properties, you can call `userSet` to set them. Properties uploaded using this interface will override existing property values. If the user property did not exist before, it will be created with the same type as the uploaded property. Here is an example of setting the username
432
-
433
- ```
434
- -- At this time username is TA
435
- TDAnalytics.userSet({
436
- user_name = "TA"
437
- })
438
- -- At this time username is TE
439
- TDAnalytics.userSet({
440
- user_name = "TE"
441
- })
442
- ```
443
-
444
- #### 3.2 userSetOnce
445
-
446
- If you need to upload user properties that should only be set once, you can call `userSetOnce` to set them. When the property already has a value, this information will be ignored. Here is an example of setting the first payment time:
447
-
448
- ```
449
- --first_payment_time is 2018-01-01 01:23:45.678
450
- TDAnalytics.userSetOnce({
451
- first_payment_time = "2018-01-01 01:23:45.678"
452
- })
453
- -- first_payment_time is still 2018-01-01 01:23:45.678
454
- TDAnalytics.userSetOnce({
455
- first_payment_time = "2018-12-31 01:23:45.678"
456
- })
457
- ```
458
-
459
- #### 3.3 userAdd
460
-
461
- When you need to upload numeric properties, you can call `userAdd` to perform an accumulation operation on the property. If the property has not been set, it will be assigned 0 before calculation. Negative values can be passed, which is equivalent to a subtraction operation. Here is an example of accumulating total payment amount:
462
-
463
- ```
464
- -- At this time total_revenue is 30
465
- TDAnalytics.userAdd({
466
- total_revenue = 30
467
- })
468
- -- At this time total_revenue is 678
469
- TDAnalytics.userAdd({
470
- total_revenue = 648
471
- })
472
- ```
473
-
474
- <!-- unsupported block: 34 -->
475
-
476
- The property key is a string, and Value only allows numeric values.
477
-
478
- #### 3.4 userAppend
479
-
480
- You can call `userAppend()` to append elements to `Array` type user properties:
481
-
482
- ```
483
- -- Append list type user properties
484
- TDAnalytics.userAppend({
485
- weapon = {"m41", "bulldog"}
486
- })
487
- ```
488
-
489
- #### 3.5 userUnset
490
-
491
- If you need to reset a user's property, you can call `userUnset()` to clear the value of a specified user property. This interface supports passing string type parameters:
492
-
493
- ```
494
- -- Clear specified user property
495
- TDAnalytics.userUnset("age")
496
- ```
497
-
498
- <!-- unsupported block: 34 -->
499
-
500
- The passed value is the Key of the property to be cleared.
501
-
502
- #### 3.6 userDelete
503
-
504
- If you need to delete a user, you can call `userDelete()` to delete that user. You will no longer be able to query that user's user properties, but the events generated by that user can still be queried.
505
-
506
- ```
507
- -- Delete user
508
- TDAnalytics.userDelete()
509
- ```
510
-
511
- ### IV. Other Features
512
-
513
- #### 4.1 Get Device ID
514
-
515
- After SDK initialization is complete, SDK will automatically generate a device ID and record it in local cache. For the same application or game, the device ID of one device is unchanged. You can call `getDeviceId()` to get the device ID:
516
-
517
- ```
518
- -- Get Device ID
519
- TDAnalytics.getDeviceId()
520
- ```
521
-
522
- ---
523
-
524
- # Real-time Debugging
525
-
526
- #### I. Print SDK Logs
527
-
528
- ```
529
- -- Enable log printing
530
- -- logLevelNone: Log printing off
531
- -- logLevelError: Print error logs
532
- -- logLevelInfo: Print detailed logs
533
- -- logLevelDebug: Print debug logs
534
- TDAnalytics.setLogLevel(TDAnalytics.logLevel.logLevelDebug)
535
- ```
536
-
537
- <!-- unsupported block: 34 -->
538
-
539
- After enabling logs, you can filter ThinkingData related logs in the IDE to observe SDK data reporting.
540
-
541
- #### II. Enable Debug Mode
542
-
543
- Enabling Debug mode requires the following two steps:
544
-
545
- 1. Enable Debug mode on the client side
546
- The following is an example code for enabling Debug mode on the client side:
547
-
548
- ```
549
- --[[
550
- Set the running mode to Debug mode
551
- debugOff mode: Data will be stored in cache and reported according to a certain cache strategy. Default is NORMAL mode; recommended for production environment
552
- debugOn mode: Data is reported one by one. When problems occur, users will be prompted with logs and exceptions; not recommended for production environment
553
- debugOnly mode: Only validates data, will not be stored in database; not recommended for production environment
554
- ]]
555
- TDAnalytics.init(APP_ID, SERVER_URL, TDAnalytics.debugModel.debugOn)
556
- ```
557
-
558
- 1. Add Debug device in TE backend
559
- To prevent Debug mode from being launched in production environments, only specified devices can enable Debug mode. Debug mode can only be enabled if Debug mode is enabled on the client side and the device ID is configured in the "Debug Data" section of the "Tracking Management" page in TE backend.
560
-
561
- Device ID can be obtained through the following three ways:
562
-
563
- - The #device_id property in event data in TE platform
564
- - Client logs: SDK will print device DeviceId after initialization completes
565
- - Through instance interface call: Get Device ID
566
- <!-- unsupported block: 34 -->
567
-
568
- Debug mode may affect data collection quality and App stability, it is only used for data verification during integration stage, do not use it in production environment.
569
-
570
- ---
571
-
572
- # Auto-tracking
573
-
574
- TDAnalytics SDK provides auto-tracking for three types of events:
575
-
576
- - `appInstall`: Game installation, this event will be collected when the game is first opened after installation (event name `ta_app_install`)
577
- - `appStart`: This event will be collected when the game enters foreground (event name `ta_app_start`)
578
- - `appEnd`: This event will be collected when the game exits to background (event name `ta_app_end`)
579
- Auto-tracking can be enabled by calling the `enableAutoTrack()` interface:
580
-
581
- ```
582
- -- Enable auto-tracking Default false: off, true: on
583
- local autoTack = {
584
- appInstall = true, -- Enable auto-tracking installation event
585
- appStart = true, -- Enable auto-tracking start event
586
- appEnd = true -- Enable auto-tracking end event
587
- }
588
- TDAnalytics.enableAutoTrack(autoTack)
589
- ```
590
-
591
- <!-- unsupported block: 34 -->
592
-
593
- Note: If you need to customize the visitor ID, please be sure to call the `setDistinctId` interface to set the visitor ID before enabling the auto-tracking feature.
594
-
595
- ###
596
-
597
- ---
598
-
599
- # Preset Properties
600
-
601
- #### I. Preset Properties Description
602
-
603
- <!-- unsupported block: 34 -->
604
-
605
- Preset properties collected by each platform will have certain differences. For details, please refer to the following documents: Android Platform, iOS Platform
606
-
607
- #### II. Get Preset Properties
608
-
609
- When server-side tracking needs some preset properties from the App side, you can get the preset properties from the App side through this method and pass them to the server side.
610
-
611
- ```
612
- -- Get property object
613
- local presetProperties = TDAnalytics.getPresetProperties()
614
-
615
- -- Generate event preset properties
616
- local properties = presetProperties.toEventPresetProperties()
617
- --[[
618
- {
619
- "#carrier": "China Telecom",
620
- "#os": "Android",
621
- "#device_id": "abb8e87bfb5ce66c",
622
- "#screen_height": 2264,
623
- "#bundle_id": "com.sw.thinkingdatademo",
624
- "#manufacturer": "realme",
625
- "#device_model": "RMX1991",
626
- "#screen_width": 1080,
627
- "#system_language": "zh",
628
- "#os_version": "10",
629
- "#network_type": "WIFI",
630
- "#zone_offset": 8,
631
- "#app_version":"1.0"
632
- }
633
- ]]--
634
-
635
- -- Get a specific preset property
636
- local bundleId = presetProperties.bundleId -- Package name
637
- local mOS = presetProperties.os -- System type, such as Android/iOS
638
- local systemLanguage = presetProperties.systemLanguage -- Mobile system language type
639
- local screenWidth = presetProperties.screenWidth -- Screen width
640
- local screenHeight = presetProperties.screenHeight -- Screen height
641
- local deviceModel = presetProperties.deviceModel -- Device model
642
- local deviceId = presetProperties.deviceId -- Device unique identifier
643
- local carrier = presetProperties.carrier -- Mobile SIM card carrier information, for dual SIM dual standby, take the main card's carrier information
644
- local manufacture = presetProperties.manufacturer -- Mobile manufacturer, such as HuaWei
645
- local networkType = presetProperties.networkType -- Network type
646
- local osVersion = presetProperties.osVersion -- System version number
647
- local appVersion = presetProperties.appVersion -- app version number
648
- local zoneOffset = presetProperties.zoneOffset -- Timezone offset value
649
- ```
650
-
651
- <!-- unsupported block: 34 -->
652
-
653
- IP, country and city information are generated by server-side analysis, client does not provide interface to get these properties
654
-
655
- ###