我正在使用 appcelerator 4.0.0。我已经下载了这个 appcelerator toturial 的代码,并尝试向通知添加声音。 http://www.appcelerator.com/blog/2014/09/new-in-sdk-3-4-ios-8-interactive-notifications/
但是我似乎无法让声音正常工作。设备上的通知设置/权限良好。我已经在模拟器和真机上进行了测试。
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"
});
最佳答案
等等,您的代码中存在一些误解。
Ti.App.iOS.scheduleLocalNotification
安排通知,但如果您设置 date = new Date(new Date().getTime())
,应用程序是仍然在前台...当应用程序在前台时,没有显示 iOS 横幅 = 没有声音。
所以,您要做的是date: new Date(Date.now() + 5000)
,然后关闭应用。
关于ios - Appcelerator 通知 IOS 8 - 没有声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30719096/