Add: - app/(application)/(user)/test-notifications.tsx - components/_ShareComponent/NotificationInitializer.tsx - screens/Home/HeaderBell.tsx - service/api-notifications.ts Fix: - app/(application)/(user)/home.tsx - app/_layout.tsx - screens/Authentication/LoginView.tsx ### No Issue
24 lines
428 B
TypeScript
24 lines
428 B
TypeScript
import { apiConfig } from "./api-config";
|
|
|
|
|
|
type NotificationProp = {
|
|
fcmToken: string
|
|
title: string,
|
|
body: Object
|
|
}
|
|
|
|
|
|
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;
|
|
}
|
|
}
|