sending the device token and app version to server
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8309742/how-to-send-the-device-token-and-app-version-to-server">How to send the device token and app version to server</a>  </p>
</blockquote>



<p>I have implemented the push notification service in my application, But am not able to send the device token id and app version to server.</p>

<p>Thanks in advance.</p>

<p>Here is the my code</p>

<pre><code>- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
    // Get Bundle Info for Remote Registration (handy if you have more than one app)
    NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    // Prepare the Device Token for Registration (remove spaces and &lt; &gt;)
    NSString *deviceToken = [[[[devToken description]
                        stringByReplacingOccurrencesOfString:@"&lt;"withString:@""]
                        stringByReplacingOccurrencesOfString:@"&gt;" withString:@""]
                        stringByReplacingOccurrencesOfString: @" " withString: @""];
    NSMutableString *urlString = [[BASE_URL mutableCopy] autorelease];
    [urlString appendFormat:@"traceDeviceTokenId?tokenid=%@&amp;version=%@",deviceToken, appVersion];
    NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    NSString *postLength = [NSString stringWithFormat:@"%d", [urlString length]];
    NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
    [request setURL:url];
    [request setHTTPMethod:@"POST"]; 
    [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
    [request setValue:@"text/xml; charset=utf-16" forHTTPHeaderField:@"Content-Type"];
    [request setHTTPBody:[urlString dataUsingEncoding:NSUTF16StringEncoding]];
    NSLog(@"Request xml&gt;&gt;&gt;&gt;&gt;&gt; %@", urlString);
    NSError *error; 
    NSURLResponse *response;
    NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error];
    NSString *responseXml = [[NSString alloc] initWithData:urlData encoding:NSUTF16StringEncoding];
    NSLog(@"Response xml&gt;&gt;&gt;&gt;&gt;&gt; = %@", responseXml);
}
</code></pre>
