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

Google Play update check #19461

Open
c-ramarin opened this issue Feb 6, 2025 · 1 comment
Open

Google Play update check #19461

c-ramarin opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@c-ramarin
Copy link

c-ramarin commented Feb 6, 2025

Current behavior

I have been unsuccessful in my attempts to implement app store update check with Google Play.

I created a mock project, added

<PackageVersion Include="Xamarin.Google.Android.Play.Core" Version="1.10.3.16" />

To Directory.Packages.props

I added

<PackageReference Include="Xamarin.Google.Android.Play.Core" />

To .csproj

In Google Play Console, I linked a Google Cloud project and enabled Play Integrity API. I created a service account to go along with it.

I published the app on the Closed testing and uploaded subsequent version on internal sharing. I tried uploading both signed and unsigned versions of the app. I then download the app from the Google Play app store and run it to see the logs.

In code, I attempt to check for updates using:

IAppUpdateManager _updateManager = AppUpdateManagerFactory.Create(Context);
var updateListener = new AppUpdateSuccessListener(tsc);
            
AndroidTask updateTask = _updateManager.AppUpdateInfo;

updateTask.AddOnSuccessListener(updateListener);
updateTask.AddOnFailureListener(updateListener);

I get a response at OnFailure(Exception ex) with:
Install Error(-3): The API is not available on this device.

I tried clearing the Google Play cache but that did not help.

I would appreciate any tips on how to make this work. Thank you.

I attached the mock project I used to replicate and debug this issue.

Image

Expected behavior

Update check should run without raising an exception

How to reproduce it (as minimally and precisely as possible)

Create a project in Google Play and upload a build from the provided project. Publish project to closed testing track and share any subsequent update on Internal sharing for instant approval without review. Observe the logs and the exception that is raised on update check.

kahuaUpdateTest.zip

Workaround

No response

Works on UWP/WinUI

No

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

No response

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@c-ramarin c-ramarin added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 6, 2025
@ajpinedam ajpinedam self-assigned this Feb 6, 2025
@ajpinedam
Copy link
Contributor

I am investigating this issue, which is a problem affecting many people outside the .net world.

The most common issue is a mismatch on the app, signature, and/or name. We need to ensure we are testing with two apps signed with the same certificate. This means we cannot test this while debugging since the certificate usually differs from the one used to release to the store.

Also, folks have stated that this API will work only for public releases in the store. Using private beta releases could be why it's failing. Of course, this is not anywhere in the documentation.

Other people mentioned they have been able to get rid of the error by clearing the Google Play Store cache.

This issue seems to be a problem on the Android side, and unfortunately, they do not provide a way to deal with it. Android could provide better documentation and a way to validate that this feature works without forcing it to go through app releases.

cc: @jeromelaban

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

2 participants