performImmediateUpdate static method

Future<AppUpdateResult> performImmediateUpdate()

Performs an immediate update that is entirely handled by the Play API.

checkForUpdate has to be called first to be able to run this.

Implementation

static Future<AppUpdateResult> performImmediateUpdate() async {
  try {
    await _channel.invokeMethod('performImmediateUpdate');
    return AppUpdateResult.success;
  } on PlatformException catch (e) {
    if (e.code == 'USER_DENIED_UPDATE') {
      return AppUpdateResult.userDeniedUpdate;
    } else if (e.code == 'IN_APP_UPDATE_FAILED') {
      return AppUpdateResult.inAppUpdateFailed;
    }

    throw e;
  }
}