Skip to content

Commit 36dda6f

Browse files
Merge branch 'stage' into 'main'
Removed firebase analytics
2 parents f079ba3 + a519ba7 commit 36dda6f

File tree

6 files changed

+13
-131
lines changed

6 files changed

+13
-131
lines changed

package-lock.json

Lines changed: 13 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"@react-native-async-storage/async-storage": "^1.19.1",
2222
"@react-native-community/checkbox": "^0.5.16",
2323
"@react-native-community/datetimepicker": "^7.4.1",
24-
"@react-native-firebase/analytics": "^18.3.1",
2524
"@react-native-firebase/app": "^18.3.0",
2625
"@react-native-firebase/crashlytics": "^18.3.0",
2726
"@react-native-firebase/messaging": "^18.3.0",

src/app/screens/LoginScreen/login.hooks.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
} from '../../services/api/login';
1717
import {googleSignIn, googleSignOut} from '../../services/auth/google.auth';
1818
import {appleSignIn} from '../../services/auth/apple.auth';
19-
import {logEvent} from '../../services/firebase/analytics';
2019
import toast from '../../utils/toast';
2120

2221
import {RootStackParamList} from '../../navigation/types';
@@ -31,10 +30,6 @@ export const useLogin = () => {
3130
const {mutate, isLoading} = useMutation(sendLoginRequest, {
3231
onSuccess: async response => {
3332
const responseData = response.data.data;
34-
await logEvent('INTRANET_SIGNIN_SUCCESS', {
35-
role: response?.data?.data?.role,
36-
userId: response?.data?.data?.user_id,
37-
});
3833

3934
const authToken = responseData.jwtToken;
4035
const userData: UserData = {
@@ -48,10 +43,6 @@ export const useLogin = () => {
4843
setUserContextData({authToken, userData});
4944
},
5045
onError: async (error: AxiosError<LoginResponseBody>) => {
51-
await logEvent('INTRANET_SIGNIN_FAILED', {
52-
message: error?.response?.data?.message || '',
53-
});
54-
5546
await googleSignOut();
5647

5748
if (error.response) {
@@ -94,7 +85,6 @@ export const useLogin = () => {
9485
);
9586

9687
const googleSignInHandler = useCallback(async () => {
97-
await logEvent('GOOGLE_SIGNIN_BUTTON_CLICK');
9888
const response = await googleSignIn();
9989
if (response) {
10090
mutate(response);
@@ -103,7 +93,6 @@ export const useLogin = () => {
10393
}, [mutate]);
10494

10595
const appleSignInHandler = useCallback(async () => {
106-
await logEvent('APPLE_SIGNIN_BUTTON_CLICK');
10796
const response = await appleSignIn();
10897
if (response) {
10998
mutate(response);

src/app/services/auth/apple.auth.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {appleAuth} from '@invertase/react-native-apple-authentication';
22

33
import toast from '../../utils/toast';
4-
import {logEvent} from '../firebase/analytics';
54
import {AuthType} from '../api/login';
65

76
export const appleSignIn = async () => {
@@ -26,11 +25,6 @@ export const appleSignIn = async () => {
2625

2726
switch (credentialState) {
2827
case appleAuth.State.AUTHORIZED:
29-
await logEvent('APPLE_SIGNIN_SUCCESS', {
30-
idToken: response.identityToken,
31-
email: response.email,
32-
});
33-
3428
return {
3529
type: AuthType.APPLE,
3630
idToken: response.identityToken,
@@ -39,45 +33,23 @@ export const appleSignIn = async () => {
3933
},
4034
};
4135
case appleAuth.State.REVOKED:
42-
await logEvent('APPLE_AUTHORIZATION_FAILED', {state: 'Revoked'});
43-
break;
4436
case appleAuth.State.NOT_FOUND:
45-
await logEvent('APPLE_AUTHORIZATION_FAILED', {state: 'Not Found'});
46-
break;
4737
case appleAuth.State.TRANSFERRED:
48-
await logEvent('APPLE_AUTHORIZATION_FAILED', {state: 'Transferred'});
49-
break;
5038
default:
51-
await logEvent('APPLE_AUTHORIZATION_FAILED', {state: 'Unknown'});
5239
break;
5340
}
5441
} catch (error: any) {
5542
if (error.code !== appleAuth.Error.CANCELED) {
56-
let codeName = 'Unknown';
57-
5843
switch (error.code) {
5944
case appleAuth.Error.FAILED:
60-
toast('Apple sign-in failed. Please try again.', 'error');
61-
codeName = 'Failed';
62-
break;
6345
case appleAuth.Error.INVALID_RESPONSE:
64-
codeName = 'Invalid Response';
65-
toast('Apple sign-in failed. Please try again.', 'error');
66-
break;
6746
case appleAuth.Error.NOT_HANDLED:
68-
codeName = 'Not Handled';
6947
toast('Apple sign-in failed. Please try again.', 'error');
7048
break;
7149
case appleAuth.Error.UNKNOWN:
7250
default:
73-
codeName = 'Unknown';
7451
break;
7552
}
76-
77-
await logEvent('APPLE_SIGNIN_FAILED', {
78-
code: codeName,
79-
message: error.message,
80-
});
8153
}
8254
}
8355
};

src/app/services/auth/google.auth.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
import Config from 'react-native-config';
66

77
import toast from '../../utils/toast';
8-
import {logEvent} from '../firebase/analytics';
98
import {AuthType} from '../api/login';
109

1110
GoogleSignin.configure({
@@ -18,11 +17,6 @@ export const googleSignIn = async () => {
1817
await GoogleSignin.hasPlayServices();
1918
const userInfo = await GoogleSignin.signIn();
2019

21-
await logEvent('GOOGLE_SIGNIN_SUCCESS', {
22-
idToken: userInfo.idToken,
23-
email: userInfo.user.email,
24-
});
25-
2620
return {
2721
type: AuthType.GOOGLE,
2822
idToken: userInfo.idToken,
@@ -31,10 +25,6 @@ export const googleSignIn = async () => {
3125
},
3226
};
3327
} catch (error: any) {
34-
await logEvent('GOOGLE_SIGNIN_FAILED', {
35-
code: error?.code,
36-
message: error?.message,
37-
});
3828
await googleSignOut();
3929

4030
if (error.code === statusCodes.SIGN_IN_CANCELLED) {

src/app/services/firebase/analytics.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)