Skip to content

Pass the anchor's ttl through to cloud anchor hosting - #36

Open
Brian-Simmons1 wants to merge 1 commit into
hlefe:mainfrom
Brian-Simmons1:fix/cloud-anchor-ttl-passthrough
Open

Pass the anchor's ttl through to cloud anchor hosting#36
Brian-Simmons1 wants to merge 1 commit into
hlefe:mainfrom
Brian-Simmons1:fix/cloud-anchor-ttl-passthrough

Conversation

@Brian-Simmons1

Copy link
Copy Markdown

ARPlaneAnchor serializes a ttl field from Dart ('ttl': instance.ttl in the anchor's toJson), but the native uploadAnchor handler never reads it — CloudAnchorNode.host(session) is called without a TTL, so every cloud anchor is hosted with sceneview's 1-day default regardless of what the caller sets.

This PR reads the serialized value, clamps it to ARCore's valid 1–365 day range, and passes it to host(session, ttlDays). Behavior is unchanged for callers who don't set ttl (default remains 1).

Note for users: TTLs above 1 day require ARCore keyless (OAuth) authorization — API-key auth is capped at 1 day by Google.

Verified on device: hosting logs show the requested TTL and anchors resolve after the previous 1-day expiry window.

Found and fixed in production while building VEEOP, an AR social location platform (github.com/VEEOP-app).

ARPlaneAnchor serializes a ttl field on the Dart side, but the native
uploadAnchor handler never read it, so every cloud anchor was hosted
with sceneview's 1-day default. Read the value (clamped to ARCore's
1-365 day range) and pass it to CloudAnchorNode.host.

Found and fixed in production while building VEEOP (https://veeop.com),
an AR social location platform - https://github.com/VEEOP-app
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.

1 participant