@jolibox/implement 1.1.41 → 1.1.44

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.
@@ -1,9 +1,9 @@
1
1
  Invoking: npm run clean && npm run build:esm && tsc
2
2
 
3
- > @jolibox/implement@1.1.41 clean
3
+ > @jolibox/implement@1.1.44 clean
4
4
  > rimraf ./dist
5
5
 
6
6
 
7
- > @jolibox/implement@1.1.41 build:esm
7
+ > @jolibox/implement@1.1.44 build:esm
8
8
  > BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
9
9
 
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@jolibox/implement",
3
3
  "description": "This project is Jolibox JS-SDk implement for Native && H5",
4
- "version": "1.1.41",
4
+ "version": "1.1.44",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@jolibox/common": "1.1.41",
10
- "@jolibox/types": "1.1.41",
11
- "@jolibox/native-bridge": "1.1.41",
12
- "@jolibox/ads": "1.1.41",
9
+ "@jolibox/common": "1.1.44",
10
+ "@jolibox/types": "1.1.44",
11
+ "@jolibox/native-bridge": "1.1.44",
12
+ "@jolibox/ads": "1.1.44",
13
13
  "localforage": "1.10.0",
14
14
  "@jolibox/ui": "1.0.0",
15
15
  "web-vitals": "4.2.4"
@@ -10,9 +10,10 @@ import { checkUnloginModalFrequency, updateUnloginModalFrequency } from '../chec
10
10
  import { StandardResponse } from '@jolibox/types';
11
11
  import { innerFetch as fetch } from '@/native/network';
12
12
  import { reportError } from '@/common/report/errors/report';
13
- import { InternalInvokeMethodError } from '@jolibox/common';
13
+ import { EventType, InternalInvokeMethodError } from '@jolibox/common';
14
14
  import { loginImplement } from '@/native/api/login';
15
15
  import { createToast, createUnloginJolicoinModal } from '@jolibox/ui';
16
+ import { track } from '@/native/report';
16
17
 
17
18
  const unloginModalConfig = createEventPromiseHandler<
18
19
  IUseModalFrequencyConfig,
@@ -46,6 +47,8 @@ rewardsEmitter.on(InvokeUnloginModalEventName, async (type: 'JOLI_COIN' | 'ADS-J
46
47
  rewardsEmitter.emit(UseUnloginModalResultEventName, { result: 'NOT_SUPPORT' });
47
48
  return;
48
49
  }
50
+
51
+ track('LoginGuideModal', {}, EventType.Expose);
49
52
  const modal = createUnloginJolicoinModal({
50
53
  data: {
51
54
  rewardType: type,
@@ -55,11 +58,14 @@ rewardsEmitter.on(InvokeUnloginModalEventName, async (type: 'JOLI_COIN' | 'ADS-J
55
58
  confirm: {
56
59
  text: params.confirmButtonText,
57
60
  onPress: async () => {
61
+ track('LoginGuideModal', { type: 'click_confirm' }, EventType.Click);
58
62
  const { isLogin, extra, isFirstLogin } = await loginImplement({}, true);
59
63
  if (!isLogin) {
60
64
  console.log('login failed');
61
65
  return;
62
66
  }
67
+
68
+ track('LoginGuideModal', { type: 'click_confirm_login', isFirstLogin }, EventType.Click);
63
69
  if (isFirstLogin && extra?.firstLogin?.reward) {
64
70
  const { rewardValue } = extra.firstLogin.reward;
65
71
  createToast(`{slot-i18ntran-loginGuide.rewardTips}`, {
@@ -87,7 +93,11 @@ rewardsEmitter.on(InvokeUnloginModalEventName, async (type: 'JOLI_COIN' | 'ADS-J
87
93
  },
88
94
  cancel: {
89
95
  text: params.cancelButtonText,
90
- onPress: () => {
96
+ onPress: ({ type }) => {
97
+ track('LoginGuideModal', {}, EventType.Hide);
98
+
99
+ const trackType = type === 'CANCEL' ? 'click_close' : 'click_watch_ads';
100
+ track('LoginGuideModal', { type: trackType }, EventType.Click);
91
101
  rewardsEmitter.emit(UseUnloginModalResultEventName, { result: 'FAILED' });
92
102
  modal.destroy();
93
103
  }