当用户通过地理围栏进入某个区域时,我会发出本地通知。但是当我按下主页按钮查看本地通知时,它确实会显示但没有声音。我试图在mac设置中禁用和启用“播放用户界面声音..”,关闭并重新打开xcode,清理项目,最后重新启动mac。没有任何效果..我错过了什么?
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
NSLog(@"Entered Region - %@", region.identifier);
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
[localNotification setAlertBody:@"You are about to enter.."];
[localNotification setSoundName:@"Voicemail.caf"];
UIApplication *application = [UIApplication sharedApplication];
[application presentLocalNotificationNow:localNotification];
}