@chiyou/minigame-framework 1.3.3 → 1.3.5
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.
package/package.json
CHANGED
|
@@ -24,21 +24,6 @@ export interface UmengConfig {
|
|
|
24
24
|
debug?: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// ==================== 用户相关 ====================
|
|
28
|
-
|
|
29
|
-
/** 用户属性 */
|
|
30
|
-
export interface UserProperties {
|
|
31
|
-
userId?: string;
|
|
32
|
-
provider?: string;
|
|
33
|
-
nickName?: string;
|
|
34
|
-
avatarUrl?: string;
|
|
35
|
-
gender?: number;
|
|
36
|
-
country?: string;
|
|
37
|
-
province?: string;
|
|
38
|
-
city?: string;
|
|
39
|
-
[key: string]: any;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
27
|
// ==================== 预定义事件 ID ====================
|
|
43
28
|
|
|
44
29
|
/** 预定义事件 ID */
|
|
@@ -3,7 +3,7 @@ import { LogUtils } from "../Utils/LogUtils";
|
|
|
3
3
|
import { ServiceLocator } from "../Utils/ServiceLocator";
|
|
4
4
|
import { FwkErrorCode } from "../Definition/FwkErrorDefinition";
|
|
5
5
|
import { PlatformID } from "../Definition/SystemDefinition";
|
|
6
|
-
import { UmengConfig, EventParams,
|
|
6
|
+
import { UmengConfig, EventParams, AnalyticsEventId, AnalyticsParamKey } from "../Definition/AnalyticsDefinition";
|
|
7
7
|
import { UmaInitConfig, UmaSDK, uma as wxUma } from "../SDK/Umeng/umtrack-wx-game";
|
|
8
8
|
import { EventMgr } from "./EventMgr";
|
|
9
9
|
import { FrameworkBase } from "../Definition/FrameworkBase";
|
|
@@ -235,23 +235,6 @@ export class AnalyticsMgr extends BaseMgr {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
/**
|
|
239
|
-
* 设置用户属性
|
|
240
|
-
* @param properties 用户属性
|
|
241
|
-
*/
|
|
242
|
-
public setUserProperties(properties: UserProperties): void {
|
|
243
|
-
if (!this._isEnabled) return;
|
|
244
|
-
try {
|
|
245
|
-
this._sdk.setUserInfo(properties);
|
|
246
|
-
LogUtils.Instance.info(AnalyticsMgr.TAG, "设置用户属性");
|
|
247
|
-
} catch (e) {
|
|
248
|
-
LogUtils.Instance.error(AnalyticsMgr.TAG, FwkErrorCode.Analytics.SDKCallFailed, {
|
|
249
|
-
operation: "setUserProperties",
|
|
250
|
-
reason: String(e),
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
238
|
// ==================== 游戏特定事件 ====================
|
|
256
239
|
|
|
257
240
|
/** 关卡开始 */
|
|
@@ -32,23 +32,15 @@ export interface UmaInitConfig {
|
|
|
32
32
|
debug?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* 用户信息
|
|
37
|
-
*/
|
|
38
|
-
export interface UmaUserInfo {
|
|
39
|
-
nickName?: string;
|
|
40
|
-
avatarUrl?: string;
|
|
41
|
-
gender?: number;
|
|
42
|
-
country?: string;
|
|
43
|
-
province?: string;
|
|
44
|
-
city?: string;
|
|
45
|
-
language?: string;
|
|
46
|
-
age?: number;
|
|
47
|
-
constellation?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
35
|
/**
|
|
51
36
|
* 友盟 SDK 接口定义
|
|
37
|
+
*
|
|
38
|
+
* 注意:仅包含实际可用的方法(共12个)
|
|
39
|
+
* - 不可用方法(定义在 re 类但未代理到 pe):removeUserid, setUserInfo, setAnonymousid, setAppVersion, setSuperProperty
|
|
40
|
+
* - 插件方法(通过 pe.use 安装,已移除):revenue, stage, level, rc
|
|
41
|
+
* - 不可用方法(定义在 re 类但未代理到 pe):removeUserid, setUserInfo, setAnonymousid,
|
|
42
|
+
* setAppVersion, setSuperProperty
|
|
43
|
+
* - 插件方法(通过 pe.use 安装):revenue, stage, level, rc(已移除,不在接口中)
|
|
52
44
|
*/
|
|
53
45
|
export interface UmaSDK {
|
|
54
46
|
/** 初始化 */
|
|
@@ -71,33 +63,10 @@ export interface UmaSDK {
|
|
|
71
63
|
setUnionid(unionid: string): void;
|
|
72
64
|
/** 设置用户 ID */
|
|
73
65
|
setUserid(userid: string, provider?: string): void;
|
|
74
|
-
/** 移除用户 ID */
|
|
75
|
-
removeUserid(): void;
|
|
76
|
-
/** 设置用户信息 */
|
|
77
|
-
setUserInfo(userInfo: UmaUserInfo): void;
|
|
78
|
-
/** 设置匿名 ID */
|
|
79
|
-
setAnonymousid(anonymousid: string): void;
|
|
80
|
-
/** 设置应用版本 */
|
|
81
|
-
setAppVersion(version: string): void;
|
|
82
|
-
/** 设置超级属性 */
|
|
83
|
-
setSuperProperty(property: string): void;
|
|
84
66
|
/** 注册分享回调 */
|
|
85
67
|
onShareAppMessage(callback: () => object): void;
|
|
86
68
|
/** 调用分享 */
|
|
87
69
|
shareAppMessage(options: object): void;
|
|
88
|
-
/** 收入事件 */
|
|
89
|
-
revenue?: (params: { group: string; [key: string]: any }) => void;
|
|
90
|
-
/** 关卡事件 */
|
|
91
|
-
stage?: {
|
|
92
|
-
onStart: (params: { [key: string]: any }) => void;
|
|
93
|
-
onEnd: (params: { event: string; [key: string]: any }) => void;
|
|
94
|
-
onRunning: (params: { event: string; [key: string]: any }) => void;
|
|
95
|
-
};
|
|
96
|
-
/** 等级事件 */
|
|
97
|
-
level?: {
|
|
98
|
-
onInitLevel: (params: { [key: string]: any }) => void;
|
|
99
|
-
onSetLevel: (params: { [key: string]: any }) => void;
|
|
100
|
-
};
|
|
101
70
|
}
|
|
102
71
|
|
|
103
72
|
// ============================================
|