@@ -18,7 +18,8 @@ export const registerForPushNotificationsAsync = async () => {
18
18
name : "default" ,
19
19
importance : Notifications . AndroidImportance . MAX ,
20
20
vibrationPattern : [ 0 , 250 , 250 , 250 ] , // Optional: Add vibration
21
- sound : "default" , // Enable sound
21
+ sound : "notification" , // Enable sound,
22
+ lightColor : "#FF231F7C" ,
22
23
} ) ;
23
24
}
24
25
@@ -61,7 +62,17 @@ export const handleNotification = async (
61
62
title :
62
63
remoteMessage . notification ?. title ??
63
64
NOTIFICATION_STRINGS . NEW_NOTIFICATION ,
65
+ subtitle : "Test subtitle" ,
64
66
body : remoteMessage . notification ?. body ?? "You received a new message" ,
67
+ sound : "notification" ,
68
+ badge : 1 ,
69
+ vibrate : [ 0 , 250 , 250 , 250 ] , // Optional: Add vibration
70
+ priority : Notifications . AndroidNotificationPriority . HIGH ,
71
+ color : "#FF231F7C" ,
72
+ interruptionLevel : "critical" ,
73
+ autoDismiss : false ,
74
+ sticky : true ,
75
+ categoryIdentifier : "new-message" ,
65
76
} ,
66
77
trigger : null ,
67
78
} ) ;
@@ -82,8 +93,18 @@ export const handleForegroundNotification = () => {
82
93
await Notifications . scheduleNotificationAsync ( {
83
94
content : {
84
95
title : remoteMessage . notification ?. title ?? "New Notification" ,
96
+ subtitle : "Test subtitle" ,
85
97
body : remoteMessage . notification ?. body ?? "You received a new message" ,
86
- // You can include other fields like sound, badge, data, etc.
98
+ data : { extraData : "Some data" } ,
99
+ sound : "notification" ,
100
+ badge : 1 ,
101
+ vibrate : [ 0 , 250 , 250 , 250 ] , // Optional: Add vibration
102
+ priority : Notifications . AndroidNotificationPriority . HIGH ,
103
+ color : "#FF231F7C" ,
104
+ interruptionLevel : "critical" ,
105
+ autoDismiss : false ,
106
+ sticky : true ,
107
+ categoryIdentifier : "new-message" ,
87
108
} ,
88
109
trigger : null , // null = show now (immediately)
89
110
} ) ;
@@ -150,9 +171,18 @@ export async function triggerLocalSampleNotification() {
150
171
await Notifications . scheduleNotificationAsync ( {
151
172
content : {
152
173
title : "Job Notification" ,
174
+ subtitle : "Test subtitle" ,
153
175
body : "This is a test notification." ,
154
- sound : true ,
176
+ sound : "notification" ,
155
177
data : { extraData : "Some data" } ,
178
+ badge : 1 ,
179
+ vibrate : [ 0 , 250 , 250 , 250 ] , // Optional: Add vibration
180
+ priority : Notifications . AndroidNotificationPriority . HIGH ,
181
+ color : "#FF231F7C" ,
182
+ interruptionLevel : "critical" ,
183
+ autoDismiss : false ,
184
+ sticky : true ,
185
+ categoryIdentifier : "new-message" ,
156
186
} ,
157
187
trigger : null , // Send immediately
158
188
} ) ;
0 commit comments