Non-https production build url hides start AR button

This is an issue now as before a recent Needle change to hide AR buttons on unsupported devices, the ‘Needs HTTPS for AR’ button would show for a url that wasn’t https on an AR supported device. Now that button simply doesn’t show and the user has no idea they need to use https url instead to see the Start AR button

Original Post on Discord

by user 103054507105067008

Generally recommend you enforce HTTPS for any website

Which is as simple as adding:

      if(location.protocol == 'http:' &&'localhost') < 0) location.protocol = 'https:';

to your index.html

Only noticed this when just typing the url in android chrome without typing any http stuff before, it defaults to non https

by user 103054507105067008

Ah thankyou

by user 103054507105067008

Look like this is the actual reason for this problem then? Discord

Yep, I agree that’s annoying. I consider adding it to the WebXR component as a toggle, on by default (“Enforce HTTPS”)

That would be very useful

by user 103054507105067008

I believe it will only open the HTTP one if the page you’re sharing from is on HTTP. That QR Code is always the literal URL you’re on

I think this is the issue causing the glitch one then, will include that script in my templates from now on cheers

by user 103054507105067008

Does this also affect when we are running from the unity editor? I am not seeing the button on my ios device when I run the sample project .

by user 690383379958333460

On iOS you need to have a USDZExporter component (because iOS does not have WebXR support (yet))

Where should I add the exporter component? I added it to the needle exporter, however, on my ios device it doesn’t show the button

by user 580207235171614720

On iOS you need to add the USDZExporter component right now too.

Is it a separate exporter or a component to the exporter? I read that you should add it to the WebXR object and also tried that and it isn’t working.

by user 580207235171614720

It’s a separate component. You can theoretically add it anyhwere but it’s cleaner to put it next to the WebXR component.

When you add it export the scene / update your local host and then open the website on your iOS device