Load saved configuration from tkcsid

We’re trying to use desktop to mobile AR in our solution and I am wondering if support could be added possible to use the tkcsid query parameter as the initialConfiguration property for initializing the player or as the argument for the setConfiguration call or even adding a new function to the configuration object called loadConfiguration. I saw this post that provides an example for making a request to threekit to load the configuration and then pass that in, but it would be simpler and cleaner for clients to be able to simply use the tkcsid if possible:

During intialization: window.threekitPlayer({ ..., initialConfiguration: tkcsid });
or setConfiguration: configurator.setConfiguration(tkcsid);
or a new method loadConfiguration configurator.loadConfiguration(tkcsid);

Hi Mike,

In this desktop to mobile experience you’re wanting, is the scenario a user will configure an item on their computer, want to see it in AR and then launch the experience?

Or are you wanting to provide a specific configuration to the user and have that item show up in their space?

When AR is enabled on an embed, Threekit’s built-in desktop-to-mobile workflow will give your users the item as configured and launch it in AR.
image

The configurations will allow you to save configurations and retrieve them later by adding a tkcsid parameter to the URL. In that case, your users could return to an item as configured and then use our same desktop-to-mobile AR experience for AR launching.

If I’m missing the point please let me know! Happy to provide more resources.

Hi Will,
It’s for a standard desktop to mobile AR experience. My understanding is that when the user scans the QR code on the phone from the desktop, it navigates to the url for our app and appends a query param of the tkcsid. The phone’s browser now navigates to that url which executes our app’s code and since the player has not yet been loaded, it needs to load with the configuration specified by the tkcsid that is provided. In order to do that, it would be super easy if when initializing the player we could simply provide the tkcsid instead of making a request through the server configurations api to get the configuration and then pass it into the initialize command.

Does that make sense or am I missing anything?

I think it makes sense. Is the current process in your app taking too long to get from Desktop → AR because the user has to visit the page on their computer, configure the item, scan a code, load the player again on mobile, and then the AR launches?

We just tested this out and found that it didn’t work. We haven’t attempted to implement loading the configuration yet in order to pass it to the player but will be doing so in the near future to support this - it would just simplify things from our development standpoint to be able to use the config id directly so that’s why I put it in as a feature request.

Is my understanding correct though that after using the QR code, we can load the player, but the user will still need to press the AR button in the player to see it? It would be nice if scanning the QR code could directly cause the USDZ to be downloaded and AR displayed without any extra interaction from the user. Is there a call to the player we can make to programmatically do what the AR button does?

Scanning the QR code from a desktop device will launch you right into AR, there is no need for the user to click the view in your space button again once they are taken to the player. It will be there, but no further action from the user is required. I’ll post a video example at the bottom of this post.

Depending on if the item as configured has been exported before, the time it takes to launch can vary. Cached items will launch faster than items being used in AR for the first time. In either case, the user should be taken directly to the AR experience.

https://imgur.com/a/Mk60vZs

To your other point, yes it is definitely possible to create your own AR launcher. There is a thread about that here Custom launch AR button

I’m realizing now that topic is a bit dated, however the information from Google and Apple references in there can still be helpful. The newer and more efficient approach would be to pre-export the AR files and use our layers API to pass the configuration to the API. The format parameter would be ‘usdz’ or ‘glb’ depending on the device being used. The contingency is that the items must be pre-exported and exist in Threekit to be available in the layer service.

https://{env}.threekit.com/api/layers/layer?format=${format}&bearer_token=${token}?assetId=${assetId}&assetLayerConfiguration=${encodeURIComponent(JSON.stringify(configBody))}

This API call should return a fileId you can use to get the file directly from Threekit https://preview.threekit.com/api/files/${fileId}/content

I have created several myself so if you need any guidance I am happy to help.

I’m not sure we are completely on the same page. The QR code takes a user to our http://example.com?tkcsid=abc&enableAR=true on my phone. So, through our app (example.com) we still need to write the code that uses those query params to load the configuration and launch AR right? My feature request is that it would be easier to load that configuration when initializing the player if we can just pass in the tkcsid. Launching the AR experience on the mobile device doesn’t happen automatically, we need to implement it. Maybe we’ll need to connect to make sure I have the right understanding

I’ll DM you for more info