Skip to main content
📬

Push Notifications

Communication
View Docs

Register for and handle push notifications

pushnotificationsfcmapnsmessaging

Demo

🔕

Push Notifications Disabled

Enable push notifications to receive updates

Permission Status

Unknown

Actions

Notification Channels (Android 8+)

Android requires notification channels for categorizing notifications.

Notification channels are only available on Android 8+.

Received Notifications

No notifications received yet. Send a push notification to this device to see it here.

Note: Push notifications require proper setup in your native projects. For iOS, you need APNs certificates and entitlements. For Android, you need Firebase Cloud Messaging configuration. On web, notifications use the Push API with service workers.

Usage

import { usePushNotifications } from '@classic-homes/native/svelte';
// or for React:
import { usePushNotifications } from '@classic-homes/native/react';

API Reference

PropertyTypeDescription
tokenPushToken | nullPush notification token
isRegisteredbooleanWhether registered for push notifications
permissionStatePermissionState | nullCurrent permission state
isLoadingbooleanWhether an operation is in progress
errorError | nullCurrent error if any
checkPermissions() => Promise<PermissionState>Check notification permissions
requestPermissions() => Promise<PermissionState>Request notification permissions
register() => Promise<void>Register for push notifications
unregister() => Promise<void>Unregister from push notifications
createChannel(channel: NotificationChannel) => Promise<void>Create notification channel (Android)
deleteChannel(channelId: string) => Promise<void>Delete notification channel (Android)

Related Features