How to enable IMCE in a field of a custom block I have module that generates a plugin block with a field of type managed_file.

public function blockForm($form, FormStateInterface $form_state){
    $config = $this-&gt;getConfiguration();
    // todo make this IMCE
    $form['background'] = array(
      '#type' =&gt; 'managed_file',
      '#title' =&gt; $this-&gt;t('Background'),
      '#description' =&gt; $this-&gt;t('Enter background image'),
      '#default_value' =&gt; isset($config['background'])?$config['background']:'',
      '#upload_location' =&gt; 'public://backgrounds',
      '#weight' =&gt; '2',
    );
}


I guess I have to create a module.schema.yml file to do that but I don't know how to enable the IMCE. 

block.settings.stingray_basic_block:
  type: block_settings
  label: 'Stingray basic block'
  mapping:
    body:
      type: text
      label: 'Body'
      translatable: true
    background:
      type: managed_file
      labe: 'Background'
      ??? MAKE IT IMCE ???


Usually this boolean appears in the core.entity_form_display...yml file as a third party settings structure:

content:
  field_background:
    weight: 1
    settings:
      preview_image_style: thumbnail
      progress_indicator: throbber
    third_party_settings:
      imce:
        enabled: true
    type: image_image


...but I don't know if it can be set in the schema.yml file nor how.

Anyone has info on this?

ref: https://www.drupal.org/node/2821710
You can provide an alternative URL input(type=text) for IMCE integration.

You just need to include drupal.imce.input library and set the input class name as "imce-url-input". Also see imce.input.js file

if (\Drupal::moduleHandler()-&gt;moduleExists('imce') &amp;&amp; \Drupal\imce\Imce::access()) {
  $form['background'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; $this-&gt;t('Background URL'),
    '#attached' =&gt; array('library' =&gt; array('imce/drupal.imce.input')),
    '#attributes' =&gt; array('class' =&gt; array('imce-url-input')),
    '#default_value' =&gt; isset($this-&gt;configuration['background']) ? $this-&gt;configurati‌​on['background'] : '',
  );
}