Ant*_*nko 6 iphone notifications ios geofencing ios7
我的应用使用地理围栏并发送通知.
默认情况下,设置 - 应用程序的通知中的声音已关闭.
iOS 7准确无误.
有谁知道如何解决这一问题?
以下是负责此操作的代码:
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = [NSDate dateWithTimeInterval:5 sinceDate:[NSDate date]];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = [NSString stringWithFormat:@"You are near %@. Don't forget to check in!",place.name];
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 0;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
Run Code Online (Sandbox Code Playgroud)
如果在“设置”应用程序中关闭了应用程序的声音,则您的通知将不会播放任何声音。用户不允许你这样做。
如果“设置”应用程序中的声音未关闭,则您发布的代码应该可以工作。
此外,如果用户将铃声开关设置为关闭,则不会播放声音。
| 归档时间: |
|
| 查看次数: |
7353 次 |
| 最近记录: |