2

カスタムサウンドを再生する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];
4

1 に答える 1

1

残念ながら、サウンドが必要な場合は、ユーザーが一般設定に移動してバイブレーションを無効にしない限り、バイブレーションを無効にすることはできません。

于 2012-02-26T07:58:10.053 に答える