title: Send string from Android project to PCL with MessagingCenter
body: <p>This is my first post on this forum so any tips on how to make the question more understandable/readable and so on is appreciated.</p>
  
  <p><strong>What am I doing?</strong></p>
  
  <p>I am making my first app using Xamarin Forms, and I have two projects, PCL (Portable Class Library) and Android. My Android project receives incoming SMS from a specific number and saves it to a string. What I am trying to achieve is that by using MessagingCenter, send the string from my Android project to my PCL.</p>
  
  <p><strong>My problem:</strong></p>
  
  <p>I have seen a lot of threads regarding this, but there is something I am missing. And because I am new to this forum I can't write comments so I have to create my own question. Let me show you some of the code. (<code>parsedsms</code> is the string containing the SMS)</p>
  
  <p>SmsReceiver.cs (In my Android project)</p>
  
  <pre><code>MessagingCenter.Send&lt;SmsReceiver, string&gt; (this, "ParsedSmsReceived", parsedsms);
  </code></pre>
  
  <p>MissionPage.xaml.cs (In my PCL project)</p>
  
  <pre><code>MessagingCenter.Subscribe&lt;SmsReceiver, string&gt; (this, "ParsedSmsReceived",
  (sender, arg) =&gt; 
  { 
      string message = arg; 
  });
  </code></pre>
  
  <p>This is an example that I found on another thread here on Stackoverflow. My problem is that <code>parsedsms</code> can't be accessed from the PCL. How can I access the SmsReceiver class from my PCL? You can't add a reference from PCL (because it is a library I guess) to Android, only the other way around.</p>