检测应用程序是否在iOS Beta上运行?

| 我在iOS应用商店中有一些受iAd / AdMob支持的应用。我注意到,每次发布iOS Beta时,广告请求都会骤降。我假设这是由于许多人都在运行Beta操作系统,因此几乎总是会收到iAd测试广告。我的代码可以通过某种方式检测应用程序是否处于beta操作系统版本吗?这样,我可以默认使用AdMob,从而获得一些收入。     
已邀请:
        这不是一个特别好的方法,但是您可以阅读设备版本并将其与当前已知的最高发行版本进行比较,如果设备版本更高,则可以还原为AdMob。 这将以字符串形式获取设备版本:
[[UIDevice currentDevice] systemVersion]
您可以将其转换为浮点值,然后将其与硬编码版本进行比较,但这意味着一旦发布了新的iOS,即部署新版本:
if ([[[UIDevice currentDevice] systemVersion] floatValue] > 4.3) 
{
    // revert to AdMob...
}
作为稍微更好的解决方案,您可以从网站上请求当前的最大iOS发布版本...只需在您的站点上放置一个内容为“ 4.3 \”的iosversion.txt文件,然后使用该文件来控制开关。 不幸的是似乎没有
[[UIDevice currentDevice] isBeta]
类型的方法。     
        根据谣言,iOS版本8将于9月发布。 因此,您可以使用:
NSDate *today = [NSDate date];

NSString *releaseDateString = @\"2014-09-15 00:00:00\";
NSDateFormatter *dateFormater = [[NSDateFormatter alloc] init];
[dateFormater setDateFormat:@\"yyyy-MM-DD HH:mm:ss\"];
NSDate *release = [dateFormater dateFromString:releaseDateString ];
NSComparisonResult comp = [today compare:release];

if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 && result == NSOrderedAscending) return @\"Beta\";
else return @\"Release Version\";
或获取网址标题:https://www.apple.com/ios/并检查iOS?
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    NSString *title = [webView stringByEvaluatingJavaScriptFromString:@\"document.title\"];
    title = [title stringByReplacingOccurrencesOfString:@\"Apple - iOS \" withString:@\"\"];
    int version = [title intValue]; // 6, 7, 8...
}
    

要回复问题请先登录注册