Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

AndroidAssetPacks.ShowConfirmationDialogAsync

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static ConfirmationDialogAsyncOperation ShowConfirmationDialogAsync();

Returns

ConfirmationDialogAsyncOperation Returns an object that represents the request operation. If you yield this object inside a coroutine, the coroutine pauses until the operation is complete.

Description

Displays a dialog that asks the user for consent to download asset packs that require user confirmation or WiFi connection.

If the device isn't connected to WiFi, large Android asset pack downloads pause until a WiFi connection is available. In this case, the asset pack has the AndroidAssetPackStatus.WaitingForWifi status. Asset packs can also have AndroidAssetPackStatus.RequiresUserConfirmation status if the current app version was not installed through the Google Play Store. In both situations, the asset packs require user consent to download. To get this consent, call ShowConfirmationDialogAsync to give the user the option to download your application's asset packs using mobile data or to update the app if a valid version isn't installed. This method directly wraps Google's PlayCore plugin API. If the PlayCore plugin is missing, calling this method throws an InvalidOperationException exception.

Additional resources: ConfirmationDialogAsyncOperation, AndroidAssetPacks.CancelAssetPackDownload, AndroidAssetPacks.DownloadAssetPackAsync, AndroidAssetPacks.GetAssetPackStateAsync, AndroidAssetPackStatus.RequiresUserConfirmation, AndroidAssetPackStatus.WaitingForWifi.


Declaration

public static void ShowConfirmationDialogAsync(Action<AndroidAssetPackConfirmationDialogResult> callback);

Parameters

Parameter Description
callback The callback method to get the user's response. Must have an AndroidAssetPackConfirmationDialogResult parameter containing the user's response. The application invokes this callback once after the user submits their decision.

Description

Displays a dialog that asks the user for consent to download asset packs that require user confirmation or WiFi connection.

If the device isn't connected to WiFi, large Android asset pack downloads pause until a WiFi connection is available. In this case, the asset pack has the AndroidAssetPackStatus.WaitingForWifi status. Asset packs can also have AndroidAssetPackStatus.RequiresUserConfirmation status if the current app version was not installed through the Google Play Store. In both situations, the asset packs require user consent to download. To get this consent, call ShowConfirmationDialogAsync to give the user the option to download your application's asset packs using mobile data or to update the app if a valid version isn't installed. This method directly wraps Google's PlayCore plugin API. If the PlayCore plugin is missing, calling this method throws an InvalidOperationException exception.

Additional resources: AndroidAssetPackConfirmationDialogResult, AndroidAssetPacks.CancelAssetPackDownload, AndroidAssetPacks.DownloadAssetPackAsync, AndroidAssetPacks.GetAssetPackStateAsync, AndroidAssetPackStatus.RequiresUserConfirmation, AndroidAssetPackStatus.WaitingForWifi.