1.iOS中的系统通知 自定义推送声音
2015-09-01 16:51
609 查看
iOS系统可支持本地通知和远程通知,一个通知在客户端收到的时候可能是一个通知窗体,可能会播放一段通知声音,还有可能在程序图标上增加一个数字,还有可能三者皆有。本文描述ios系统中计划localnotification,注册remotenotification,以及处理local和remotenotification的步骤。本文中客户端API中notification推送指的就是remotenotfication的推送第一个知识点:准备个人定制音频作为提示音,请注意下面四个小问题-----1,系统能播放的四种音频数据格式LinearPCMMA4(IMA/ADPCM)?LawaLaw对应的后缀名可以是aiff,wav,orcaffile.Then,2,可以用afconvert来转换音频,例如把16位的线性PCM系统音频格式文件Submarine.aiff转换成IMA4音频,存为.CAF文件。在终端执行即可afconvert/System/Library/Sounds/Submarine.aiff~/Desktop/sub.caf-dima4-fcaff-v3,如何确定音频格式呢。打开QuickTimePlayer->Moviemenu->ShowMovieInspector4,个人定制音频必须是30s以下。否则就播放默认的声音了。第二个知识点:预定一个LocalNotification需要了解下面5个步骤1,Allocate和initialize一个UILocalNotification对象。2,fireDate属性赋值3,设置别的几个体型要素提示框,提示音,图标上的提示数字。也可以带别的个性化数据:通过userInfo带出去。4,然后Schedule这个通知。通过UIApplication.scheduleLocalNotification来预定执行或者立马执行presentLocalNotificationNow:5,也可以取消这个通知。用这个方法:cancelLocalNotification和cancelAllLocalNotifications这个方法看下代码/
|
相关文章推荐
- IOS开发-视频,音频,录音简单总结
- iOS开发系列--音频播放、录音、视频播放、拍照、视频录制
- IOS中nil/Nil/NULL的区别
- iOS-Quartz2D绘图的基础用法总结
- iOS中socket的使用
- iOS 设置导航栏 Navigationbar相关信息
- IOS-添加分段控件SegmentControl
- IOS时间与日期处理
- iOS读取本地txt文件为乱码的解决方法
- iOS 软件中所有动画突然不能正常显示(系统自带的动画也成了一闪而过)
- ios 用NSUserDefaults做本地化搜索记录
- 苹果开发 笔记(68)MBProgressHUD
- iOS开发日记13-原生二维码的扫描和生成
- iOS GCD使用指南
- iOS中的round/ceil/floorf函数略解
- [iOS] iOS开发埋坑之路(一)
- 【IOS开发】实时显示摄像头内容
- TUTK p2p视频流H.264 iOS平台解码成功
- ios与js 交互
- ios开发职工常常遇到的问题