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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user