Using the Defaults

The simplest and most consistent way to add sound, light, and vibration to your Notifications is to use the current user default settings. Using the defaults property you can combine:

> Notification.DEFAULT_LIGHTS

> Notification.DEFAULT_SOUND

> Notification.DEFAULT_VIBRATE

The following code snippet assigns the default sound and vibration settings to a Notification:

notification.defaults = Notification.DEFAULT_SOUND |

Notification.DEFAULT_VIBRATE;

If you want to use all the default values you can use the Notification.DEFAULT_ALL constant.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment