iOS极光推送设置系统铃声

苹果官方公布了系统铃声列表
http://iphonedevwiki.net/index.php/AudioServices

在极光推送,例如本地通知设置铃声时,只要设置铃声名字[fileName]即可

    JPushNotificationContent *content = [[JPushNotificationContent alloc] init];
    content.sound = @"sms-received1.caf";

其中[SoundID]是在用到系统的原生库的时候使用,在其他地方需要播放声音时可用

#import <AudioToolbox/AudioToolbox.h>
 铃声:
    SystemSoundID soundID = 1007;
    AudioServicesPlaySystemSound(soundID);

    振动:
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容