I have been facing an issue. I implemented push notification in iOS with custom sound. Its a MP3 file. It plays well when I receive a push notification in iOS 5, but in iOS4, it doesn't play any sound. Can you help me with this?
The code is like this
{
"aps": {
"badge": 10,
"alert": "Hello",
"sound": "sound.mp3"
}
}
Nithin
To set a custom notification sound go to 'Settings,' scroll down, and then tap on 'Sound & Haptics. ' Under 'Sounds and Vibration Patterns,' select the type of notification that needs to be changed. From the menu, choose the sound that needs to be set as the notification sound.
Choose the appropriate category and select Alert. On the Notification category page, scroll down to the Sound section. It shows the default tone enabled for the app. Tap Sound and select your desired notification tone from the list to change the presets.
To add an extra layer of personalization to an iOS or Android push campaign message, you can use geo-location based push notifications. There are two ways brands can send push notifications based on a user's location: Location-based notifications: App users receive these pushes based on data collected on the backend.
According to the push notification guide:
You can package the audio data in an aiff, wav, or caf file. Then, in Xcode, add the sound file to your project as a nonlocalized resource of the application bundle.
It doesn't say anything about MP3s. I've used aif files which worked. I'd stick to what Apple specifies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With