visionOS and SwiftUI
Use the window group and immersive space context entities and events to understand user behavior within visionOS apps on Apple's Vision Pro headset.
Track the opening and dismissing of SwiftUI window groups using OpenWindowEvent
and DismissWindowEvent
. These events can be used in any SwiftUI app, not just visionOS. The event data is sent as a window group context entity attached to these events; the events themselves have no properties.
Use the OpenImmersiveSpaceEvent
and DismissImmersiveSpaceEvent
to automatically add an immersive space context entity to all events occurring within an immersive space. The entity will identify the immersive space in which the events occurred. This feature is enabled by default for the iOS tracker. Again, the events themselves have no properties.
Snowplow currently only supports visionOS apps via SwiftUI, not Unity.
Window group context entityโ
Schema for a window group entity, representing the SwiftUI window group that the event occurs in.
Schema URI:iglu:com.apple.swiftui/window_group/jsonschema/1-0-0
Web | Mobile | Tracked automatically |
---|---|---|
โ | โ | โ |
๐ Example
{
"id": "group1",
"window_id": "BC374B59-B8E7-4F09-B100-FD5F9AAC0E27",
"title_key": "window1",
"window_style": "automatic"
}
๐ Schema properties definition
- Table
- JSON schema
Property | Type | Description | Required? |
---|---|---|---|
window_id | ["string","null"] | UUID for the current window within the group. | โ |
id | "string" | A string that uniquely identifies the window group. Identifiers must be unique among the window groups in your app. | โ |
title_key | ["string","null"] | A localized string key to use for the window's title in system menus and in the window's title bar. Provide a title that describes the purpose of the window. | โ |
window_style | One of: automatic, hiddenTitleBar, plain, titleBar, volumetric, | A specification for the appearance and interaction of a window. | โ |
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.apple.swiftui",
"name": "window_group",
"format": "jsonschema",
"version": "1-0-0"
},
"description": "Schema for a window group entity, representing the SwiftUI window group that the event occurs in.",
"type": "object",
"properties": {
"window_id": {
"type": [
"string",
"null"
],
"format": "uuid",
"description": "UUID for the current window within the group."
},
"id": {
"type": "string",
"description": "A string that uniquely identifies the window group. Identifiers must be unique among the window groups in your app.",
"maxLength": 255
},
"title_key": {
"type": [
"string",
"null"
],
"description": "A localized string key to use for the window's title in system menus and in the window's title bar. Provide a title that describes the purpose of the window.",
"maxLength": 4096
},
"window_style": {
"type": [
"string",
"null"
],
"enum": [
"automatic",
"hiddenTitleBar",
"plain",
"titleBar",
"volumetric",
null
],
"description": "A specification for the appearance and interaction of a window."
}
},
"required": [
"id"
],
"additionalProperties": false
}
Immersive space context entityโ
Schema for an immersive space entity, representing the VisionOS immersive space that the event occurs in.
Schema URI:iglu:com.apple.swiftui/immersive_space/jsonschema/1-0-0
Web | Mobile | Tracked automatically |
---|---|---|
โ | โ | โ |
๐ Example
{
"id": "space1",
"view_id": "C0A92B47-9654-4889-BC95-97E1C3721A53",
"immersion_style": "mixed",
"upper_limb_visibility": "visible"
}
๐ Schema properties definition
- Table
- JSON schema
Property | Type | Description | Required? |
---|---|---|---|
view_id | ["string","null"] | UUID for the view of the immersive space. | โ |
id | "string" | The identifier of the immersive space to present. | โ |
immersion_style | One of: automatic, full, mixed, progressive, | The style of an immersive space. | โ |
upper_limb_visibility | One of: automatic, visible, hidden, | Preferred visibility of the user's upper limbs, while an immersive space scene is presented. | โ |
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.apple.swiftui",
"name": "immersive_space",
"format": "jsonschema",
"version": "1-0-0"
},
"description": "Schema for an immersive space entity, representing the VisionOS immersive space that the event occurs in.",
"type": "object",
"properties": {
"view_id": {
"type": [
"string",
"null"
],
"format": "uuid",
"description": "UUID for the view of the immersive space."
},
"id": {
"type": "string",
"description": "The identifier of the immersive space to present.",
"maxLength": 255
},
"immersion_style": {
"type": [
"string",
"null"
],
"enum": [
"automatic",
"full",
"mixed",
"progressive",
null
],
"description": "The style of an immersive space."
},
"upper_limb_visibility": {
"type": [
"string",
"null"
],
"enum": [
"automatic",
"visible",
"hidden",
null
],
"description": "Preferred visibility of the user's upper limbs, while an immersive space scene is presented."
}
},
"required": [
"id"
],
"additionalProperties": false
}
Open window eventโ
Schema for an event for opening a SwiftUI window or window group.
Schema URI:iglu:com.apple.swiftui/open_window/jsonschema/1-0-0
Web | Mobile | Tracked automatically |
---|---|---|
โ | โ | โ |
๐ Example
{}
๐ Schema properties definition
- Table
- JSON schema
Property | Type | Description | Required? |
---|
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.apple.swiftui",
"name": "open_window",
"format": "jsonschema",
"version": "1-0-0"
},
"description": "Schema for an event for opening a SwiftUI window or window group.",
"type": "object",
"properties": {},
"additionalProperties": false
}
โ How to query the event in the warehouse?
- Snowflake
- BigQuery
- Databricks
- Redshift & Postgres
select
unstruct_event_com_apple_swiftui_open_window_1 open_window_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'open_window'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_open_window_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'open_window'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_open_window_1
from
atomic.events events
where
events.collector_tstamp > timestampadd(HOUR, -1, current_timestamp())
and events.event = 'unstruct'
and events.event_name = 'open_window'
and events.event_vendor = 'com.apple.swiftui'
and unstruct_event_com_apple_swiftui_open_window_1 is not null
select
"open_window_1".*
from
atomic.events events
join atomic.com_apple_swiftui_open_window_1 "open_window_1"
on "open_window_1".root_id = events.event_id and "open_window_1".root_tstamp = events.collector_tstamp
where
events.collector_tstamp > getdate() - interval '1 hour'
and "open_window_1".root_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'open_window'
and events.event_vendor = 'com.apple.swiftui'
Dismiss window eventโ
Schema for an event for dismissing a SwiftUI window or window group.
Schema URI:iglu:com.apple.swiftui/dismiss_window/jsonschema/1-0-0
Web | Mobile | Tracked automatically |
---|---|---|
โ | โ | โ |
๐ Example
{}
๐ Schema properties definition
- Table
- JSON schema
Property | Type | Description | Required? |
---|
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.apple.swiftui",
"name": "dismiss_window",
"format": "jsonschema",
"version": "1-0-0"
},
"description": "Schema for an event for dismissing a SwiftUI window or window group.",
"type": "object",
"properties": {},
"additionalProperties": false
}
โ How to query the event in the warehouse?
- Snowflake
- BigQuery
- Databricks
- Redshift & Postgres
select
unstruct_event_com_apple_swiftui_dismiss_window_1 dismiss_window_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'dismiss_window'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_dismiss_window_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'dismiss_window'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_dismiss_window_1
from
atomic.events events
where
events.collector_tstamp > timestampadd(HOUR, -1, current_timestamp())
and events.event = 'unstruct'
and events.event_name = 'dismiss_window'
and events.event_vendor = 'com.apple.swiftui'
and unstruct_event_com_apple_swiftui_dismiss_window_1 is not null
select
"dismiss_window_1".*
from
atomic.events events
join atomic.com_apple_swiftui_dismiss_window_1 "dismiss_window_1"
on "dismiss_window_1".root_id = events.event_id and "dismiss_window_1".root_tstamp = events.collector_tstamp
where
events.collector_tstamp > getdate() - interval '1 hour'
and "dismiss_window_1".root_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'dismiss_window'
and events.event_vendor = 'com.apple.swiftui'
Open immersive space eventโ
Schema for an event for opening a visionOS immersive space.
Schema URI:iglu:com.apple.swiftui/open_immersive_space/jsonschema/1-0-0
Web | Mobile | Tracked automatically |
---|---|---|
โ | โ | โ |
๐ Example
{}
๐ Schema properties definition
- Table
- JSON schema
Property | Type | Description | Required? |
---|
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.apple.swiftui",
"name": "open_immersive_space",
"format": "jsonschema",
"version": "1-0-0"
},
"description": "Schema for an event for opening a visionOS immersive space.",
"type": "object",
"properties": {},
"additionalProperties": false
}
โ How to query the event in the warehouse?
- Snowflake
- BigQuery
- Databricks
- Redshift & Postgres
select
unstruct_event_com_apple_swiftui_open_immersive_space_1 open_immersive_space_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'open_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_open_immersive_space_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'open_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_open_immersive_space_1
from
atomic.events events
where
events.collector_tstamp > timestampadd(HOUR, -1, current_timestamp())
and events.event = 'unstruct'
and events.event_name = 'open_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
and unstruct_event_com_apple_swiftui_open_immersive_space_1 is not null
select
"open_immersive_space_1".*
from
atomic.events events
join atomic.com_apple_swiftui_open_immersive_space_1 "open_immersive_space_1"
on "open_immersive_space_1".root_id = events.event_id and "open_immersive_space_1".root_tstamp = events.collector_tstamp
where
events.collector_tstamp > getdate() - interval '1 hour'
and "open_immersive_space_1".root_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'open_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
Dismiss immersive space eventโ
Schema for an event for dismissing a visionOS immersive space.
Schema URI:iglu:com.apple.swiftui/dismiss_immersive_space/jsonschema/1-0-0
Web | Mobile | Tracked automatically |
---|---|---|
โ | โ | โ |
๐ Example
{}
๐ Schema properties definition
- Table
- JSON schema
Property | Type | Description | Required? |
---|
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.apple.swiftui",
"name": "dismiss_immersive_space",
"format": "jsonschema",
"version": "1-0-0"
},
"description": "Schema for an event for dismissing a visionOS immersive space.",
"type": "object",
"properties": {},
"additionalProperties": false
}
โ How to query the event in the warehouse?
- Snowflake
- BigQuery
- Databricks
- Redshift & Postgres
select
unstruct_event_com_apple_swiftui_dismiss_immersive_space_1 dismiss_immersive_space_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'dismiss_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_dismiss_immersive_space_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'dismiss_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
select
unstruct_event_com_apple_swiftui_dismiss_immersive_space_1
from
atomic.events events
where
events.collector_tstamp > timestampadd(HOUR, -1, current_timestamp())
and events.event = 'unstruct'
and events.event_name = 'dismiss_immersive_space'
and events.event_vendor = 'com.apple.swiftui'
and unstruct_event_com_apple_swiftui_dismiss_immersive_space_1 is not null
select
"dismiss_immersive_space_1".*
from
atomic.events events
join atomic.com_apple_swiftui_dismiss_immersive_space_1 "dismiss_immersive_space_1"
on "dismiss_immersive_space_1".root_id = events.event_id and "dismiss_immersive_space_1".root_tstamp = events.collector_tstamp
where
events.collector_tstamp > getdate() - interval '1 hour'
and "dismiss_immersive_space_1".root_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'dismiss_immersive_space'
and events.event_vendor = 'com.apple.swiftui'