简体   繁体   中英

app rejected because of advertisingIdentifier in Facebook SDK and Flurry SDK

My app was rejected because of advertisingIdentifier in Facebook sdk and Flurry SDK ! I found an occurrence of advertisingIdentifier in the latest Facebook SDK (3.12) and Flurry SDK. Maybe you can check your library's for an occurence with the method below:

I opened the FacebookSDK.framework as a library in the terminal and typed the following command

otool -v -s __TEXT __objc_methname FacebookSDK | grep advertisingIdentifier

and the same way for Flurry SDK.

But I don't know what to do.?

For news: Flurry has recently update their SDK that not contain the "advertisingIdentifier", but Facebook not yet.

Update:

Since answering below I have submitted the app to the store, but with the edits suggested below Facebook is able only to track events without doing installation attribution tracking. Thus the problem with the solution below is that it effectively forbids Facebook to link installations to ad campaigngs on facebook.

A fix for this should be using the latest 3.13 Facebook SDK and simply removing the

-weak_framework AdSupport 

from your project as suggested below.

The app now compiles correctly without editing FBUtil.m and it does not link the AdSupport framework is removed from Pods.xconfig and Pods-Facebook-iOS-SDK.xconfig

I left the reply below so that you can see my previous attempt to remove AdSupport from the 3.12 version of the SDK, but DO NOT USE IT if you want to do install ads attribution tracking. (In fact you can use it only if you plan to do CPC ads, otherwise facebook will not be able to optimize the install ads campaigns).

OLD REPLY:

This seemed to be not enough in my case. To be sure, I wanted to remove the AdSupport Framework completely. In the Facebook SDK 3.12 the AdSupport Framework seems to be ALWAYS imported/linked even if it's not included in your project or pod file (in fact I am using cocoapods to install Facebook SDK).

The AdSupport framework was indeed not linked in my project but executing an "otool -L" on my app executable was showing that the framework was still being linked.

In order to avoid the current FB SDK to do that you need to edit the following:

In FBUtility.m

Comment this:

//#import <AdSupport/AdSupport.h>

Edit the following methods:

+ (NSString *)advertiserID {
    /*
    NSString *advertiserID = nil;
    Class ASIdentifierManagerClass = [FBDynamicFrameworkLoader loadClass:@"ASIdentifierManager" withFramework:@"AdSupport"];
    if ([ASIdentifierManagerClass class]) {
        ASIdentifierManager *manager = [ASIdentifierManagerClass sharedManager];
        advertiserID = [[manager advertisingIdentifier] UUIDString];
    }
    return advertiserID;
    */
    return @"";
}

+ (FBAdvertisingTrackingStatus)advertisingTrackingStatus {

    /*
    if ([FBSettings restrictedTreatment] == FBRestrictedTreatmentYES) {
        return AdvertisingTrackingDisallowed;
    }
    FBAdvertisingTrackingStatus status = AdvertisingTrackingUnspecified;
    Class ASIdentifierManagerClass = [FBDynamicFrameworkLoader loadClass:@"ASIdentifierManager" withFramework:@"AdSupport"];
    if ([ASIdentifierManagerClass class]) {
        ASIdentifierManager *manager = [ASIdentifierManagerClass sharedManager];
        if (manager) {
            status = [manager isAdvertisingTrackingEnabled] ? AdvertisingTrackingAllowed : AdvertisingTrackingDisallowed;
        }
    }
    */
    return AdvertisingTrackingDisallowed;
}

Finally if you're using cocoapods search in your project workspace all the

-weak_framework AdSupport

And delete all of those (you'll find those in Pods.xconfig and Pods-Facebook-iOS-SDK.xcconfig)

This has worked for me and now my app executable is free from AdSupport.

Get the source code from https://github.com/facebook/facebook-ios-sdk , instead of the compiled framework. Just deleting the framework and pasting in the source code should do it.

Go to FBUtility.m and modify this method:

+ (NSString *)advertiserID {
    NSString *advertiserID = nil;
    Class ASIdentifierManagerClass = [FBDynamicFrameworkLoader loadClass:@"ASIdentifierManager" withFramework:@"AdSupport"];
    if ([ASIdentifierManagerClass class]) {
        ASIdentifierManager *manager = [ASIdentifierManagerClass sharedManager];
        advertiserID = [[manager advertisingIdentifier] UUIDString];
    }
    return advertiserID;
}

to

+ (NSString *)advertiserID {
   return @"";
}

Just read this:

https://developers.facebook.com/bugs/242477629268301/

No code changes required.

You must delete Facebook-SDK as a bundle version on your project folder and then create a cocoapods and connect last version of these;

 pod 'FBSDKCoreKit'
 pod 'FBSDKShareKit'
 pod 'FBSDKLoginKit'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM