title: gcm map users, webview login - Android/php
body: <p>I would like to map the gcm reg id to individual users on my site. </p>
  
  <p>What is the best way to accomplish this?</p>
  
  <p>I have a webview in android that loads my site where users are required to login, until login users are anonymous so i can only map the users after login.</p>
  
  <p>some thoughts are, </p>
  
  <p>Set the user agent string to the reg id if its not been registered, when logged in , if no id is mapped to the user then grab it from the user agent string.</p>
  
  <p>^^ that seems the easiest way for me as i'm a beginner but i can think of some flaws straight away.</p>
  
  <p>Monitor the page url,  if this can be done.  when the webview detects the url is "index.php"(user is logged in)  then executes the function within the application to send the reg id to the server.</p>
  
  <p>inject the code into a hidden field in the page before login and submit it with that?</p>
  
  <p>I'm not sure if any of these methods are viable, any help would be much appreciated. I'm still pretty much  beginner so laymans terms would be also appreciated.</p>