title: iOS client setup for GCM, need senderID clarification
body: <p>I'm working on an existing project consisting of a java GCM server, an android client (both working perfectly) and an iOS swift client (which is my work in progress).</p>
  
  <p>I've been following the google guide about setting up a client for iOS (this: <a href="https://developers.google.com/cloud-messaging/ios/client" rel="nofollow">https://developers.google.com/cloud-messaging/ios/client</a>) and successfully managed to:</p>
  
  <ul>
  <li><p>retrieve a device token from APNS</p></li>
  <li><p>send that token to Google GCM servers to get a registration ID</p></li>
  <li><p>send that registration ID to my GCM server for it to be stored and used later.</p></li>
  <li><p>server side, I'm apparently able to use that registration ID to send messages</p></li>
  </ul>
  
  <p>Sadly, not a single message sent to that registration ID will be received by my client.</p>
  
  <p>So I looked into the android client code and I found that it uses a different senderID.. tried that and got a HttpError 401 from google servers.</p>
  
  <p>So here's my question(s):</p>
  
  <ul>
  <li><p>is the senderID an ID of a <strong>Google</strong> server who will redirect messages to me? Or is it an ID of <strong>MY</strong> app server?</p></li>
  <li><p>when they say "the senderID is the project number you get when registering your project on the google console" do they mean "the app server project"? I'm asking this because when I registered my iOS client I got a server api key (which I ignored) along with that one "apparently working" senderID (the one I used to get a registration token to send to my server). So I believe in that case I might be missing my server's id.</p></li>
  <li><p>can the problem be the fact that my servers sends a "data only" message? I mean, it does not contain "notification" payload so maybe no one of my AppDelegate's "didReceiveRemoteNotification" is ever called for this reason. Should I implement another method/protocol? </p></li>
  </ul>
  
  <p>I'm quite desperate, I don't find this clarified anywhere and chances are I'm simply missing something obvious, even though my AppDelegate is like a copy-paste of the guide's example (by that I mean: I start GCMService, I successfully connect to it and everything that was done in the guide's example).
  Thanks in advance for any suggestion.</p>