@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 useGoogleAndIosLogin from "./useGoogleAndIosLogin.js";
5
- import DeviceInfo from 'react-native-device-info';
6
- import { NativeModules, Platform } from 'react-native';
7
- import { axiosPost } from "../request/index.js";
8
- import AsyncStorage from '@react-native-async-storage/async-storage';
9
- import { STORAGE_USER_TOKEN } from "../const/storage.js";
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
- const params = {
18
- uid: global.GLOBAL_USER_UID,
19
- source: '',
20
- phone_version: DeviceInfo.getBrand(),
21
- system_version: DeviceInfo.getSystemVersion(),
22
- language: Platform.OS === 'ios' ? NativeModules.SettingsManager.settings.AppleLocale || NativeModules.SettingsManager.settings.AppleLanguages[0] : 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).then(res => {
31
- console.log('res', res);
32
- AsyncStorage.setItem(STORAGE_USER_TOKEN, res.data.token);
33
- console.log('res.data.token', res.data.token);
34
- jsbridge.postMessage({
35
- type: 'USER_STATUS',
36
- payload: {
37
- token: res.data.token
38
- }
39
- });
40
- }).catch(err => {
41
- console.log('err', err);
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","useGoogleAndIosLogin","DeviceInfo","NativeModules","Platform","axiosPost","AsyncStorage","STORAGE_USER_TOKEN","useGetUserToken","jsbridge","googleLogin","addEventListener","type","then","googleCredential","params","uid","global","GLOBAL_USER_UID","source","phone_version","getBrand","system_version","getSystemVersion","language","OS","SettingsManager","settings","AppleLocale","AppleLanguages","I18nManager","localeIdentifier","app_version","getVersion","account_type","unique_id","ip","getIpAddressSync","id_token","token","console","log","res","setItem","data","postMessage","payload","catch","err"],"sourceRoot":"../../../../src","sources":["package/hooks/useGetUserToken.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,OAAOC,oBAAoB,MAAM,2BAAwB;AACz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AAC,KAAK,EAAEC,GAAG,CAAC;UACvBpC,YAAY,CAACqC,OAAO,CAACpC,kBAAkB,EAAEmC,GAAG,CAACE,IAAI,CAACL,KAAK,CAAC;UACxDC,OAAO,CAACC,GAAG,CAAC,gBAAgB,EAAEC,GAAG,CAACE,IAAI,CAACL,KAAK,CAAC;UAC7C9B,QAAQ,CAACoC,WAAW,CAAC;YACnBjC,IAAI,EAAE,aAAa;YACnBkC,OAAO,EAAE;cACPP,KAAK,EAAEG,GAAG,CAACE,IAAI,CAACL;YAClB;UACF,CAAC,CAAC;QACJ,CAAC,CAAC,CACDQ,KAAK,CAAEC,GAAG,IAAK;UACdR,OAAO,CAACC,GAAG,CAAC,KAAK,EAAEO,GAAG,CAAC;QACzB,CAAC,CAAC;MACN,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,eAAexC,eAAe","ignoreList":[]}
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.2",
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 useGoogleAndIosLogin from './useGoogleAndIosLogin';
3
- import DeviceInfo from 'react-native-device-info';
4
- import { NativeModules, Platform } from 'react-native';
5
- import { axiosPost } from '../request';
6
- import AsyncStorage from '@react-native-async-storage/async-storage';
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
- const params = {
15
- uid: global.GLOBAL_USER_UID,
16
- source: '',
17
- phone_version: DeviceInfo.getBrand(),
18
- system_version: DeviceInfo.getSystemVersion(),
19
- language:
20
- Platform.OS === 'ios'
21
- ? NativeModules.SettingsManager.settings.AppleLocale ||
22
- NativeModules.SettingsManager.settings.AppleLanguages[0]
23
- : NativeModules.I18nManager.localeIdentifier,
24
- app_version: DeviceInfo.getVersion(),
25
- account_type: 'google',
26
- unique_id: '',
27
- ip: DeviceInfo.getIpAddressSync(),
28
- id_token: googleCredential?.token,
29
- };
30
- console.log('params', googleCredential?.token);
31
- axiosPost('/register/', params)
32
- .then((res) => {
33
- console.log('res', res);
34
- AsyncStorage.setItem(STORAGE_USER_TOKEN, res.data.token);
35
- console.log('res.data.token', res.data.token);
36
- jsbridge.postMessage({
37
- type: 'USER_STATUS',
38
- payload: {
39
- token: res.data.token,
40
- },
41
- });
42
- })
43
- .catch((err) => {
44
- console.log('err', err);
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
  };