Try to notification

### Issue: package import * as Notifications from expo-notifications;
This commit is contained in:
2025-11-18 17:46:33 +08:00
parent 059b4d053a
commit 868e96a54a
7 changed files with 72 additions and 26 deletions

View File

@@ -4,17 +4,27 @@ import Constants from 'expo-constants';
import * as Device from 'expo-device';
// Notifications.setNotificationHandler({
// handleNotification: async () => ({
// shouldShowAlert: true,
// shouldPlaySound: true,
// shouldSetBadge: false,
// shouldShowBanner: true,
// shouldShowList: true,
// }),
// });
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: true,
shouldPlaySound: false,
shouldSetBadge: false,
shouldShowBanner: true,
shouldShowList: true,
}),
});
export default async function registerForPushNotificationsAsync() {
export async function registerForPushNotificationsAsync() {
if (!Device.isDevice) {
console.warn("Push notifications don't work on simulator");
return null;