You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
smallIcon:"ic_notification", // (optional) default: "ic_notification" with fallback for "ic_launcher"
264
-
bigText:"My big text that will be shown when notification is expanded", // (optional) default: "message" prop
265
-
subText:"This is a subText", // (optional) default: none
266
-
color:"red", // (optional) default: system default
267
-
vibrate:true, // (optional) default: true
268
-
vibration:300, // vibration length in milliseconds, ignored if vibrate=false, default: 1000
269
-
tag:'some_tag', // (optional) add tag to message
270
-
group:"group", // (optional) add group to message
271
-
ongoing:false, // (optional) set whether this is an "ongoing" notification
272
-
priority:"high", // (optional) set notification priority, default: high
273
-
visibility:"private", // (optional) set notification visibility, default: private
274
-
importance:"high", // (optional) set notification importance, default: high
275
-
allowWhileIdle:false, // (optional) set notification to work while on doze, default: false
276
-
ignoreInForeground:false, // (optional) if true, the notification will not be visible when the app is in the foreground (useful for parity with how iOS notifications appear)
277
-
278
-
/* iOS only properties */
279
-
alertAction:'view', // (optional) default: view
280
-
category:'', // (optional) default: empty string
281
-
userInfo: {}, // (optional) default: {} (using null throws a JSON value '<null>' error)
282
-
283
-
/* iOS and Android properties */
284
-
title:"My Notification Title", // (optional)
285
-
message:"My Notification Message", // (required)
286
-
playSound:false, // (optional) default: true
287
-
soundName:'default', // (optional) Sound to play when the notification is shown. Value of 'default' plays the default sound. It can be set to a custom sound such as 'android.resource://com.xyz/raw/my_sound'. It will look for the 'my_sound' audio file in 'res/raw' directory and play it. default: 'default' (default sound is played)
288
-
number:10, // (optional) Valid 32 bit integer specified as string. default: none (Cannot be zero)
289
-
repeatType:'day', // (optional) Repeating interval. Check 'Repeating Notifications' section for more info.
290
-
actions:'["Yes", "No"]',// (Android only) See the doc for notification actions to know more
263
+
/* Android Only Properties */
264
+
id:"0", // (optional) Valid unique 32 bit integer specified as string. default: Autogenerated Unique ID
smallIcon:"ic_notification", // (optional) default: "ic_notification" with fallback for "ic_launcher"
269
+
bigText:"My big text that will be shown when notification is expanded", // (optional) default: "message" prop
270
+
subText:"This is a subText", // (optional) default: none
271
+
color:"red", // (optional) default: system default
272
+
vibrate:true, // (optional) default: true
273
+
vibration:300, // vibration length in milliseconds, ignored if vibrate=false, default: 1000
274
+
tag:"some_tag", // (optional) add tag to message
275
+
group:"group", // (optional) add group to message
276
+
ongoing:false, // (optional) set whether this is an "ongoing" notification
277
+
priority:"high", // (optional) set notification priority, default: high
278
+
visibility:"private", // (optional) set notification visibility, default: private
279
+
importance:"high", // (optional) set notification importance, default: high
280
+
allowWhileIdle:false, // (optional) set notification to work while on doze, default: false
281
+
ignoreInForeground:false, // (optional) if true, the notification will not be visible when the app is in the foreground (useful for parity with how iOS notifications appear)
282
+
283
+
/* iOS only properties */
284
+
alertAction:"view", // (optional) default: view
285
+
category:"", // (optional) default: empty string
286
+
userInfo: {}, // (optional) default: {} (using null throws a JSON value '<null>' error)
287
+
288
+
/* iOS and Android properties */
289
+
title:"My Notification Title", // (optional)
290
+
message:"My Notification Message", // (required)
291
+
playSound:false, // (optional) default: true
292
+
soundName:"default", // (optional) Sound to play when the notification is shown. Value of 'default' plays the default sound. It can be set to a custom sound such as 'android.resource://com.xyz/raw/my_sound'. It will look for the 'my_sound' audio file in 'res/raw' directory and play it. default: 'default' (default sound is played)
293
+
number:10, // (optional) Valid 32 bit integer specified as string. default: none (Cannot be zero)
294
+
repeatType:"day", // (optional) Repeating interval. Check 'Repeating Notifications' section for more info.
295
+
actions:'["Yes", "No"]', // (Android only) See the doc for notification actions to know more
291
296
});
292
297
```
293
298
@@ -301,7 +306,7 @@ EXAMPLE:
301
306
PushNotification.localNotificationSchedule({
302
307
//... You can use all the options from localNotifications
The `userInfo` parameter for `PushNotification.localNotification` is required for this operation and must contain an `id` parameter. The id supplied will then be used for the cancel operation.
(optional) Specify `priority` to set priority of notification. Default value: "high"
@@ -375,31 +394,17 @@ Available options:
375
394
376
395
More information: https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT
377
396
378
-
## Notification while idle ##
397
+
## Notification while idle
379
398
380
399
(optional) Specify `allowWhileIdle` to set if the notification should be allowed to execute even when the system is on low-power idle modes.
381
400
382
-
On Android 6.0 (API level 23) and forward, the Doze was introduced to reduce battery consumption when the device is unused for long periods of time. But while on Doze the AlarmManager alarms (used to show scheduled notifications) are deferred to the next maintenance window. This may cause the notification to be delayed while on Doze.
401
+
On Android 6.0 (API level 23) and forward, the Doze was introduced to reduce battery consumption when the device is unused for long periods of time. But while on Doze the AlarmManager alarms (used to show scheduled notifications) are deferred to the next maintenance window. This may cause the notification to be delayed while on Doze.
383
402
384
403
This can significantly impact the power use of the device when idle. So it must only be used when the notification is required to go off on a exact time, for example on a calendar notification.
The `userInfo` parameter for `PushNotification.localNotification` is required for this operation and must contain an `id` parameter. The id supplied will then be used for the cancel operation.
0 commit comments