Tips & Tricks
Here you can find helpful tips and tricks on getting the most out of ConjureKit. Have more tips that are worth mentioning here? Please tell us on Discord. We would love to hear more.
General
Automatic reconnect
In cases where the app disconnects from the Hagall server (e.g. when it's inactive or loses network connection), you can implement an automatic reconnect using the following suggested pattern:
Start()
{
_conjureKit = new ConjureKit();
_conjureKit.OnStateChanged += state =>
{
if (state == State.Disconnected) _conjureKit.Connect();
};
_conjureKit.Connect();
}
Additionally, to improve the user's experience, consider saving the session information. Upon reconnecting, you can then attempt to join the same session:
private string _sessionId;
Start()
{
_conjureKit = new ConjureKit(arCamera.transform, appKey, appSecret);
_conjureKit.OnStateChanged += state =>
{
if (state == State.Disconnected)
_conjureKit.Connect(
_sessionId,
session => Debug.Log("Successfully rejoined the previous session"),
error =>
{
Debug.Log($"Failed to rejoin the previous session. Joining a new session. Error: ${error}");
_conjureKit.Connect();
});
};
_conjureKit.Connect(session => _sessionId = session.Id );
}
Android
AR Required: Make sure the ARCore is “Required” and that Depth is set to "Optional" if it is indeed not required by the app.
Minimum API Level: The recommended setting is API Level 30 (the bare minimum for AR Required apps is 24).
Enable Sustained Performance Mode: This mode has better thermals and makes for a stabler SLAM session.
Use Persistent Raycasts: Optional, but highly recommended! Also known as "Instant Placement". "Allows users to place AR objects instantly without first having to move their device"
Disable Match Frame Rate: Optional. Choose if a high fps experience is important. This does not guarantee a 60 fps camera feed but gives a chance for the graphical content to be rendered at a high frame rate. The content might appear out-of-sync with the background. This will allow the app developer to set the Application.targetFrameRate = 60; for their app.
Official Google recommendations: