Back

PlayRingtone

Hello World

Play a specific ringtone type based on the users device settings for ringtones.

app.PlayRingtone( type )

Type can be “Alarm”, “Notification” or “Ringtone”.

Example - Play Notificatinop Sound

function OnStart()
{
    lay = app.CreateLayout( "linear", "VCenter,FillXY" );

    btn = app.CreateButton( "Press Me", 0.3, 0.1 );
    btn.SetOnTouch( btn_OnTouch );
    lay.AddChild( btn );

    app.AddLayout( lay );
}

function btn_OnTouch()
{
    app.PlayRingtone("Notification");
}
Copy All       Run      
string: “Alarm” or “Notification” or “Ringtone”