capacitor-community / capacitor-community/firebase-analytics

iOS requestTrackingAuthorization

Open
#95 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
178
Forks
70
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the plugin exposes TypeScript methods to the iOS implementation, then compare the requested native requestTrackingAuthorization entry point with the existing setCollectionEnabled call. Review the Info.plist requirement and Apple’s AppTrackingTransparency documentation; done means the native authorization request can be triggered correctly from TypeScript.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, ios, typescript
Domain
analytics, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.