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
27 lines
460 B
TypeScript
27 lines
460 B
TypeScript
import { apiConfig } from "./api-config";
|
|
|
|
type NotificationProp = {
|
|
fcmToken: string;
|
|
title: string;
|
|
body: Object;
|
|
userLoginId?: string;
|
|
};
|
|
|
|
export async function apiNotificationsSend({
|
|
data,
|
|
}: {
|
|
data: NotificationProp;
|
|
}) {
|
|
try {
|
|
const response = await apiConfig.post(`/mobile/notifications`, {
|
|
data: data,
|
|
});
|
|
|
|
console.log("Fecth Notif", response.data);
|
|
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|