Skip to content

Register the Unity Android OAuth callback at build time #2092

Closed

Description

@ChiragAgg5k

Tracks PR #2089.

Plan

Goal: Make OAuth sign-in on Android return to the app for Unity SDK users. The package currently ships a manifest with a literal appwrite-callback-<YOUR_PROJECT_ID> scheme that can never be filled in when the package is installed from a git URL (read-only), and that manifest also redeclares UnityPlayerActivity with a launcher intent filter that competes with the project's own main manifest.

What changes (PR #2089):

  • Remove templates/unity/Assets/Runtime/Core/Plugins/Android/AndroidManifest.xml.twig and its file entry and Android plugin-importer meta handling in src/SDK/Language/Unity.php.
  • Add templates/unity/Assets/Editor/AppwriteAndroidManifestProcessor.cs.twig, an IPostGenerateGradleAndroidProject (guarded by UNITY_ANDROID) that reads projectId from every AppwriteConfig asset and appends a VIEW/DEFAULT/BROWSABLE intent filter for appwrite-callback-<projectId> to the Unity activity in the generated Gradle manifest, skipping schemes already declared. Logs guidance when no config with a project ID exists.
  • templates/unity/README.md.twig: new "OAuth on Android" section, including the custom main manifest route for clients created in code.
  • templates/unity/Assets/Editor/AppwriteSetupWindow.cs.twig: Documentation button opens the SDK README on GitHub instead of sdk.url; Discord button uses sdk.discordUrl and is hidden when unset.
  • tests/generation/GenerationTest.php: tests that no AndroidManifest.xml or <YOUR_PROJECT_ID> placeholder ships, that the processor registers the same appwrite-callback- prefix WebAuthComponent waits for, and that the setup window links to the README with no fixed Discord invite.

Remaining steps: None beyond the linked PR; it is the full change. The fix reaches users with the next Unity SDK release generated from sdk-generator.

Done when:

Activity

  1. self-assigned this
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions