Percobaan notifikasi
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
This commit is contained in:
23
service/api-notifications.ts
Normal file
23
service/api-notifications.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user