Most visited

Recently visited

ARScene.CloudAnchorHostListener

public static interface ARScene.CloudAnchorHostListener

com.viro.core.ARScene.CloudAnchorHostListener


Callback interface for responding to anchor hosting requests. See hostCloudAnchor(ARAnchor, CloudAnchorHostListener) for more details.

Summary

Public methods

abstract void onFailure(String error)

Invoked when hosting fails.

abstract void onSuccess(ARAnchor cloudAnchor, ARNode arNode)

Invoked upon the successful hosting of a cloud anchor.

Public methods

onFailure

void onFailure (String error)

Invoked when hosting fails. Hosting can fail for a number of reasons: no network access, limited AR tracking, or misconfiguration. The error message is provided in the callback.

Parameters
error String: The error message.

onSuccess

void onSuccess (ARAnchor cloudAnchor, 
                ARNode arNode)

Invoked upon the successful hosting of a cloud anchor. When a local ARAnchor is hosted, it replaced by a new "cloud" ARAnchor, which is provided in this callback. The cloud anchor has a unique cloud anchor ID which you can retrieve via getCloudAnchorId(). Other clients can use this ID with resolveCloudAnchor(String, CloudAnchorResolveListener) to pull down this same anchor, creating a shared AR experience.

You can also use this callback to add additional content to the given ARNode in response to its successful hosting. The ARNode provided here is the same ARNode that was associated with the local ARAnchor that was hosted: it contains all the content it had previously, except now it belongs to the cloud anchor.

Parameters
cloudAnchor ARAnchor: The new, successfully hosted, cloud anchor.

arNode ARNode: The ARNode that is attached and synchronized to the cloud anchor, to which you can add virtual content. This is the same ARNode that was associated with the local ARAnchor prior to its hosting.

Hooray!