IOS Push Notification - how to specify sound for notificaiton

hi I’m trying set a sound for my notification but its not working in the device please tell me how to set the alert sound for the notification.

$payload = '{
    "aps" :
    {
        "alert" :"'.$message.'",
        "badge" : 1,
        "sound" : "default"
    }  
}';

i have used the above code the set a sound for the push notification its not working pls tell where I'm wrong.

Thanks.

Answers


The code you have written is fine, one thing you can do is do not send the sound key val pair if you want to play the default send, as per apple docs if there is no data for sound it will play the default sound.

possible duplicate


Need Your Help

How are fractions represented in computers?

java language-agnostic floating-point bits fractions

Since computers think in terms of "1" and "0" how do they calculate and represent fractions such as 7.50 ? I know Java and JavaScript and if required for the answer you can use them as an example .

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.