WVR_UnpersistSpatialAnchor

WVR_EXPORT WVR_Result WVR_UnpersistSpatialAnchor(const WVR_SpatialAnchorName * persistedSpatialAnchorName)

Function is used to remove a persisted anchor.

Developers use this API to remove a persisted anchor on runtime.

Note: Once the persisted spatial anchor list has been changed, the corresponding event (WVR_EventType) will be fired. This API will cause WVR_EventType_PersistedAnchor_Changed event.

Version
API Level 14
Parameters
  • persistedSpatialAnchorName: the unique name of this persisted anchor, refer to WVR_SpatialAnchorName
Return Value
  • WVR_Success: Remove a persisted anchor successfully.
  • others: WVR_Result mean failure.

How to use

Sample function:

WVR_SpatialAnchorName persistedName = {"uniquePersistedName"};
if (WVR_UnpersistSpatialAnchor(&cacheName) == WVR_Success) {
    // unpersist the anchor successfully
}
// somewhere to listen persisted spatial anchor list change event
void ProcessEvent() {
    WVR_Event_t event;
    while(WVR_PollEventQueue(&event)) {
        switch (event.common.type) {
            case WVR_EventType_PersistedAnchor_Changed: {
                // .....

                break;
            }
        }
    }
}