Reputation: 85
I have two apps on App-store. one for iPhone and one for iPad with same name.
Now when i am making an API call request to get some data from my servers from these two apps, i collect there user agent on server side.
User agent comes in two form:
NSUrlconnection
useragent : / xyz....Now for second case , i have no issue in distinguishing between iPhone/iPad.
But for case of NSURLConnection
request both have same and cant rely on
Any other distinguishing parameter can i get from user agent ?
both app are live right now ?
Upvotes: 0
Views: 67
Reputation: 3464
When you create object of NSMutableURLRequest
you need to add user agent using the below line.
NSString* userAgent = (is_iPad) : "iPad " ? "iPhone";
[request setValue:userAgent forHTTPHeaderField:@"User-Agent"];
here is_iPad is bool value contain true if app is running in ipad else false.
Upvotes: 1