If you are a PhoneGap users, hopefully you know about the various aspects of the Notification API. The Notification API allows for visual, audio, and tactile notifications. In this post I want to focus on the visual notifications and how they differ from the built in web view notifications.
I used my epic CSS skills to make this a bit more touch friendly:
Here is the alert being fired:
Here is the confirm:
And finally the prompt:
Now let’s consider the native options. First note that they allow for customization. In each one you can tweak the button (or buttons) as well as the title. Be aware that confirm takes a list of button labels while prompt takes an array. (I consider that a bug and I hope they fix that soon.) Also note that all three have callbacks for handling button presses. I’ve used null as a way of signifying I don’t want to do anything, but you would normally have some kind of logic there.
Here is the native alert:
Here is the native confirm:
And lastly, the native prompt:
Just to be clear, do remember that you can build your own alerts, confirms, and prompts as well if you feel like it.