-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(platform): consent to optional cookies through native ios framework #1845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
In favor of native tracking tooling.
| onUnmounted(() => { | ||
| if (import.meta.client) { | ||
| window.removeEventListener( | ||
| 'tracking-permission-result', | ||
| handleTrackingPermissionResult, | ||
| ) | ||
| } | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using https://vueuse.org/core/useEventListener/ would simplify the mount/unmount logic, just an idea.
| } | ||
| onMounted(() => { | ||
| if (import.meta.client) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onMounted should only be run on the client, so import.meta.client is not needed I'd say
| } | ||
| }) | ||
| const isIOS = computed(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use isAppIos from usePlatform() instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check if there is a way for the app to tell iOS to show the permission dialog again. Alternatively, we should hide the cookie button under the hamburger menu.
| const handleTrackingPermissionResult = (event: Event) => { | ||
| const customEvent = event as CustomEvent<string> | ||
| if (customEvent.detail === 'authorized') { | ||
| cookieControl.cookiesEnabledIds.value = [GTAG_COOKIE_ID] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can dynamically load the full list of optional cookies, something like:
const { moduleOptions } = useCookieControl()
moduleOptions.cookies.optional.map((x) => id.id)It would be best to have this utility function exported, but I don't find time to work on the cookie module currently, will maybe do this soon.
📚 Description
Consent for optional cookies should be set using the native ios tracking framework. AppTracking permission now acts as acceptance of cookies.
TODO:
cc @huzaifaedhi22
📝 Checklist