Using the iphone default alert tone

I am trying to create messaging apps using push notification. I want to apply a custom notification tone like whatsApps. I notice that WhatsApps is using the default IOS sound system and I google around, there is a way to get the system sound by accessing "/ System / Library / Audio / UISounds" . However, I noticed that the list returned does not match the list in the "Settings-> Sound" system .

Here is my question

1) how can I get the whole sound file, ok with the same name as the IOS installation.
2) If I wanted to apply these sounds in a push notification, do I still need to use a .caf file in my application?

3) yes, is it possible for me to download it over the internet? (I have a lot of google and haven't got any luck) or is there any way to convert / export it?

+3


source to share


1 answer


you just need to install the json server side payload like this:

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

      

sound = default; this warning tone is the default

For the second question, yes, you have to put the entire sound file in your application package.



And don't forget to set this following code to your Appdelegate class when you registerForRemoteNotificationType

:

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

      

Here is a link to a list of iPhone sound files.

+3


source







All Articles