Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
272 views
in Technique[技术] by (71.8m points)

ios - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...