Search Unity

Question Need help to increase the max lifetime for the cloud anchors

Discussion in 'AR' started by arisdev82, Feb 24, 2021.

  1. arisdev82

    arisdev82

    Joined:
    Feb 27, 2019
    Posts:
    39
    Hi boys!

    I'm creating an AR app using cloud anchors. Everything works perfect, the anchors are hosted and resolved well. But they only remain alive 24h.

    Reading documentation and searching in the code i have find this: "This is configurable up to 365 days when keyless authentication is used." and "The lifetime of the anchor in days. Must be positive. The maximum allowed value is 1 if using an API Key to authenticate with the ARCore". which is certainly confusing for me as the app need the key to host the anchors in the cloud.

    At this point i have many questions:

    - How it can be possible to host an anchor without key? I get an "unauthorized error" trying this.

    - How it is possible to increase the lifetime for the anchors? By code I get an error and "Google Cloud Platform" website is very very confusing and I can't find anything but metrics.


    Any help? Thanks in advance!!
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Hey there! You might find this a good source of some useful info. :)
     
  3. Saicopate

    Saicopate

    Joined:
    Sep 25, 2017
    Posts:
    76
    Did you have any luck in enabling persistent anchors for longer than 24h?
     
  4. merrythieves

    merrythieves

    Joined:
    Apr 28, 2021
    Posts:
    14
    I am running into the same issue.

    The instructions posted here tell you you must use an API key:

    "To use the ARCore Cloud Anchor API in your app, you'll need an API Key."

    then on this page it states in the code comment:

    "maximum allowed value is 1 if using an API Key to authenticate with the
    // ARCore Cloud Anchor Service, otherwise the maximum allowed value is 365."

    So you can host an anchor for up to 365 days, but you must authenticate with the API to host a cloud anchor, and also if you authenticate you can only host for 1 day.

    Makes no sense. The app won't even build with any setting other than API key authentication in ARCore config.
     
  5. Vontine

    Vontine

    Joined:
    Nov 6, 2019
    Posts:
    2
    If you using Unity read this will help.

    This is what I did

    https://koolwin1.tistory.com/314
     
  6. Vontine

    Vontine

    Joined:
    Nov 6, 2019
    Posts:
    2
    Is there any ideas sharing CloudAnchor Id between devices in Unity Engine?

    I saw using Firebase to share id between devices but it's in Android Studio.
    https://codelabs.developers.google....oogle.com/?cat=android&%3Bhl=zh-TW&hl=zh-TW#4

    And I also saw CloudAnchorsManagement API but also using OAuth21 tool

    CloudAnchorsManagement API
    https://developers.google.com/ar/develop/platform-agnostic/cloud-anchors/management-api

    OAuth21 tool
    https://github.com/google/oauth2l

    I used Unity 2020.3.2f1 to build an app.
     
  7. Saicopate

    Saicopate

    Joined:
    Sep 25, 2017
    Posts:
    76
    Good guide, but there's no need to turn multithreaded rendering off.
     
  8. unity_5F3233DDF34AF1474DBC

    unity_5F3233DDF34AF1474DBC

    Joined:
    Dec 11, 2021
    Posts:
    18
    anyone here tried to place multiple ar objects and host it all at once ?
     
  9. ngthlong1990

    ngthlong1990

    Joined:
    May 5, 2022
    Posts:
    3
    I did try to host 1 anchor with multiple objects at the same time. But it was not precise as I expected, so I decided to host multiple anchors. That works fine.