2

Is it possible to create UILocalNotification playing a custom sound but not vibrate the phone?

EDIT: this is the code I used to create UILocalNotification, it works but it vibrates the phone. I don't want the phone to vibrate but I want to play a sound.

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];
Tuyen Nguyen
  • 4,389
  • 7
  • 51
  • 77

1 Answers1

1

Unfortunately, if you want a sound, you can't disable vibration unless the user has went into the General Settings and disabled vibration themselves.

shabbirv
  • 8,958
  • 4
  • 33
  • 34