Hi all,
I’m working on a Unity project where I’m trying to implement Google Play In-App Updates, specifically the immediate update flow. However, I’m encountering the following error:
CS1503: Argument 1: cannot convert from 'Google.Play.AppUpdate.AppUpdateType' to 'Google.Play.AppUpdate.AppUpdateOptions'
Context:
1.Objective: I’m trying to initiate an immediate update using the Google Play Core SDK in Unity.
2.Error Occurrence: The error arises when calling `StartUpdate()` with this code:
var appUpdateRequest = appUpdateManager.StartUpdate(appUpdateInfo, appUpdateOptions);
3. My Setup:
- Unity Version:[2022.3.41f1]
- Google Play Core SDK Version: [2.1.0]
- Focusing only on immediate updates (not using flexible updates or prioritizing).
Code Snippet:
IEnumerator CheckForUpdate()
{
PlayAsyncOperation<AppUpdateInfo, AppUpdateErrorCode> appUpdateInfoOperation = appUpdateManager.GetAppUpdateInfo();
yield return appUpdateInfoOperation;
if (appUpdateInfoOperation.IsSuccessful)
{
var appUpdateInfo = appUpdateInfoOperation.GetResult();
var appUpdateOptions = AppUpdateOptions.ImmediateAppUpdateOptions();
var appUpdateRequest = appUpdateManager.StartUpdate(appUpdateInfo, appUpdateOptions);
yield return appUpdateRequest;
}
else
{
Debug.LogError("Error fetching update info: " + appUpdateInfoOperation.Error);
}
}
Questions:
1. How can I resolve the AppUpdateOptions type conversion error when starting the in-app update?
2. Is there a specific method to handle immediate updates in the Google Play Core SDK for Unity that I might be missing?
Any help or guidance would be much appreciated!
What I have tried:
I’ve already checked the documentation, and it seems like I'm using the correct method for immediate updates. But I’m still not sure how to fix this error.
- Is there something I’m missing in how I handle AppUpdateOptions or AppUpdateType?
- Do I need to set up something differently for immediate updates using the Play Core AP in Unity?
I would really appreciate it if anyone could point me in the right direction. Thanks!