react-native-branch-deep-linking-attribution icon indicating copy to clipboard operation
react-native-branch-deep-linking-attribution copied to clipboard

advertisingIdentifier: reason for apple rejection.

Open pabloearg opened this issue 5 years ago • 20 comments

I'm using this configuration :

react-native: 0.61.5
react-native-branch: 4.3.0"

Apple rejects our application with the following message:

your Kids Category app collects IDFA information, which is not appropriate.

and to test if our application is using IDFA in some plugin, we execute the following command:

fgrep -R advertisingIdentifier .

which retrieve this:

./Pods/Branch/Branch-SDK/Branch-SDK/BNCSystemObserver.m:        SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier");
./Pods/Branch/Branch-SDK/Branch-SDK/BNCSystemObserver.m:            ((NSUUID* (*)(id, SEL))[sharedManager methodForSelector:advertisingIdentifierSelector])
./Pods/Branch/Branch-SDK/Branch-SDK/BNCSystemObserver.m:                (sharedManager, advertisingIdentifierSelector);

is there any way to remove any reference to IDFA?, or, is absolutely necessary for this plugin to have that in order to run?

This is currently blocking us from delivering any of our updates to the store.

pabloearg avatar Jul 30 '20 02:07 pabloearg

Branch is often used for marketing links and therefore uses the advertising identifier by default. It is NOT strictly necessary and can be removed by removing the AdSupport framework.

The RN layer makes this a bit more complex than in just native code. I'll talk to the team about it in the morning.

echo-branch avatar Jul 30 '20 03:07 echo-branch

Branch is often used for marketing links and therefore uses the advertising identifier by default. It is NOT strictly necessary and can be removed by removing the AdSupport framework.

The RN layer makes this a bit more complex than in just native code. I'll talk to the team about it in the morning.

after some test i can give you more information:

after the instalation of the plugin and a pod install, in my Pods-APPNAME.release.xcconfig and others xcconfig appears in OTHER_LDFLAGS this flag:

-framework "AdSupport"

And the other problem that we have is that this package has a dependency of FBSDKCoreKit that has the following lines, for example:

#import <AdSupport/AdSupport.h>

#pragma mark - AdSupport Classes

_fbsdkdfl_load_framework_once_impl_(AdSupport)
_fbsdkdfl_handle_get_impl_(AdSupport)

and a few more lines...

pabloearg avatar Jul 30 '20 18:07 pabloearg

Added a ticket to address this issue. Although the fix is rather simple, it may take a bit of time to get a release out since the work is spread across two SDKs.

  1. Update the Branch iOS SDK with a pod without AdSupport. https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/blob/master/Branch.podspec

  2. Update the Branch RN SDK with a version without AdSupport https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/blob/master/react-native-branch.podspec

If you're in a hurry, you can make the same changes locally.

  1. Checkout the Branch iOS SDK and remove AdSupport from the iOS SDK Branch.podspec
  2. Checkout the Branch RN SDK and edit react-native-branch.podspec to point to your local checkout of the Branch iOS SDK.
  3. Point your project to the local copy of the Branch RN SDK.

echo-branch avatar Jul 30 '20 19:07 echo-branch

Also, the FB specific code is not part of our SDK, it's included by RN itself. That code is dynamically checking for AdSupport so it's not an issue.

echo-branch avatar Jul 30 '20 19:07 echo-branch

should i change this lines

  s.frameworks = 'AdSupport', 'CoreServices', 'SystemConfiguration'
  s.ios.frameworks = 'WebKit', 'iAd', 'CoreTelephony'

to:

  s.frameworks = 'CoreServices', 'SystemConfiguration'
  s.ios.frameworks = 'WebKit', 'CoreTelephony'

or only this one:

  s.frameworks = 'CoreServices', 'SystemConfiguration'
  s.ios.frameworks = 'WebKit', 'iAd', 'CoreTelephony'

pabloearg avatar Jul 31 '20 12:07 pabloearg

on the other hand facebook no only wants us to remove AdSupport, but:

they want the app to contain absolutely no IDFA code, regardless of if it is called or not.

pabloearg avatar Jul 31 '20 12:07 pabloearg

Just to clarify, FB requested that code be removed? Cause it's their code. I can see Apple requesting it, but normally they just want the AdSupport framework removed cause that disables IDFA entirely.

echo-branch avatar Jul 31 '20 16:07 echo-branch

iAd is a different feature. It's used for Apple Search Ads support, if you dont use it you can remove it also. It is unrelated to IDFA.

echo-branch avatar Jul 31 '20 16:07 echo-branch

Just to clarify, FB requested that code be removed? Cause it's their code. I can see Apple requesting it, but normally they just want the AdSupport framework removed cause that disables IDFA entirely.

@echo-branch Sorry for my mistake, i was referring to apple not facebook, our app is still being rejected so, only removing AdSupport doesnt work,

we need to remove this:

./Pods/Branch/Branch-SDK/Branch-SDK/BNCSystemObserver.m: SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier"); ./Pods/Branch/Branch-SDK/Branch-SDK/BNCSystemObserver.m: ((NSUUID* (*)(id, SEL))[sharedManager methodForSelector:advertisingIdentifierSelector]) ./Pods/Branch/Branch-SDK/Branch-SDK/BNCSystemObserver.m: (sharedManager, advertisingIdentifierSelector);

pabloearg avatar Aug 04 '20 12:08 pabloearg

That's a rather odd request to remove that. Normally, Apple allows weak linking so that we can support both Apps that do use IDFA and apps that cannot use it.

Are you certain the AdSupport framework was removed and the app rebuilt?

If you enable logging in Branch you will see a variable set to "idfa" in the request payload if AdSupport is present. If it's not present you'll see the vendor id instead.

echo-branch avatar Aug 04 '20 16:08 echo-branch

@echo-branch we couldn't do anything to make apple keep rejecting us the version having branch, so we had to delete it.

I uploaded an issue to the ios branch team: 1049, but didn't get any response

pabloearg avatar Aug 13 '20 12:08 pabloearg

@echo-branch also you should keep mind that from ios 14 you cant use idfa for any other thing that isnt ad related

pabloearg avatar Aug 13 '20 12:08 pabloearg

@pabloearg IDFA has always been for Ads and related tasks such as Ad attribution. On native iOS, Branch is used for marketing purposes, marketing links and ad attribution, hence IDFA was included by default. React Native is the only platform where people use Branch for generic non-ads based linking, we failed to account properly for that use case and need to make IDFA optional.

There's on-going work on the iOS SDK to make that possible, but it will take some time to get that all the way to RN.

echo-branch avatar Aug 14 '20 16:08 echo-branch

just got a rejection today using react-native-branch 5.0.0 (latest) related to IDFA, thought it would be IDFA free already (uses latest Branch iOS SDK). Any thoughts?

erisvaldojunior avatar Sep 16 '20 16:09 erisvaldojunior

@erisvaldojunior Appears AdSupport.framework is still included by React Native itself, even though it appears they're not using it. This will trigger us to look for iDFA.

Try the following:

  1. Search for GCC_PREPROCESSOR_DEFINITIONS
  2. Locate Branch.debug.xcconfig and Branch.release.xcconfig
  3. Edit the preprocessor line to GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 BRANCH_EXCLUDE_IDFA_CODE=1
  4. Clean and rebuild

If you breakpoint in BNCSystemObserver.m at getAdId, it should now always return nil.

echo-branch avatar Sep 16 '20 17:09 echo-branch

Does anybody know if this has been addressed in a subsequent release so we don't have to patch the .xcconfig files?

elropero avatar Nov 17 '20 17:11 elropero

Last I checked, RN is still including the AdSupport.framework by default. Removing our conditional IDFA check will negatively impact our native iOS SDK and other plugins. We have a ticket backlogged to make this workaround for RN easier to use.

echo-branch avatar Nov 17 '20 18:11 echo-branch

What's the update on this? We need to ensure branch works correctly (link attribution) without relying on IDFA

mlfarrell avatar Feb 16 '21 23:02 mlfarrell

@mlfarrell If I'm understanding your comment, you're concerned about attribution with iOS 14.5 and no IDFA? There's quite a bit to unpack with those changes and this thread is just about the technical aspect of removing the IDFA from RN.

Please see this post for an intro on the impact to Branch. https://blog.branch.io/attribution-on-ios-14-welcoming-apples-new-world-order/

echo-branch avatar Feb 16 '21 23:02 echo-branch

I understand that now. I did do a BRANCH_EXCLUDE_IDFA_CODE build and was able to, even after a uninstall & reinstall attribute a link click on a device correctly. So I'm assuming i'm in the good here unless the previous idfa was somehow cached and linked to the IDFV on your servers.

mlfarrell avatar Feb 16 '21 23:02 mlfarrell