AndroidX icon indicating copy to clipboard operation
AndroidX copied to clipboard

Added missing snapshot apis

Open akghasemi opened this issue 2 months ago • 4 comments

This pull request adds missing Snapshot APIs for Play Games Services V2, which are currently skipped in the Xamarin bindings (see issue #972). Attempts to expose them via Metadata.xml were unsuccessful, as the bindings ignored the relevant classes. I resolved this by manually adding bindings to the Additions folder. These APIs are actively used in my game and confirmed to be working.

akghasemi avatar Nov 01 '25 10:11 akghasemi

@akghasemi

Generated code approach is really not recommended, because in future .NET versions tooling could generate different code and this might not work.

It took me few months to clean all up. Historically we had to resort to that workaround, because of bugs in our tooling. Today it should be much much better.

moljac avatar Nov 04 '25 07:11 moljac

@moljac I understand that the generated code approach is generally not recommended. However, as #1308 demonstrates, Metadata.xml simply cannot surface these Snapshot APIs — I tried multiple variations and the binding generator consistently skipped them without warnings.

Given that, there isn’t really another viable option right now. In my view, it’s better to have bindings that work, even if they rely on a less‑ideal approach, than to leave these APIs inaccessible. This way developers can actually use them today, while we continue to track improvements in the tooling for future .NET versions.

If/when the generator is fixed, I’d be happy to revisit and clean this up. For now, this workaround ensures functionality without blocking real use cases.

akghasemi avatar Nov 15 '25 10:11 akghasemi

At minimum, I think we'd need the .NET 10 version of the generator output, though, thanks!

jonathanpeppers avatar Nov 17 '25 14:11 jonathanpeppers

taking a look today

moljac avatar Nov 18 '25 08:11 moljac