You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
557 B
TypeScript
20 lines
557 B
TypeScript
import { EventTracking } from '@xkit-yx/utils/dist/uniapp'
|
|
import imPkg from 'nim-web-sdk-ng/package.json'
|
|
|
|
export const trackInit = (
|
|
component: 'ChatUIKit' | 'ContactUIKit' | 'ConversationUIKit' | 'SearchUIKit'
|
|
): void => {
|
|
if (uni.$UIKitNIM && uni.$UIKitNIM.options.appkey) {
|
|
const eventTracking = new EventTracking({
|
|
appKey: uni.$UIKitNIM.options.appkey,
|
|
version: '10.2.0',
|
|
component,
|
|
imVersion: imPkg.version,
|
|
platform: 'UniApp',
|
|
})
|
|
eventTracking.track('init', '')
|
|
}else{
|
|
console.log('js 异常')
|
|
}
|
|
}
|