Skip to content
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

INFO: How to use Play Integrity in .NET MAUI with .NET 9.0 #1054

Open
Auto72 opened this issue Nov 26, 2024 · 4 comments
Open

INFO: How to use Play Integrity in .NET MAUI with .NET 9.0 #1054

Auto72 opened this issue Nov 26, 2024 · 4 comments

Comments

@Auto72
Copy link

Auto72 commented Nov 26, 2024

Android framework version

net9.0-android

Affected platform version

Visual Studio 2022 ver. 17.12.1 | .NET 9.0.100

Description

I have a .NET MAUI with .NET 8.0 project and I use Play Integrity with the following references:

Image

xamarin/GooglePlayServicesComponents#881

If I convert the .NET MAUI project from .NET 8.0 to .NET 9.0, these references are not valid anymore and the GooglePlayServicesComponents library has been deprecated.

https://github.com/xamarin/GooglePlayServicesComponents

So the question is: how do I reference the new android-libraries in a .NET MAUI project with .NET 9.0, to be able to use Play Integrity?

Thanks.

Relevant log output

@Auto72 Auto72 changed the title How to use Play Integrity in .NET MAUI with .NET 9.0 INFO: How to use Play Integrity in .NET MAUI with .NET 9.0 Nov 26, 2024
@jpobst
Copy link
Contributor

jpobst commented Nov 26, 2024

If I convert the .NET MAUI project from .NET 8.0 to .NET 9.0, these references are not valid anymore and the GooglePlayServicesComponents library has been deprecated.

As https://github.com/xamarin/GooglePlayServicesComponents?tab=readme-ov-file#deprecated-repository says, no GooglePlayServicesComponents libraries have been deprecated. They are the exact same packages just shipped out of this repository instead of the old one.

@Auto72
Copy link
Author

Auto72 commented Nov 29, 2024

The Update process from .NET 8.0 to .NET 9.0 of my .NET MAUI App removes the following NuGet libraries:

Image

that is the "GooglePlayServicesComponents" with its external dependencies, used to be able to compile in .NET 8.0.
So, now that I am in .NET 9,0, what NuGet packages I have to use in place of "GooglePlayServicesComponents".
This is what I can't understand.

The "android-libraries" has no NuGet package.
I see its read-me says:

This repository binds over 600 Android libraries that are published to NuGet.org. The full package list can be found in config.json.

But I can't figure out which one to use.
Can you help me on this, please?

Thanks.

@Auto72
Copy link
Author

Auto72 commented Dec 3, 2024

Any hint on this ?

@jpobst
Copy link
Contributor

jpobst commented Dec 3, 2024

Use the exact same packages you were using for .NET 8. The packages have not changed.

You will need to restrict them to only using the "android" <TargetFramework> just like they were before:

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
  <PackageReference Include="Xamarin.Google.Android.Play.Integrity" Version="1.3.0.3" />
</ItemGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants