Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-05-06 09:54:36 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b233489b461ea704afc6f55e0072652a238d2b3d
b233489b
1 parent
c9b1e177
ref |> Revert "ref |> 新增友盟统计"
This reverts commit
c2ed18de
.
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
73 deletions
sight_harmony/AppScope/resources/rawfile/umconfig.json
sight_harmony/commons/wdKit/Index.ets
sight_harmony/commons/wdKit/oh-package.json5
sight_harmony/commons/wdKit/src/main/ets/umeng/UmengStats.ets
sight_harmony/products/phone/src/main/ets/entryability/EntryAbility.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchPage.ets
sight_harmony/AppScope/resources/rawfile/umconfig.json
deleted
100644 → 0
View file @
c9b1e17
{
"appKey"
:
"662f39fecac2a664de284236"
,
"channel"
:
"rmrb_china_0000"
}
\ No newline at end of file
sight_harmony/commons/wdKit/Index.ets
View file @
b233489
...
...
@@ -49,5 +49,3 @@ export { NetworkUtil } from './src/main/ets/utils/NetworkUtil'
export { NetworkManager } from './src/main/ets/network/NetworkManager'
export { NetworkType } from './src/main/ets/network/NetworkType'
export { UmengStats } from "./src/main/ets/umeng/UmengStats"
\ No newline at end of file
...
...
sight_harmony/commons/wdKit/oh-package.json5
View file @
b233489
...
...
@@ -6,8 +6,5 @@
"description"
:
"Please describe the basic information."
,
"main"
:
"Index.ets"
,
"version"
:
"1.0.0"
,
"dependencies"
:
{
"@umeng/common"
:
"^1.0.21"
,
"@umeng/analytics"
:
"^1.0.19"
}
"dependencies"
:
{}
}
...
...
sight_harmony/commons/wdKit/src/main/ets/umeng/UmengStats.ets
deleted
100644 → 0
View file @
c9b1e17
import { preInit, InternalPlugin, setLogEnabled, init, onEventObject, onProfileSignOff,
onProfileSignIn } from '@umeng/analytics';
import { common } from '@kit.AbilityKit';
import { AccountManagerUtils } from '../utils/AccountManagerUtils';
import { UserDataLocal } from '../utils/UserDataLocal';
import { EmitterUtils } from '../utils/EmitterUtils';
export class UmengStats {
private static _inited = false
// 启动时调用
static preInit(context: common.UIAbilityContext) {
// 需在 AppScope/resources/rawfile/umconfig.json 配置key和channel
preInit({
context: context.getApplicationContext(),
plugins: [new InternalPlugin()],
enableLog: true
});
}
// 在用户同意隐私政策后再调用此方法
static initAfterAgreeProtocol() {
init();
UmengStats._inited = true
UmengStats.onLogin()
UmengStats.event("testHarmony", {"key1": "value1"})
}
// TODO: 登录成功调用
static onLogin() {
AccountManagerUtils.isLogin().then((login) => {
if (!login) { return }
let userId = UserDataLocal.getUserId()
if (userId.length > 0) {
onProfileSignIn("USER", userId)
}
})
}
// TODO: 退出登录调用
static onLogout() {
onProfileSignOff()
}
// 属性key,128位以内的非空字符串,value为256位以内的数值或字符串
static event(eventId: string, param?: Record<string, string | number>) {
if (!UmengStats._inited) {
return
}
onEventObject(eventId, param);
}
}
\ No newline at end of file
sight_harmony/products/phone/src/main/ets/entryability/EntryAbility.ets
View file @
b233489
...
...
@@ -12,7 +12,6 @@ import {
NetworkType,
SPHelper,
StringUtils,
UmengStats,
WindowModel
} from 'wdKit';
import { HostEnum, HostManager, WDHttp } from 'wdNetwork';
...
...
@@ -22,7 +21,6 @@ import { WDPushNotificationManager } from 'wdHwAbility/Index';
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
UmengStats.preInit(this.context)
SPHelper.init(this.context);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
registerRouter();
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchPage.ets
View file @
b233489
...
...
@@ -11,7 +11,7 @@ import { WDRouterPage } from 'wdRouter';
import { LaunchModel } from '../viewModel/LaunchModel'
import { LaunchPageModel } from '../viewModel/LaunchPageModel'
import LaunchDataModel from '../viewModel/LaunchDataModel'
import { Logger, SPHelper
, UmengStats
} from 'wdKit/Index';
import { Logger, SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
@Entry
...
...
@@ -44,7 +44,6 @@ struct LaunchPage {
}
onConfirm() {
UmengStats.initAfterAgreeProtocol()
// Save privacy agreement status.
this.saveIsPrivacy();
//跳转引导页
...
...
@@ -95,9 +94,6 @@ struct LaunchPage {
this.dialogController.open();
// }
} else {
UmengStats.initAfterAgreeProtocol()
//需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页
//获取本地存储的启动页数据
...
...
Please
register
or
login
to post a comment