-
Notifications
You must be signed in to change notification settings - Fork 185
Unity client sdk #1105
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
base: master
Are you sure you want to change the base?
Unity client sdk #1105
Conversation
Moved Unity SDK template files from 'templates/unity/Runtime' and 'templates/unity/Editor' to 'templates/unity/Assets/Runtime' and 'templates/unity/Assets/Editor' for better alignment with Unity project conventions. Updated getFiles() in Unity.php to reflect new paths and added support for copying plugin DLLs and project settings. Improved file upload logic in Client.cs.twig to handle streams and byte arrays more robustly, and removed Unity-specific logging from Exception.cs.twig. Minor fixes in Realtime.cs.twig and Role.cs.twig for namespace and async handling.
Introduces Unity2021 test support by adding a Unity2021Test.php, Unity test source files, and updating the GitHub Actions workflow to include Unity2021 in the test matrix and set the UNITY_LICENSE environment variable. This enables automated testing for the Unity SDK within the CI pipeline.
I am also attaching instructions on how to obtain a Unity license painlessly. |
The basic functionality tested in the test is guaranteed to work, but I'm not sure about the rest. I will continue to refine it. Also, a question: What to implement next for the client SDK? |
The test failed because the secret is not configured in appwrite/sdk-generator. The successful test is here: |
// Cookie support
client.SetCookie() / client.GetCookie()
// Real-time subscriptions
realtime.Subscribe(channels, callback)
// Connection testing
await client.Ping() The successful test is here: |
Added support for saving, loading, and deleting cookies using PlayerPrefs and JSON serialization. Improved domain and path matching logic, expanded Set-Cookie header parsing to handle SameSite and Max-Age attributes, and ensured expired cookies are cleaned automatically. The Cookie class now includes a SameSite property, and cookie management methods trigger persistence updates.
Implements saving, loading, and deleting session and JWT tokens using PlayerPrefs for persistent storage. Session data is now automatically loaded on Client initialization and saved/cleared when relevant headers are set or removed. Refactored request creation logic for JSON requests into a dedicated method.
Hello, @abnegate
![]() |
The Unity and DotNet SDKs use common elements from shared. The only difference is that each SDK has its own client. Also, necessary items for the client SDK. I think I'll send this branch to PR when PR unity is accepted or in the near future (if dotnet is going to be changed, it will be done in shared). |
Introduces OAuth2 authentication flow and deep link handling for Unity (Editor, WebGL, iOS, Android) via a new WebAuthComponent. Adds cookie management with persistent storage and WebGL credentials support. Updates code generation templates to support new authentication, cookie handling, and platform-specific logic. Adds AndroidManifest.xml for OAuth deep link support and WebGLCookies.jslib for WebGL credential patching.
Extended the Unity service template to include 'general' services for extension imports. Removed OAuth2 related test cases and responses from Unity2021Test.php and Tests.cs, reflecting changes in service requirements.
stable Introduces OAuth2 authentication flow and deep link handling for Unity (Editor, WebGL, iOS, Android) via a new WebAuthComponent. Adds cookie management with persistent storage and WebGL credentials support. Updates code generation templates to support new authentication, cookie handling, and platform-specific logic. Adds AndroidManifest.xml for OAuth deep link support and WebGLCookies.jslib for WebGL credential patching.
OAuth functionality has been added and tested on Web and Android platforms. While implementing this feature, I accidentally ended up creating a small Unity Playground, so you can now try out the functionality directly in your browser. Repositories: |
Add tests for new Query methods in Unity
The Unity SDK README was rewritten for clarity, modernized with improved badge links, updated installation and dependency instructions, and new quick start code samples for both AppwriteManager and direct Client usage
cosmetic fix
normalize domain value
The Unity language class now extends DotNet, removing Unity-specific overrides and template files. Unity code generation now uses shared .NET templates, reducing duplication and maintenance overhead. Updated file mappings and removed Unity-specific template files accordingly.
Refactor Unity SDK to inherit from DotNet and reuse templates
In any case, it will be necessary to accept #1138 first as it synchronized Unity and DotNet in general. |
What does this PR do?
This PR adds comprehensive Unity SDK support to the SDK generator by:
Unity Language Implementation: Introduces a new
Unity
language class (src/SDK/Language/Unity.php
) that extends the baseLanguage
class, providing Unity-specific type mappings, keywords, and code generation logic for C# in Unity environment.Unity Template System: Adds a complete set of Unity-specific templates under
templates/unity/Assets/
including:Automated Testing Integration: Introduces Unity2021 test support with:
Unity2021Test.php
test class that integrates with the existing test frameworkTests.cs
,Tests.asmdef
) for comprehensive SDK testingunityci/editor:ubuntu-2021.3.45f1-base-3.1.0
CI/CD Integration: Updates the GitHub Actions workflow to:
UNITY_LICENSE
environment variable for Unity Editor automationUnity Project Structure: Implements proper Unity package structure with:
Assets/Runtime/
andAssets/Editor/
Test Plan
The testing strategy includes:
Unit Testing: The
Unity2021Test.php
runs comprehensive tests covering:Docker-based CI Testing: Tests run in a controlled Unity environment using:
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
Yes