Use this method to pass a function to a receiver which should be called when the controlling user taps his screen. A tap is like a click on a website, a short gesture in which a finger is placed on the smartphone's screen and immediately lifted again without moving it.
In the following example, a developer is using PlugPIN to control a lamp with a BeagleBone hardware board. She has written a function 'toggleLampPower' which takes care of this.
'name' : 'Toggle lamp'
.onTap( function ()
In the following example, a developer is creating a Spotify app that users can control with their smartphone. He wants a tap on the left and right side of the smartphone's screen to skip to the previous or next song.
'name' : 'Spotify'
.onTap( function ( side )
switch ( side )
Connect to the app in the iFrame below to check out the tap event right now.