title: How do I pass the value of a variable from a plugin to a project?
body: <p>I am creating a plugin for Android on Ionic/Angular. I don't know a way to pass the value of a variable from an android application (QRData from BroadcastReceiver) to the code of my project (call.resolve(ret)).
  Now the QR-code is scanned in the application and its decryption is displayed in the console of the Android Studio. And I want to work with this qr-code in the code of the angular-project / ionic-application (for example, based on the decoding of the QR - display information on it on the screen). The ionic application works on a &quot;Sunmi L2&quot; phone with a built-in infrared QR-code reader, so I am writing the ionic plugin myself.</p>
  <pre><code>import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.util.Log;
  
  import com.getcapacitor.JSObject;
  import com.getcapacitor.Plugin;
  import com.getcapacitor.PluginCall;
  import com.getcapacitor.PluginMethod;
  import com.getcapacitor.annotation.CapacitorPlugin;
  
  @CapacitorPlugin(name = &quot;ScannerQR&quot;)
  public class ScannerQRPlugin extends Plugin {
  
      BroadcastReceiver QRCODE_SUNMI = new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
              // TODO Think of a way to pass 'call' to code; and so - everything works
              String QRData = intent.getStringExtra(&quot;data&quot;);
              Log.d(&quot;SCAN_QR&quot;, QRData);
              // TODO Need a way to pass QRData to the Angular-project code
          }
      };
  
      @PluginMethod
      public void echo(PluginCall call) {
          try {
              getContext().unregisterReceiver(QRCODE_SUNMI);
          } catch (Exception ex) {
              Log.i(&quot;unregisterReceiver&quot;, &quot;Ignore Disabling Receiver&quot;);
          }
          getContext().registerReceiver(QRCODE_SUNMI, new IntentFilter(&quot;com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED&quot;));
  
          JSObject ret = new JSObject();
          ret.put(&quot;value&quot;, &quot;Any text from application to Angular-project&quot;);
          call.resolve(ret);
      }
  }
  </code></pre>
  <p>Tell me how to do this?</p>