firebase-analytics icon indicating copy to clipboard operation
firebase-analytics copied to clipboard

iOS requestTrackingAuthorization

Open crebuh opened this issue 4 years ago • 4 comments

Hi Guys,

is there a way to trigger a permission request like it is possible for other permissions like location, notifications, camera etc.?

I added NSUserTrackingUsageDescription to my Info.plist file. But this is only the message which will be shown inside the request dialog.

According to Apple (https://developer.apple.com/documentation/apptrackingtransparency) there is a native method whichg is called requestTrackingAuthorization. But how can I trigger this method from my typescript code?

Currently I've build an own dialog using the capacitor dialog plugin and then I enable or disable Analytics with the setCollectionEnabled method according to the user input. Before that I'm not tracking anything. Seems legit to me, but I'm not sure If this works for Apple as well.

How can this be done correctly?

crebuh avatar Jun 04 '21 06:06 crebuh

This would be a great feature to implement. Do you know how we could go about doing this?

aidanm1999 avatar Sep 24 '21 11:09 aidanm1999

@aidanm1999

I went for this one in the meanwhile https://github.com/mahnuh/capacitor-plugin-app-tracking-transparency and combined it with the firebase-analytics plugin

crebuh avatar Nov 15 '21 13:11 crebuh

Thanks @crebuh! I'll check it out

aidanm1999 avatar Nov 15 '21 13:11 aidanm1999

@aidanm1999

I went for this one in the meanwhile https://github.com/mahnuh/capacitor-plugin-app-tracking-transparency and combined it with the firebase-analytics plugin

What exactly do you do when the user selects "Ask App Not to Track"?

There is no way to disable IDFA in runtime, right?

Instead, do you just completely disable the plugin via FirebaseAnalytics.disable();? Is that necessary?

...and won't that be too late since some sensitive data was already sent to Google?

nijakobius avatar Feb 01 '23 20:02 nijakobius