oculus-samples / Unity-SharedSpatialAnchors

Unity-SharedSpatialAnchors was built to demonstrate how to use the Shared Spatial Anchors API, available in the Meta XR Core SDK for the Unity game engine.
MIT License
121 stars 47 forks source link

authenticated failed and shared spatial anchor can't work #21

Open chris312319 opened 7 months ago

chris312319 commented 7 months ago

I have tried Unity-discover and everything works fine. But I tried this with same app Id , it always shows "You are not authenticated to use this app. Shared spatial anchors will not work." I have tried another app Id, it still works fine in Discover. Is it the reason that SDK for this repostiry is too old?

stephenm2022 commented 7 months ago

Hi @chris312319. I just grabbed a fresh clone of the repository and I was able to successfully authenticate.

Did you update the Package Name (Bundle Identifier) of this project to match your app's? Both the App Id and Package Name are unique to each app on the store.

You can also try downloading the store build of your app first to enable the entitlement. After successful authentication with a store build, you can sideload apks from there.

Let me know if the issue remains after trying the above.

chris312319 commented 7 months ago

I have changed package name with my own company name, it works fine when I do same things in disocver.

And I haven't push Discover on to the store , is it necessary ?

I have two app in my Oculus developer center now, and both of its id can work with Discover though.

stephenm2022 commented 7 months ago

Most of the app features work in Discover without authentication. Have you confirmed that authentication is working via logs? The only feature that requires it is colocation (local multiplayer across two or more devices).

chris312319 commented 7 months ago

Yes, here is my video with Disocer test, which shows the shared spatial anchors worked. https://youtube.com/shorts/OwwHYl-NOPE?si=AmJyDf8xIzLdH1Uz

another test video: https://youtube.com/shorts/QtFyRONLFxc?si=uLGHXRZAAJvvpkun

So I think colocation works fine. But in spatial anchors examples,it doesn't.

stephenm2022 commented 7 months ago

Ok, thanks for confirming. Can you send me the logs from the SSA sample?

chris312319 commented 7 months ago

Ok, I will post the logs here tomorrow. Just log file in oculus 3 device? Or how can I get logs in oculus 3? Is logcat available?

stephenm2022 commented 7 months ago

Yes, logcat is available. You can use Meta Quest Developer Hub to filter Unity logs, or use the below adb command.

adb logcat -s Unity Activity$$anonymous$$anager Package$$anonymous$$anager dalvikvm DEBUG

chris312319 commented 7 months ago

12:21:12.369 OVRService Unable to find AppId for package (com.Chris312319.ssaSample) 12:21:12.369 OVRService com.oculus.horizon.service.ExternalPlatformLocal$PackageNotInLibraryException: Package com.Chris312319.ssaSample not in users library 12:21:12.369 OVRService at com.oculus.horizon.service.ExternalPlatformLocal.getAppID(:537096024) 12:21:12.369 OVRService at com.oculus.horizon.service.ExternalPlatformLocal.getAppID(:6) 12:21:12.369 OVRService at com.oculus.horizon.service.OVRService$4.logToMarauder(:34) 12:21:12.369 OVRService at com.oculus.aidl.OVRServiceInterface$Stub.onTransact(:124) 12:21:12.369 OVRService at android.os.Binder.transact(Binder.java:1064) 12:21:12.369 OVRService at com.facebook.secure.ktx.service.IdentityCheckingBinder.onTransact(:11) 12:21:12.369 OVRService at android.os.Binder.execTransactInternal(Binder.java:1179) 12:21:12.369 OVRService at android.os.Binder.execTransact(Binder.java:1143)

Is this the reason? This part also appears in Discover, but colocation can work like my video above, I have no idea why@@

*update But after serveral times of AppId not find, discover can find AppId like this: 12:28:39.847 [CT] SP:IA:SPSPostProcessor: Loaded Spatial Anchors - AppId: com.Chris312319.discover Anchors: 23 12:28:39.847 [CT] SP:IA:SPSPostProcessor: MATCH AppId: com.Chris312319.discover SA: 6c3073e3-3038-e1c9-c297-3ac58ee2ebe2 IA: d7fa952e-8bee-7f4b-58da-7bf4684255e8

*update I found out that though it shows authenticated failed when entering the room, but logs still contains: 13:16:38.001 [CT] SP:IA:SPSPostProcessor: Loaded Spatial Anchors - AppId: com.Chris312319.ssaSample Anchors: 6 13:16:38.001 [CT] SP:IA:SPSPostProcessor: MATCH AppId: com.Chris312319.ssaSample SA: 68c429aa-cc5f-d1c4-8cc4-9117d8ed4f32 IA: e53065d3-48c1-2 in the "fast colocation" scene.

stephenm2022 commented 7 months ago

Hi @chris312319. Thanks for sharing your logs. Both apps seem to be failing entitlements and platform authentication. You will need to upload an apk to one of the store channels to test your apps end to end.

https://developer.oculus.com/documentation/unity/unity-platform-entitlements#build-and-upload-the-apk-file

Discover will attempt to localize the spatial anchor even when platform authentication fails. If you are using the same account on two devices, it is likely that you will be able to localize the anchor without successfully sharing it.

chris312319 commented 7 months ago

Hi @chris312319. Thanks for sharing your logs. Both apps seem to be failing entitlements and platform authentication. You will need to upload an apk to one of the store channels to test your apps end to end.

https://developer.oculus.com/documentation/unity/unity-platform-entitlements#build-and-upload-the-apk-file

Discover will attempt to localize the spatial anchor even when platform authentication fails. If you are using the same account on two devices, it is likely that you will be able to localize the anchor without successfully sharing it.

After upload and download by AppLab, authenticated failed won't appear at all. But aonther question is that when I use any apply of anchors, it continuously popping "Saving anchor(s) failed.Retrying..." And if two people join colocation scene, it also happened. And if entering Fast Colocation scene and create an anchor, it will shows that Saving anchors failed.Possible reasons include an unsupported device. But I am using Quest 3

stephenm2022 commented 5 months ago

Hi @chris312319. Thanks for confirming that uploading to the store fixed the auth issue.

Be sure to enable 'Share Point Cloud Data' on your device: https://www.meta.com/help/quest/articles/in-vr-experiences/oculus-features/point-cloud/

Also, we just released a new version that adds support for the latest SDKs and OS.