@gaddario98/react-native-core
Version:
```bash npm install @gaddario98/native ```
18 lines (15 loc) • 743 B
TypeScript
import * as Notifications from 'expo-notifications';
type NotificationPermissionStatus = "granted" | "denied" | "undetermined";
interface UseNotificationsReturn {
expoPushToken: string;
permissionStatus: NotificationPermissionStatus | null;
initializeNotifications: (id: string) => Promise<void>;
sendLocalNotification: (title: string, body: string, data?: Record<string, unknown>) => Promise<void>;
}
interface Props {
updateToken: (token: string) => Promise<void>;
setNotification: (notification: Notifications.Notification) => void;
}
declare const useExpoNotifications: ({ updateToken, setNotification, }: Props) => UseNotificationsReturn;
export { useExpoNotifications };
export type { UseNotificationsReturn };