@huaapp001/m-play 0.0.2 → 0.0.3
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,46 +1,50 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
import { useEffect } from 'react';
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
import
|
9
|
-
|
4
|
+
// import DeviceInfo from 'react-native-device-info';
|
5
|
+
// import { NativeModules, Platform } from 'react-native';
|
6
|
+
// import { axiosPost } from '../request';
|
7
|
+
// import AsyncStorage from '@react-native-async-storage/async-storage';
|
8
|
+
// import { STORAGE_USER_TOKEN } from '../const/storage';
|
9
|
+
|
10
10
|
const useGetUserToken = jsbridge => {
|
11
|
-
const {
|
12
|
-
googleLogin
|
13
|
-
} = useGoogleAndIosLogin();
|
11
|
+
// const { googleLogin } = useGoogleAndIosLogin();
|
14
12
|
useEffect(() => {
|
15
13
|
jsbridge.addEventListener('LOG_IN', type => {
|
16
|
-
googleLogin().then(googleCredential => {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
}
|
14
|
+
// googleLogin().then((googleCredential) => {
|
15
|
+
// const params = {
|
16
|
+
// uid: global.GLOBAL_USER_UID,
|
17
|
+
// source: '',
|
18
|
+
// phone_version: DeviceInfo.getBrand(),
|
19
|
+
// system_version: DeviceInfo.getSystemVersion(),
|
20
|
+
// language:
|
21
|
+
// Platform.OS === 'ios'
|
22
|
+
// ? NativeModules.SettingsManager.settings.AppleLocale ||
|
23
|
+
// NativeModules.SettingsManager.settings.AppleLanguages[0]
|
24
|
+
// : NativeModules.I18nManager.localeIdentifier,
|
25
|
+
// app_version: DeviceInfo.getVersion(),
|
26
|
+
// account_type: 'google',
|
27
|
+
// unique_id: '',
|
28
|
+
// ip: DeviceInfo.getIpAddressSync(),
|
29
|
+
// id_token: googleCredential?.token,
|
30
|
+
// };
|
31
|
+
// console.log('params', googleCredential?.token);
|
32
|
+
// axiosPost('/register/', params)
|
33
|
+
// .then((res) => {
|
34
|
+
// console.log('res', res);
|
35
|
+
// AsyncStorage.setItem(STORAGE_USER_TOKEN, res.data.token);
|
36
|
+
// console.log('res.data.token', res.data.token);
|
37
|
+
// jsbridge.postMessage({
|
38
|
+
// type: 'USER_STATUS',
|
39
|
+
// payload: {
|
40
|
+
// token: res.data.token,
|
41
|
+
// },
|
42
|
+
// });
|
43
|
+
// })
|
44
|
+
// .catch((err) => {
|
45
|
+
// console.log('err', err);
|
46
|
+
// });
|
47
|
+
// });
|
44
48
|
});
|
45
49
|
}, []);
|
46
50
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useEffect","
|
1
|
+
{"version":3,"names":["useEffect","useGetUserToken","jsbridge","addEventListener","type"],"sourceRoot":"../../../../src","sources":["package/hooks/useGetUserToken.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC;AACA;AACA;AACA;AACA;;AAEA,MAAMC,eAAe,GAAIC,QAAa,IAAK;EACzC;EACAF,SAAS,CAAC,MAAM;IACdE,QAAQ,CAACC,gBAAgB,CAAC,QAAQ,EAAGC,IAAY,IAAK;MACpD;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;IAAA,CACD,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,eAAeH,eAAe","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@huaapp001/m-play",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.3",
|
4
4
|
"description": "m-play",
|
5
5
|
"main": "./lib/module/index.js",
|
6
6
|
"module": "./lib/module/index.js",
|
@@ -73,9 +73,6 @@
|
|
73
73
|
"@react-native-clipboard/clipboard": "^1.16.2",
|
74
74
|
"@react-native-community/cli": "15.0.0-alpha.2",
|
75
75
|
"@react-native-community/netinfo": "^11.4.1",
|
76
|
-
"@react-native-firebase/app": "^22.2.0",
|
77
|
-
"@react-native-firebase/auth": "^22.2.0",
|
78
|
-
"@react-native-google-signin/google-signin": "^14.0.1",
|
79
76
|
"@react-native/babel-preset": "0.79.2",
|
80
77
|
"@react-native/eslint-config": "^0.78.0",
|
81
78
|
"@release-it/conventional-changelog": "^9.0.2",
|
@@ -102,9 +99,6 @@
|
|
102
99
|
"@react-native-async-storage/async-storage": "^2.1.2",
|
103
100
|
"@react-native-clipboard/clipboard": "^1.16.2",
|
104
101
|
"@react-native-community/netinfo": "^11.4.1",
|
105
|
-
"@react-native-firebase/app": "^22.2.0",
|
106
|
-
"@react-native-firebase/auth": "^22.2.0",
|
107
|
-
"@react-native-google-signin/google-signin": "^14.0.1",
|
108
102
|
"jotai": "^2.12.5",
|
109
103
|
"react": ">=17.0.0",
|
110
104
|
"react-native": "*",
|
@@ -1,49 +1,48 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import { STORAGE_USER_TOKEN } from '../const/storage';
|
2
|
+
// import DeviceInfo from 'react-native-device-info';
|
3
|
+
// import { NativeModules, Platform } from 'react-native';
|
4
|
+
// import { axiosPost } from '../request';
|
5
|
+
// import AsyncStorage from '@react-native-async-storage/async-storage';
|
6
|
+
// import { STORAGE_USER_TOKEN } from '../const/storage';
|
8
7
|
|
9
8
|
const useGetUserToken = (jsbridge: any) => {
|
10
|
-
const { googleLogin } = useGoogleAndIosLogin();
|
9
|
+
// const { googleLogin } = useGoogleAndIosLogin();
|
11
10
|
useEffect(() => {
|
12
11
|
jsbridge.addEventListener('LOG_IN', (type: string) => {
|
13
|
-
googleLogin().then((googleCredential) => {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
});
|
12
|
+
// googleLogin().then((googleCredential) => {
|
13
|
+
// const params = {
|
14
|
+
// uid: global.GLOBAL_USER_UID,
|
15
|
+
// source: '',
|
16
|
+
// phone_version: DeviceInfo.getBrand(),
|
17
|
+
// system_version: DeviceInfo.getSystemVersion(),
|
18
|
+
// language:
|
19
|
+
// Platform.OS === 'ios'
|
20
|
+
// ? NativeModules.SettingsManager.settings.AppleLocale ||
|
21
|
+
// NativeModules.SettingsManager.settings.AppleLanguages[0]
|
22
|
+
// : NativeModules.I18nManager.localeIdentifier,
|
23
|
+
// app_version: DeviceInfo.getVersion(),
|
24
|
+
// account_type: 'google',
|
25
|
+
// unique_id: '',
|
26
|
+
// ip: DeviceInfo.getIpAddressSync(),
|
27
|
+
// id_token: googleCredential?.token,
|
28
|
+
// };
|
29
|
+
// console.log('params', googleCredential?.token);
|
30
|
+
// axiosPost('/register/', params)
|
31
|
+
// .then((res) => {
|
32
|
+
// console.log('res', res);
|
33
|
+
// AsyncStorage.setItem(STORAGE_USER_TOKEN, res.data.token);
|
34
|
+
// console.log('res.data.token', res.data.token);
|
35
|
+
// jsbridge.postMessage({
|
36
|
+
// type: 'USER_STATUS',
|
37
|
+
// payload: {
|
38
|
+
// token: res.data.token,
|
39
|
+
// },
|
40
|
+
// });
|
41
|
+
// })
|
42
|
+
// .catch((err) => {
|
43
|
+
// console.log('err', err);
|
44
|
+
// });
|
45
|
+
// });
|
47
46
|
});
|
48
47
|
}, []);
|
49
48
|
};
|