2012-02-26 94 views
2

是否可以创建UILocalNotification播放自定义声音但不振动手机?用声音和无振动创建UILocalNotification

编辑:这是我用来创建UILocalNotification的代码,它的工作原理,但它振动手机。 我不想让手机振动,但我想播放声音。

UILocalNotification *notif = [[UILocalNotification alloc] init]; 
notif.fireDate = [NSDate dateWithTimeIntervalSinceNow:seconds]; 
notif.timeZone = [NSTimeZone defaultTimeZone]; 
//notif.alertBody = alertMessage; 
//notif.alertAction = @"Show me"; 
notif.soundName = soundName; 
notif.applicationIconBadgeNumber = 0; 
NSDictionary *userDict = [NSDictionary dictionaryWithObject:soundName forKey:kCurrentSound]; 
notif.userInfo = userDict; 
[[UIApplication sharedApplication] scheduleLocalNotification:notif]; 
[notif release]; 

回答

1

不幸的是,如果您想要声音,除非用户进入常规设置并禁用振动,否则无法禁用振动。