title: how to read device token (parse.com) with phonegap/javascript iOS
body: <p>I'm developing an app for iOS with Phonegap and I'm using parse.com for push notification with iOS SDK included with Xcode. In my app users can login and I need to know the device token of the users to send to them single push notification, I know how to send the device token with the user/password during log in but I don't know how to read it, I don't know if there is any way directly with Phonegap or if I need to read it with C and then pass to Javascript with a variable.</p>
  
  <p>EDIT: I'm trying to use Malloc's solution, and i have this problem. i installed plugin via CLI but i don't understand how to use it. I create a sample page</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;script type="text/javascript&gt; parsePlugin.getInstallationId(function(id) { document.write(id); }, function(e) { alert('error'); }); 
  &lt;/script&gt; 
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>but of course i obtain a white page because this code don't print anything. 
  What i need to do if i want to assign installationid to a javascript variable?
  thanks</p>
  
  <p>UPDATE 2</p>
  
  <p>Now I have this code in my sample page</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;script type="text/javascript"&gt;
  
       var appId = p3Z10Nj2GdmfuxCX1a9liu5VlPadbvgW********;
      var clientKey = lFRl93OEDM0bFTVOKaA1iIXV4vuWS3S9********;
      //
      parsePlugin.initialize(
      appId,
      clientKey,
      function() {
  
      // The parse plugin is initialized correctly, query the installation id
      parsePlugin.getInstallationId(
          function(id) {
                  // Installation id is correctly queried
                  console.log('The installation id is: '+id);
          },
          function(e) {
                  alert('An error has occured while querying the installation id of your device');
      });
      },
      function(e) {
          alert('An error has occured while initializing the parse plugin');
  });
  
  &lt;/script&gt; 
  &lt;/body&gt; 
  &lt;/html&gt; 
  </code></pre>
  
  <p>UPDATE 3</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;script type="text/javascript"&gt;
  
  
   $(window).load(function() {
       var appId = p3Z10Nj2gm8siK;
      var clientKey = lFRl93OEDM0bFTVOKaA1iIXV4vu;
          //
          parsePlugin.initialize(
          appId,
          clientKey,
          function() {
  
          // The parse plugin is initialized correctly, query the installation id
          parsePlugin.getInstallationId(
              function(id) {
                      // Installation id is correctly queried
                      console.log('The installation id is: '+id);
              },
              function(e) {
                      alert('An error has occured while querying the installation id of your device');
          });
          },
          function(e) {
              alert('An error has occured while initializing the parse plugin');
      });
  }
  &lt;/script&gt; 
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>