有没有可能创建播放自定义声音而不震动手机的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];发布于 2012-02-26 15:58:10
不幸的是,如果你想要一个声音,你不能禁用振动,除非用户进入常规设置并自行禁用振动。
https://stackoverflow.com/questions/9450791
复制相似问题