Filter console dan clean code

Add:
- service/api-device-token.ts

Fix:
- app/(application)/(user)/home.tsx
- app/(application)/(user)/test-notifications.tsx
- app/_layout.tsx
- components/_ShareComponent/NotificationInitializer.tsx
- context/AuthContext.tsx
- hooks/use-foreground-notifications.ts
- screens/Home/HeaderBell.tsx
- service/api-notifications.ts

### No Issue
This commit is contained in:
2025-12-17 17:46:28 +08:00
parent 05c1cac10f
commit a01a9bd93f
9 changed files with 110 additions and 116 deletions

View File

@@ -4,6 +4,7 @@ type NotificationProp = {
fcmToken: string;
title: string;
body: Object;
userLoginId?: string;
};
export async function apiNotificationsSend({
@@ -23,29 +24,3 @@ export async function apiNotificationsSend({
throw error;
}
}
type DeviceTokenData = {
fcmToken: string;
platform: string;
deviceId: string;
model: string;
appVersion: string;
userId: string;
};
export async function apiDeviceRegisterToken({
data,
}: {
data: DeviceTokenData;
}) {
try {
const response = await apiConfig.post(`/mobile/auth/device-tokens`, {
data: data,
});
console.log("Device token registered:", response.data);
return response.data;
} catch (error) {
console.error("Failed to register device token:", error);
throw error;
}
}