Skip to content

Conversation

@dargmuesli
Copy link
Member

@dargmuesli dargmuesli commented Apr 3, 2025

📚 Description

Consent for optional cookies should be set using the native ios tracking framework. AppTracking permission now acts as acceptance of cookies.

  • Cookie banner is hidden for IOS

TODO:

  • consent to optional cookies through native ios framework

cc @huzaifaedhi22

📝 Checklist

  • All commits follow the Conventional Commit format or I'm fine with a squash merge of this PR
  • The PR's title follows the Conventional Commit format

Comment on lines +149 to +156
onUnmounted(() => {
if (import.meta.client) {
window.removeEventListener(
'tracking-permission-result',
handleTrackingPermissionResult,
)
}
})
Copy link
Member Author

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) {
Copy link
Member Author

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(() => {
Copy link
Member Author

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?

Copy link
Member Author

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]
Copy link
Member Author

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.

@CLAassistant
Copy link

CLAassistant commented Jun 28, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants