Im using appcelerator 4.0.0. I have downloaded the code of this appcelerator toturial and tried to add sound to the notification. http://www.appcelerator.com/blog/2014/09/new-in-sdk-3-4-ios-8-interactive-notifications/
However I cant seem to get the sounds working. The notification settings/permissions on the device are good. I have tested on simulator and real device.
var notif = Ti.App.iOS.scheduleLocalNotification({
date: new Date(new Date().getTime() + 5000), // send it in 5 sec
alertBody: 'This is your message',
badge: 1,
sound: 'default',
userInfo: {"url": "http://www.download.com/resource/asset.json", id:"1"},
category: "DOWNLOAD_CONTENT"
});
Wait, there are some misunderstandings in your code.
Ti.App.iOS.scheduleLocalNotification
schedule a notification, but if you setdate = new Date(new Date().getTime())
, the app is still in foreground... and when the app is in foreground, no iOS banner is shown = no sound.So, what you have to do is
date: new Date(Date.now() + 5000)
, and close the app.