Steven Steven - 1 year ago 83
iOS Question

Use of iphone default alert tone

I'm try to build a messaging apps, with push notification applied. I wish to apply user defined notification tone, like whatsApps does. I notice whatsApps is using IOS default sound system, and i google around, there is a method to get system sound, by accessing "/System/Library/Audio/UISounds". However, i notice the list returned is not same as the list in system "Setting->sound".

Here is my question

1) how am i possible to get all the sound file, is good with the naming same as IOS setting.

2) If i wanted to apply those sound in push notification, do all the .caf file need to include in my apps bundle?

3) is yes, is it possible i able to download it over internet?(i've google a lot and found no luck) or any way to convert/export it?

Answer Source

you just need to set server side payload json like following:

    aps =     {
        alert = "Hello World";
        badge = 1;
        sound = default;

sound = default; that alert tone apply default one

For second question yes you have to put all sound file in to your apps bundle.

And do not forget to set this following code in to your Appdelegate class when you registerForRemoteNotificationType :

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

Here it is link for iPhone sound files list.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download