iOS 14 have new class for request tracking promission , and we want to be compatible with this method in advance, first of all, i cant submit my app with the new Api by Xcode12Beta3. so i want to use "respondsToSelector" api to confirm users device can use [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:], but when i use
[NSClassFromString(@"ATTrackingManager") respondsToSelector:NSSelectorFromString(@"requestTrackingAuthorizationWithCompletionHandler:")]
i get false status. only if i call the method once. after that,i can get the true status. this is very strange. i thing this would be a bug.
NSString *class = @"ATTrackingManager";
NSString *sel = @"requestTrackingAuthorizationWithCompletionHandler:";
if ([NSClassFromString(class) respondsToSelector:NSSelectorFromString(sel)]) {
void (^statusBlock)() = ^(int status) {
};
[NSClassFromString(className) performSelector:NSSelectorFromString(selName0) withObject:statusBlock];
}
/// [NSClassFromString(class) respondsToSelector:NSSelectorFromString(sel)]	 i get false
If I call the following iOS14 new method after the above method
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler: ^(ATTrackingManagerAuthorizationStatus status) {
}];
/// [NSClassFromString(class) respondsToSelector:NSSelectorFromString(sel)]	 i get true
is this a bug? i want get the right status.
2. when i update iOS 14 beta3 , i found in Setting-Privacy-Tracking there have the equipment master switch on the top.This is off default. but when this off, i call [[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler: ] i got deny status , i dont found a api for the equipment master switch status, can we have a new Api for developer to
confirm the equipment master switch in Setting-Privacy-Tracking?