Forum Discussion
Leon-VR-Lab
6 months agoProtege
Shared Mode - storing app data across sessions
We’re working on integrating a new license system for our VR training app and were hoping to get insights on two related issues we’re facing — particularly in the context of Meta for Work (MHMS).
Accessing MHMS Distributed Files
We’d like to support large-scale deployments by allowing customers to deploy encrypted license files to headsets via Horizon managed services (there us an option there to deploy files to devices). File distribution itself works fine, but we haven’t found a way to read these files from within the app at runtime, i.e. to have the proper permissions to read those files. Do you have any guidance on how to access these files from the app?
Storing License Info Locally
We also want to store license data locally on the device after activation (while online, in the case were they do not want to distribute license files), so the app can validate the license even when the device is offline. This is essentially the same encrypted data as the distributed file, just generated online and then downloaded to the device.
Is there a supported way to persist such data locally on MHMS-managed devices? We’re aware that local storage is very restricted across sessions, so we’d love to know if there is a way (now or with a future update). A work-around is keeping users in the same session, but that's not really ideal as users always will have the option to end a session.
For now we will be requiring MHMS devices to be online, but that's not a solution viable on the long term where you will also see devices being used offline. MHMS itself now supports offline use.
If there is a solution (so my first question and maybe to my second) this could also be used for trained led courses where the trainer sets the training options for a training session or even for the organization as a whole (think language and other regional options).
Hopefully someone can provide some insights.
8 Replies
- RiverExplorerStart Partner
I don't know anything about MHMS. I download files to persistent storage and read them.
I can do it with TCP, UDP, or HTML. And to persistent storage.
Application.persistentDataPath + "/myfile.ext" Then it is readable and writable.
Is MHMS devices, SDK, or API different?
- Leon-VR-LabProtege
Yeah. That works outside of the Realm of MHMS with Shared Mode and is pretty much what I'd like to use in MHMS Shared Mode as well.
The catch however is that MHSM with Shared Mode will wipe your local (persisted) app data (your data in Application.persistentDataPath) with every session restart. Share Mode Sessions have been setup to completely isolate VR sessions from one user to the other, but any option to persist data on-device got lost with it. I'm specifically looking for a way to have my downloaded/cached data (license data, training scenario configuration data such as language, etc.) survive session restarts in an offline environment.
- RiverExplorerStart Partner
Okay, thanks.
That as you have defined it seems impossible. As you defined it as wiping everything, yet not wiping everything.
By 'offline' do you mean no internet, or local only network? If the latter, could you have a local license caching server? You could do it with a Raspberry Pi. Or perhaps you could even have one headset that is not switching sessions, broadcasting 'hey I am a license server', and the other headset load from that?
- GATORSAURU5Meta Employee
Hello there!
Based on the info here, it sounds like you may be able to achieve the license validation with an entitlement check or server-side subscription validation rather than sending and reading an encrypted license file. I linked the documentation for entitlement checks and server APIs for managing subscriptions below so you can see if one of those might be what you're looking for.
https://developers.meta.com/horizon/documentation/unity/ps-entitlement-check/ https://developers.meta.com/horizon/documentation/unity/ps-subscriptions-s2s/
The key difference between the two is that entitlement checks can be done offline and only need to happen once to validate that the app is an official copy, while server-side subscription checks will need to connect to a server to validate that a subscription is still active. If you're looking to validate a license for a subscription, the second may be your best bet.
Let me know if this doesn't fit your use case and I can continue helping you find a solution.
-GATORSAURU5- Leon-VR-LabProtege
Implementing with an online server-side check is indeed or default method. However we need to cache data locally on the device for when the device is online (instructors using our app on-site may not be able to connect the device to Wifi all the time). And that data gets wiped with Shared Mode, session restarts.
Thanks for your suggestions but they would apply to Meta Store distributed apps, but store apps are not available for MHMS Shared Mode.
- GATORSAURU5Meta Employee
Unfortunately, there isn't currently a way to cache the license check on a device. This is because for licensed apps, the user's device will need to connect with the server on launch to confirm the license is still active. If the app were to cache a check on the device and the user's license expired, for instance, the user would continue to have access to the app until the cache cleared and the app connected to the server again.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 10 months ago
- 11 months ago