title: GCM - Device not registrered despite returned token
body: <p>In my Xamarin Android app I call</p>
  
  <pre><code>var instanceID = InstanceID.GetInstance(this);
  string token = instanceID.GetToken("xxx", GoogleCloudMessaging.InstanceIdScope, null);
  </code></pre>
  
  <p>and I get a token in return in the format e63498f:oijafa89fjaasi...</p>
  
  <p>In my c# program I call</p>
  
  <pre><code>HttpClient client = new HttpClient();
  
              client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
              client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "key=xxxx");
  
              //Get current connection
              string url = "https://gcm-http.googleapis.com/gcm/send";
  
              var message = new JObject();
              var data = new JObject();
  
              data.Add("message", "hello from csharp");
              message.Add("to", "e63498f:oijafa89fjaasi...");
              message.Add("data", data);
  
              HttpResponseMessage response = null;
  
              try
              {
                  response = await client.PostAsync(url, new StringContent(message.ToString(), Encoding.Default, "application/json"));
              }
              catch (Exception exp)
              {
                  MessageBox.Show(exp.Message);
                  return;
              }
  
              //Handle errors
              if (!response.IsSuccessStatusCode)
                  MessageBox.Show("Error: " + response.ToString());
  
              string responseBody = await response.Content.ReadAsStringAsync();
              textBox2.Text = responseBody;
  </code></pre>
  
  <p>I get the response: </p>
  
  <pre><code>{Text = "{\"multicast_id\":xxxx,\"success\":0,\"failure\":1,\"canonical_ids\":0,\"results\":[{\"error\":\"NotRegistered\"}]}"}
  </code></pre>
  
  <p>I have tryed alot of things but I cannot get it working. If I use the old GCM (gcm.register) there is no error message, but I don't want to use deprecated functionality. Why does GCM say that the token is not registrered when I just got a token returned from GCM? (The app is of course open while I do the test). Do I need to call some sort of method to actually register the token?</p>