AppsFlyerSDK / appsflyer-react-native-plugin

AppsFlyer plugin for React Native
MIT License
276 stars 197 forks source link

[iOS] How to use `disableIAdTracking` #173

Closed curiousdustin closed 3 years ago

curiousdustin commented 3 years ago

Report

I would like to disable IDFA collection and the use of iAd framework.

There are links in the documentation for the native SDK here.

disableIAdTracking

However, I do not see how to access the disableIAdTracking option via the API documented for this React Native version of the SDK.

Plugin Version

5.2.0

On what Platform are you having the issue?

ios

sokoloff06 commented 3 years ago

Hi @curiousdustin!

Thanks for reporting this one. We just released the new version 5.4.40 with the 2 new APIs:

disableAdvertiserIdentifier - to disable IDFA collection disableCollectASA - to disable iAd framework

I will close this issue as well as your second related issue, feel free to open new ones if you encounter any problems.

Thank you!

curiousdustin commented 3 years ago

These new APIs are great. Thank you.

However, these are for run time.

Part of my question was that I would like to remove the AdSupport and iAd frameworks completely from the app.

The instructions for the native SDK setup provide steps to do this. How can I apply these steps when using React Native?

smn-snkl commented 3 years ago

Having the same question over here.

sokoloff06 commented 3 years ago

@curiousdustin @smn-snkl I believe this can be solved from the native SDK side, I am checking with native iOS SDK developers.

In the meantime, can you try the steps described here for your iOS project? You still should be able to open the ios folder from your React Native project in Xcode and perform steps listed in the instructions.

Let us know how it goes, thanks!

curiousdustin commented 3 years ago

For anyone else looking, this also pertains to #172.

I cannot follow those steps in my React Native project. Here is why:

On step 4, I do see that AdSupport and iAd frameworks on in the Other Linker Flags section of Build Settings.

image

However, on step 5, when I try to edit this, all I see is ${inherited), -ObjC, and -lc++.

image

So, I cannot follow step 6 to remove the linker flags.

I believe that this is a result of using CocoaPods, which is default in recent versions of React Native.

When digging deeper, I determined that react-native-appsflyer does not add these framework linker flags directly. They get added by the AppsFlyerFramework pod that is defined as a dependency in the react-native-appsflyer podspec.

My current (unsustainable) solution is to fork the AppsFlyerFramework repo, and remove the linker flags. Then patch the react-native-appsflyer podspec file to remove the dependency, and instead, install my forked version in my project Podfile.

This is a very hacky workaround, so I am hoping your team can provide a more elegant and sustainable solution.

sokoloff06 commented 3 years ago

@curiousdustin you got it right. We are working with AppsFlyerFramework developers to exclude this dependency from the podspec or provide other viable solution

curiousdustin commented 3 years ago

@af-vs Any update on this?

af-fess commented 3 years ago

The native SDK iOS 6.0.1 is under test. I believe next week. CC @curiousdustin

curiousdustin commented 3 years ago

6.0.1 of which repo?

Release notes here already talk about 6.0.3 released weeks ago: https://support.appsflyer.com/hc/en-us/articles/115001224823#ios-sdk-v6-release-notes

I see no commits related to this request on https://github.com/AppsFlyerSDK/AppsFlyerFramework

Is there anything I can look at even though it isn't officially released?

sokoloff06 commented 3 years ago

@curiousdustin sorry for the confusion. This is planned for 6.0.4 of native SDK, thus, it will affect React Native plugin 6.0.40. Native SDK with the relevant changes is being tested. Not sure about ETA, but promise to keep you posted.

Thank you for your understanding!

curiousdustin commented 3 years ago

Apple is currently rejecting our app because of IDFA collection.

We need to be certain that AppsFlyer is not collecting IDFA.

What is the timeline to have 6.0.40 released?

amit-kremer93 commented 3 years ago

Hi @curiousdustin 6.0.40 will be release next week

amit-kremer93 commented 3 years ago

version 6.0.50 with iOS sdk 6.0.5 has released. If you still have this issue, please contact us!

curiousdustin commented 3 years ago

@amit-kremer93 , you closed this without answering this question:

I cannot follow those steps in my React Native project. Here is why:

On step 4, I do see that AdSupport and iAd frameworks on in the Other Linker Flags section of Build Settings.

image

However, on step 5, when I try to edit this, all I see is ${inherited), -ObjC, and -lc++.

image

So, I cannot follow step 6 to remove the linker flags.

Does 6.0.50 completely remove reliance on AdSupport and iAd, without any extra steps?

amit-kremer93 commented 3 years ago

@curiousdustin now you should be able to remove the frameworks according to this guide

curiousdustin commented 3 years ago

@amit-kremer93, sorry I do not understand what to do.

After updating to 6.0.50, my xcode project appears the same as I described before.

I cannot remove the frameworks from the other linker flags because they are inherited from the apps flyer pods.

Can you please point me to the commits that you feel should have resolved this issue? All I see in the commit logs are simple version changes, nothing that would appear to manipulate how things are linked.

amit-kremer93 commented 3 years ago

@curiousdustin sorry for misleading you. iOS sdk 6.0.5 does not relies on AdSupport and iAd, so it should work without any extra steps by you. Screen Shot 2020-10-21 at 13 56 06

be sure that the sdk version is 6.0.5, on the left side project navigator: Pods -> Pods -> AppsFlyerFrameWork -> Frameworks -> right click on AppsFlyerLib.framework and show in finder. in the finder go to: Versions -> A -> Headers and inside the file AppsFlyerLib.h, on the top of the file it should be written //AppsFlyer iOS SDK 6.0.5.

curiousdustin commented 3 years ago

I will check this shortly.

Does this mean that iOS sdk 6.0.5 NEVER uses AdSupport or iAd frameworks, even when you do not need to disable IDFA collection?

Can you explain how this works? How then do you get the IDFA when in fact an app DOES intend to allow IDFA collection?

Or does this mean that now there is an additional, opposite, setup step in which a developer would need to add the frameworks into their project, instead of remove them?

curiousdustin commented 3 years ago

Thank you, I can see that AppsFlyer iOS SDK 6.0.5 is indeed being used in my project now.

I can also see that neither iAd nor AdSupport frameworks are in the inherited other linker flags.

Still curious about my questions above.

curiousdustin commented 3 years ago

Also, should appsFlyer.disableAdvertisingIdentifier(true) be called before or after initSDK?

(I just want to do all things possible to make sure IDFA is not even attempted to be collected)

amit-kremer93 commented 3 years ago

yes. appsFlyer.disableAdvertisingIdentifier(true) should be called before initSDK

curiousdustin commented 3 years ago

Thanks. Any answers on my other question?