iOS劝退指南

iOS极光推送设置系统铃声

2017-01-18  本文已影响34人  MccReeee

苹果官方公布了系统铃声列表
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);
上一篇 下一篇

猜你喜欢

热点阅读