Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

app rejected because of advertisingIdentifier in Facebook SDK and Flurry SDK

Tags:

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.

like image 604
chawki Avatar asked Feb 05 '14 10:02

chawki


People also ask

How can I update my Facebook SDK?

Login into Facebook and navigate to https://developers.facebook.com/apps/ Select the App you want to upgrade (you might have access to multiple apps) Click Settings > Advanced. Select the latest version under the Upgrade API Version section for both “Upgrade All Calls” and “Upgrade Calls for App Roles”

What does SDK mean in Facebook?

The Facebook SDK is a set of software components that developers can include in their mobile app to understand how people use the app, run optimized marketing campaigns and enable Facebook login and social sharing.

How do I add Facebook SDK framework to Xcode?

In Xcode, click File > Swift Packages > Add Package Dependency. In the dialog that appears, enter the repository URL: https://github.com/facebook/facebook-ios-sdk. In Version, select Up to Next Major and the default option. Complete the prompts to select the libraries you want to use in your project.


2 Answers

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.

like image 168
Diego Avatar answered Sep 20 '22 14:09

Diego


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 @""; } 
like image 28
Andrew Avatar answered Sep 20 '22 14:09

Andrew