-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: Support for Apple TV (tvOS) with Unity #3161
Comments
@muZZkat can you clarify whether you need just the local database or also sync/functions support? @fealebenpae sounds like building for Apple TV should be simple enough - perhaps we can add preview support for the platform where we build the binaries but we don't setup the testing infrastructure for CI? |
@nirinchev I'm looking for the full setup, local & sync. I was just looking at the build scripts, it seems to be a pretty simple change to produce a realm-wrappers.framework for tvOS and then drop that into my project. Playstation/Switch support I'm not sure about yet, although with the realm-core source, I can't really see anything that might stop me adding those targets? |
Yes, just dropping the framework for tvOS should be sufficient, though there were some special casing we needed to do for iOS builds - e.g. here - I suspect we may need to do something similar for tvOS. |
Correct, the Dll imports need to be "__Internal" on tvOS as well. |
So I managed to hack things together today and got it working, I Duplicated build-ios.ps1 and changed it to tvOS, this got me my realm-wrappers.framework for tvOS. Worked out of the box on Mac. Updated and rebuilt the UnityWeaver dll, this wasn't so easy, I struggled with the developer environment on both Mac and Windows, but in the end, somehow got the Added the new framework to a tvOS folder in downloaded package tarball Replaced the Realm.UnityWeaver.dll and imported the tarball into Unity, I had errors around the Mono.Cecil reference, I assume this is why my dll was much smaller, does the packaged one include this? I worked around the issue by adding the Mono.Cecil package in unity. I did try just adding the block of code from the UnityWeaver into my own build scripts but I had a access permissions issue on the Mono.Cecil, it was showing as a internal class. So in the end, I now have it integrated and working (current just a read-only database) with OSX, Windows, Xbox, iOS, tvOS and Android. Awesome stuff. Happy to work on submitting a PR if you are interested, outside the build environments it didn't require many changes. Thanks for the help, I think I would have had no issues with the framework but the __Internal weaver would have stumped me. |
Hey, yeah, we're bundling all dependencies (notably Mono.Cecil) into the Realm.UnityWeaver.dll in order to avoid conflicts with other packages. Since Unity doesn't support NuGet or a similar package management system, if two libraries bring Mono.Cecil at different versions, Unity wouldn't be able to resolve this and you'd get build errors. By bundling the dependencies together, we get a slightly larger binary, but at least we know we're compatible with all other 3rd party products. I think we'll try and add 1st party support for Apple TV in the near future, but if you've already done it and don't mind putting up a PR, that'll definitely speed up the process. |
Hey @muZZkat I played around with our build scripts and also got a tvOS framework building. Thank you for offering but you don't need to submit a PR. |
@fealebenpae nice one, I figured it was probably something that was just easier for someone on your team to add. Thanks again and my next challenge will be Playstation 4/5 support... |
@muZZkat Product for Realm here. I would be interested to learn a little about your app and use case and perhaps I can answer some questions on future projects we may take up. If you could drop me a line at [email protected] we can find a time to chat |
FYI, I hit a little roadblock when i went to use a read/write database on tvOS as you don't have access to a file store (only key/value and CloudKit). For now, I've found using the cache directory works well and I store the user login information in the tvOS keystore, if the cache is deleted by tvOS, I simply re-sync the users data on launch. |
Description
We are developing a cross platform game with Apple TV support and it doesn't look like the current version ships with tvOS support.
We will also be looking at Playstation and Switch support, so maybe I need to look at building from source?
Can anyone maybe point me in the right direction?
Thanks
How important is this improvement for you?
Dealbreaker
The text was updated successfully, but these errors were encountered: