bất cứ ai có thể giúp tôi với triển khai thực hiện thông báo đẩy cho iOS 10 như tôi đã thực hiện sau mã nhưng vẫn nhận được vấn đề trong đó:Làm cách nào để triển khai thông báo đẩy cho iOS 10 [Objective C]?
#define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
if(SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(@"10.0"))
{
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){
if(!error){
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
}];
}
else {
// Code for old versions
}
Tôi nhận lỗi gợi ý rằng
Unknown nhận UIUserNotificationCenter
Cảm ơn bạn trước!
thấy điều này http://stackoverflow.com/questions/39382852/didreceiveremotenotification-not-called-ios-10/39383027 # 39383027 –