Skip to content

Commit ae23056

Browse files
committed
Updated README – documented how to set custom sound
1 parent b21aa15 commit ae23056

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You can pass several options to this function, everything is optional:
4848
|`ticker` |On Android you can show a different text in the statusbar, instead of the `body`. Default not set, so `body` is used.|
4949
|`at` |A JavaScript Date object indicating when the notification should be shown. Default 'now'.|
5050
|`badge` |On iOS (and some Android devices) you see a number on top of the app icon. On most Android devices you'll see this number in the notification center. Default not set (0).|
51-
|`sound` |Set this to `null` to suppress the default sound.|
51+
|`sound` |Notification sound. For custom notification sound, copy sound file in ```App_Resources/iOS``` (iOS) and ```App_Resources/Android/raw``` (Android). Set this to "default" (or do not set at all) in order to use default OS sound. Set this to `null` to suppress sound.|
5252
|`interval` |Set to one of `second minute hour day week month quarter year` if you want a recurring notification.|
5353
|`smallIcon` |On Android you can set a custom icon in the system tray. Pass in 'res://filename' (without the extension) which lives in App_Resouces/Android/drawable folders. If not passed, we look for a file named 'ic_stat_notify.png' in the App_Resources/Android/drawable folders. Default: the app icon.|
5454
|`largeIcon` |Same as `smallIcon`, but this one is shown when you expand the notification center. The optional file we look for is not 'ic_stat_notify.png' but 'ic_notify.png'.|
@@ -69,7 +69,7 @@ Note that after a reboot the `smallIcon` and `largeIcon` are not restored but fa
6969
ongoing: true, // makes the notification ongoing (Android only)
7070
smallIcon: 'res://heart',
7171
interval: 'minute',
72-
sound: null, // suppress the default sound
72+
sound: require("application").ios ? "customsound-ios.wav" : "customsound-android", // can be also `null`, "default"
7373
at: new Date(new Date().getTime() + (10 * 1000)) // 10 seconds from now
7474
}]).then(
7575
function() {
@@ -195,5 +195,4 @@ If the `requestPermission` or `schedule` functions previously ran you may want t
195195
Let us know what you need by opening a Github issue.
196196

197197
We're thinking about adding support for things like:
198-
- [Custom Notification sounds](https://github.com/EddyVerbruggen/nativescript-local-notifications/issues/3)
199198
- Interactive Notifications on iOS

0 commit comments

Comments
 (0)