【发布时间】:2017-01-05 06:37:19
【问题描述】:
我正在使用以下代码来检测这 2 个(推送通知和位置服务)
[postvars setObject:([CLLocationManager locationServicesEnabled])?@"true":@"false" forKey:@"locationServicesEnabled"];
BOOL pushEnabled = [[UIApplication sharedApplication] isRegisteredForRemoteNotifications];
[postvars setObject:(pushEnabled)?@"true":@"false" forKey:@"pushServicesEnabled"];
但问题是,即使我在应用程序中出现提示时点击“不允许”,我也总是对两者都正确。同样在设置应用程序中,我检查了位置设置为从不并且通知子标题显示。这段代码有什么问题?谁能指导我。
【问题讨论】:
标签: ios push-notification cllocationmanager xcode7.2