iOS使用廣告標示符審覈不通過解決方案

最近,iOS審覈,6.0以後,應用如果沒有廣告,而使用了AdSupport.framework,就會被reject

應用中原來的寫法

//        NSString *adId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
//
//        adId=[adId stringByReplacingOccurrencesOfString:@"-" withString:@""];
//
//        return adId;

樓主使用如下部分替換,並且刪除Link Binary中的AdSupport.framework的引用

NSBundle *adSupportBundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/AdSupport.framework"];
        [adSupportBundle load];
       
        if (adSupportBundle == nil) {
            return @"";
        }
        else{
           
            Class asIdentifierMClass = NSClassFromString(@"ASIdentifierManager");
           
            if(asIdentifierMClass == nil){
                return @"";
            }
            else{
                ASIdentifierManager *asIM = [[asIdentifierMClass alloc] init];
               
                if (asIM == nil) {
                    return @"";
                }
                else{
                   
                    if(asIM.advertisingTrackingEnabled){
                        return [asIM.advertisingIdentifier UUIDString];
                    }
                    else{
                        return [asIM.advertisingIdentifier UUIDString];
                    }
                }
            }
        }

多個版本均已審覈通過

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章